StormLib API Reference

SFileCreateFile

Description

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.

Parameters

hMpq
[in] Handle to an open MPQ. This handle must have been obtained by calling SFileOpenArchive or SFileCreateArchive.
szArchivedName
[in] A name under which the file will be stored into the MPQ.
FileTime
[in] Specifies the file date-time that will be stored into "(attributes)" file in MPQ. This parameter is optional and can be zero.
dwFileSize
[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.
lcLocale
[in] Specifies the locale for the new file.
dwFlags
[in] Specifies additional options about how to add the file to the MPQ. For more information about these flags, see SFileAddFileEx.
phFile
[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