StormLib API Reference



bool WINAPI SFileRemoveFile(
  HANDLE hMpq,                      // Handle to the MPQ
  const char * szFileName,          // The name of a file to be removed
  DWORD dwSearchScope               // Ignored

Function SFileRemoveFile removes a file from MPQ. The MPQ must have been open by SFileOpenArchive or created by SFileCreateArchive. Note that this operation leaves a gap in the MPQ file. To reduce size of the MPQ, use SFileCompactArchive.


[in] Handle to an open MPQ. This handle must have been obtained by calling SFileOpenArchive or SFileCreateArchive.
[in] Name of a file to be removed.
[in] This parameter is ignored in the current version of StormLib.

Return Value

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


The function only removes file with the specified locale. Unlike SFileOpenFileEx, if the file with preset locale doesn't exist in the MPQ, the function fails. For more informations about preset locale, see SFileSetLocale.

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