StormLib API Reference



bool WINAPI SFileCreateFile(
  HANDLE hMpq,                      // Handle to the MPQ
  const char * szArchivedName,      // The name under which the file will be stored
  ULONGLONG FileTime                // Specifies the date and file time
  DWORD dwFileSize                  // Specifies the size of the file
  LCID lcLocale                     // Specifies the file locale
  DWORD dwFlags                     // Specifies archive flags for the file
  HANDLE * phFile                   // Returned file handle

Function SFileCreateFile creates a new file within archive and prepares it for storing the data.


[in] Handle to an open MPQ. This handle must have been obtained by calling SFileOpenArchive or SFileCreateArchive.
[in] A name under which the file will be stored into the MPQ.
[in] Specifies the file date-time that will be stored into "(attributes)" file in MPQ. This parameter is optional and can be zero.
[in] Specifies the size of the data that will be written to the file. This size of the file is set by the call and cannot be changed. The subsequent amount of data written must exactly match the size given by this parameter.
[in] Specifies the locale for the new file.
[in] Specifies additional options about how to add the file to the MPQ. For more information about these flags, see SFileAddFileEx.
[in] Pointer to a variable of HANDLE type that receives a valid handle. Note that this handle can only be used in call to SFileWriteFile and SFileFinishFile. This handle must never be passed to another file function. Moreover, this handle must always be freed by SFileFinishFile, if not NULL.

Return Value

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

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