StormLib API Reference
SFileOpenFileArchive
bool WINAPI SFileOpenFileArchive( HANDLE hParentMpq, // Archive handle const char * szFileName, // File name to open DWORD dwSearchScope, // Search scope HANDLE * phMpq // Pointer to newly opened archive handle );
Function SFileOpenFileArchive opens an archive that is within another MPQ archive.
| Value | Meaning |
|---|---|
| SFILE_OPEN_FROM_MPQ (0x00000000) |
Open the file from the MPQ archive. This is the standard and most common value. |
| SFILE_OPEN_ANY_LOCALE (0xFFFFFFFE) |
Opens a file with any available locale. If a file with the preferred locale does not exist, opens a file with locale zero (neutral). |
When the function succeeds, it returns nonzero and phMpq contains the handle of the opened archive. When the file cannot be opened, the function returns false and GetLastError gives the error code. The most common error codes are:
| Error code | Description |
|---|---|
| ERROR_INVALID_HANDLE | The archive handle hParentMpq is invalid. |
| ERROR_FILE_NOT_FOUND | The file szFileName was not found in the archive. |
| Available in Storm.dll (Diablo I) | No |
| Ordinal number in Storm.dll (Warcraft III) | 293 (0x125) |
Copyright (c) Ladislav Zezula 2003 - 2026