StormLib API Reference

SFileSetMaxFileCount

Description

bool WINAPI SFileSetMaxFileCount(
  HANDLE hMpq,                    // Handle to an open archive
  DWORD dwMaxFileCount            // New limit of file count in the MPQ
);

Function SFileSetMaxFileCount changes the limit for number of files that can be stored in the archive. No files are changed during this operation.

Parameters

hMpq
[in] Handle to an open archive. This handle must have been obtained by SFileOpenArchive or SFileCreateArchive.
dwMaxFileCount
[in] New size of the hash table. This parameter must be in range of HASH_TABLE_SIZE_MIN and HASH_TABLE_SIZE_MAX (defined in StormLib.h).

Return Value

When the function succeeds, it returns nonzero. On an error, the function returns false and GetLastError gives the error code.

Remarks

SFileSetMaxFileCount rebuilds the entire hash table and HET table in the MPQ. To succeed, all files in the MPQ must be known by name. Before any changes, SFileSetMaxFileCount verifies if it can calculate hash table indexes for each file in the archive. If that check fails, the function returns error. No changes to the MPQ are done if the function fails.

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