Bad handle checks
This commit is contained in:
parent
f7403c944c
commit
22c1681132
@ -54,7 +54,7 @@ namespace Aurora::IO::FS
|
||||
auto win32Path = Locale::ConvertFromUTF8(pathNormalized);
|
||||
|
||||
auto fileHandle = CreateFileW(win32Path.c_str(), GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (fileHandle != INVALID_HANDLE_VALUE)
|
||||
if (fileHandle == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
SysPushErrorIO("Couldn't open handle: {}", path);
|
||||
return false;
|
||||
@ -102,7 +102,7 @@ namespace Aurora::IO::FS
|
||||
auto win32Path = Locale::ConvertFromUTF8(NormalizePathRet(path));
|
||||
|
||||
auto fileHandle = CreateFileW(win32Path.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (fileHandle != INVALID_HANDLE_VALUE)
|
||||
if (fileHandle == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
SysPushErrorIO("Couldn't open handle: {}", path);
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user