You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
820 B
38 lines
820 B
#include "diablo.h" |
|
#include "../3rdParty/Storm/Source/storm.h" |
|
|
|
DEVILUTION_BEGIN_NAMESPACE |
|
|
|
BOOL WCloseFile(HANDLE file) |
|
{ |
|
return SFileCloseFile(file); |
|
} |
|
|
|
LONG WGetFileSize(HANDLE hsFile, DWORD *lpFileSizeHigh, const char *FileName) |
|
{ |
|
LONG ret; |
|
|
|
if ((ret = SFileGetFileSize(hsFile, lpFileSizeHigh)) == 0) |
|
FileErrDlg(FileName); |
|
|
|
return ret; |
|
} |
|
|
|
BOOL WOpenFile(const char *FileName, HANDLE *phsFile, BOOL mayNotExist) |
|
{ |
|
if (!SFileOpenFile(FileName, phsFile)) |
|
FileErrDlg(FileName); |
|
|
|
return TRUE; |
|
} |
|
|
|
void WReadFile(HANDLE hsFile, LPVOID buf, DWORD to_read, const char *FileName) |
|
{ |
|
if (SFileSetFilePointer(hsFile, 0, NULL, FILE_CURRENT) == -1) |
|
FileErrDlg(FileName); |
|
|
|
if (!SFileReadFile(hsFile, buf, to_read, NULL, NULL)) |
|
FileErrDlg(FileName); |
|
} |
|
|
|
DEVILUTION_END_NAMESPACE
|
|
|