StormLib API Reference
SFileCreateArchive
bool WINAPI SFileCreateArchive( const char * szMpqName, // Archive file name DWORD dwFlags, // Additional flags to specify creation details DWORD dwMaxFileCount, // Limit for file count HANDLE * phMPQ // Pointer to result HANDLE );
Function SFileCreateArchive opens or creates the MPQ archive. The function can also convert an existing file to MPQ archive. The MPQ archive is always open for write operations.
The function internally verifies the file using SFileOpenArchive. If the file already exists and it is an MPQ archive, the function fails and GetLastError() returns ERROR_ALREADY_EXISTS.
Value | Meaning |
---|---|
MPQ_CREATE_ARCHIVE_V1 (0x00000000) |
The function creates a MPQ version 1.0 (up to 4 GB). This is the default value |
MPQ_CREATE_ARCHIVE_V2 (0x00010000) |
The function creates a MPQ version 2.0 (supports MPQ of size greater than 4 GB). |
MPQ_CREATE_ARCHIVE_V3 (0x00020000) |
The function creates a MPQ version 3.0 (introduced in WoW-Cataclysm Beta). |
MPQ_CREATE_ARCHIVE_V4 (0x00030000) |
The function creates a MPQ version 4.0 (used in WoW-Cataclysm). |
MPQ_CREATE_ATTRIBUTES (0x00000001) |
When creating new MPQ, the (attributes) file will be added to it. The (attributes) file contains additional file information, such as file time, CRC32 checksum and MD5 hash. |
MPQ_CREATE_NO_MPQ_CHECK (0x00000002) |
This flag is reserved for internal use by StormLib. Do not use. |
When the function succeeds, it returns nonzero and phMPQ contains the handle of the new archive. On an error, the function returns false and GetLastError gives the error code.
Available in Storm.dll | No |
Ordinal number in Storm.dll 1.00 | N/A |
Ordinal number in Storm.dll 1.09 | N/A |
Copyright (c) Ladislav Zezula 2003 - 2010