StormLib API Reference

SFileOpenPatchArchive

Description

bool WINAPI SFileOpenPatchArchive(
  HANDLE hMpq,                      // Handle to an open MPQ (primary MPQ)
  const char * szMpqName,           // Patch archive file name
  const char * szPatchPathPrefix,   // Prefix for patch file names
  DWORD dwFlags                     // Reserved
);

Function SFileOpenPatchArchive adds a patch archive to the existing open MPQ. The MPQ must have been open by SFileOpenArchive, and also with MPQ_OPEN_READ_ONLY specified. The patch archive is added to the list of patches that belong to the primary MPQ. No handle is returned, and the patch(es) is closed when the primary MPQ handle is closed. The patch MPQ opened during the process is maintained internally by StormLib and cannot be accessed directly.

Parameters

hMpq
[in] Handle to a MPQ that serves as primary MPQ when patched.
szMpqName
[in] Name of the patch MPQ to be added.
szPatchPathPrefix
[in] Pointer to patch prefix for file names. This parameter can be NULL, which makes StormLib to determine patch prefix for the specific combination of names of the base MPQ and patch MPQ.
dwFlags
[in] Reserved for future use.

Return Value

When the function succeeds, it returns nonzero. When the archive cannot be added as patch archive, function returns false and GetLastError gives the error code.

Remarks

The following table shows how patch prefix works:

 

Availability in Storm.dll

Available in Storm.dll No
Ordinal number in Storm.dll 1.00 N/A
Ordinal number in Storm.dll 1.09 N/A