mirror of https://github.com/axmolengine/axmol.git
Merge pull request #9777 from ffskyfan/v3
fix the problem that engine can't get data from file on windows
This commit is contained in:
commit
b88b9ea994
|
@ -147,7 +147,7 @@ static Data getData(const std::string& filename, bool forString)
|
|||
WCHAR wszBuf[CC_MAX_PATH] = {0};
|
||||
MultiByteToWideChar(CP_UTF8, 0, fullPath.c_str(), -1, wszBuf, sizeof(wszBuf)/sizeof(wszBuf[0]));
|
||||
|
||||
HANDLE fileHandle = ::CreateFileW(wszBuf, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, NULL, nullptr);
|
||||
HANDLE fileHandle = ::CreateFileW(wszBuf, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, NULL, nullptr);
|
||||
CC_BREAK_IF(fileHandle == INVALID_HANDLE_VALUE);
|
||||
|
||||
size = ::GetFileSize(fileHandle, nullptr);
|
||||
|
@ -226,7 +226,7 @@ unsigned char* FileUtilsWin32::getFileData(const std::string& filename, const ch
|
|||
WCHAR wszBuf[CC_MAX_PATH] = {0};
|
||||
MultiByteToWideChar(CP_UTF8, 0, fullPath.c_str(), -1, wszBuf, sizeof(wszBuf)/sizeof(wszBuf[0]));
|
||||
|
||||
HANDLE fileHandle = ::CreateFileW(wszBuf, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, NULL, nullptr);
|
||||
HANDLE fileHandle = ::CreateFileW(wszBuf, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, NULL, nullptr);
|
||||
CC_BREAK_IF(fileHandle == INVALID_HANDLE_VALUE);
|
||||
|
||||
*size = ::GetFileSize(fileHandle, nullptr);
|
||||
|
|
Loading…
Reference in New Issue