StormLib API Reference
SFileAddFileEx
bool WINAPI SFileAddFileEx( HANDLE hMpq, // Handle to the MPQ const char * szFileName, // The name of a file to be removed const char * szArchivedName, // The name under which the file will be stored DWORD dwFlags, // Specifies archive flags for the file DWORD dwCompression, // Compression for the first block of the file DWORD dwCompressionNext // Compression for rest of the file (except the first block) );
Function SFileAddFileEx adds a file to the MPQ archive. The MPQ must have been open by SFileOpenArchive or created by SFileCreateArchive. Note that this operation might cause MPQ fragmentation. To reduce size of the MPQ, use SFileCompactArchive.
Value | Meaning |
---|---|
MPQ_FILE_IMPLODE (0x00000100) |
The file will be compressed using IMPLODE compression method. This flag cannot be used together with MPQ_FILE_COMPRESS. If this flag is present, then the dwCompression and dwCompressionNext parameters are ignored. This flag is obsolete and was used only in Diablo I. |
MPQ_FILE_COMPRESS (0x00000200) |
The file will be compressed. This flag cannot be used together with MPQ_FILE_IMPLODE. |
MPQ_FILE_ENCRYPTED (0x00010000) |
The file will be stored as encrypted. |
MPQ_FILE_FIX_KEY (0x00020000) |
The file's encryption key will be adjusted according to file size in the archive. This flag must be used together with MPQ_FILE_ENCRYPTED. |
MPQ_FILE_DELETE_MARKER (0x02000000) |
The file will have the deletion marker. |
MPQ_FILE_SECTOR_CRC (0x04000000) |
The file will have CRC for each file sector. Ignored if the file is not compressed or if the file is stored as single unit. |
MPQ_FILE_SINGLE_UNIT (0x01000000) |
The file will be added as single unit. Files stored as single unit cannot be encrypted, because Blizzard doesn't support them. |
MPQ_FILE_REPLACEEXISTING (0x80000000) |
If this flag is specified and the file is already in the MPQ, it will be replaced. |
Value | Meaning |
---|---|
MPQ_COMPRESSION_HUFFMANN (0x01) |
Use Huffman compression. This bit can only be combined with MPQ_COMPRESSION_ADPCM_MONO or MPQ_COMPRESSION_ADPCM_STEREO. |
MPQ_COMPRESSION_ZLIB (0x02) |
Use ZLIB compression library. This bit cannot be combined with MPQ_COMPRESSION_BZIP2 or MPQ_COMPRESSION_LZMA. |
MPQ_COMPRESSION_PKWARE (0x08) |
Use Pkware Data Compression Library. This bit cannot be combined with MPQ_COMPRESSION_LZMA. |
MPQ_COMPRESSION_BZIP2 (0x10) |
Use BZIP2 compression library. This bit cannot be combined with MPQ_COMPRESSION_ZLIB or MPQ_COMPRESSION_LZMA. |
MPQ_COMPRESSION_SPARSE (0x20) |
Use SPARSE compression. This bit cannot be combined with MPQ_COMPRESSION_LZMA. |
MPQ_COMPRESSION_ADPCM_MONO (0x40) |
Use IMA ADPCM compression for 1-channel (mono) WAVE files. This bit can only be combined with MPQ_COMPRESSION_HUFFMANN. This is lossy compression and should only be used for compressing WAVE files. |
MPQ_COMPRESSION_ADPCM_STEREO (0x80) |
Use IMA ADPCM compression for 2-channel (stereo) WAVE files. This bit can only be combined with MPQ_COMPRESSION_HUFFMANN. This is lossy compression and should only be used for compressing WAVE files. |
MPQ_COMPRESSION_LZMA (0x12) |
Use LZMA compression. This value can not be combined with any other compression method. |
When the function succeeds, it returns nonzero. 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