diff --git a/Source/IO/FS/FS.Win32.cpp b/Source/IO/FS/FS.Win32.cpp index aa17b763..a173b3c3 100644 --- a/Source/IO/FS/FS.Win32.cpp +++ b/Source/IO/FS/FS.Win32.cpp @@ -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;