diff --git a/Source/AuProcAddresses.NT.cpp b/Source/AuProcAddresses.NT.cpp index efbce8fd..d0b83876 100644 --- a/Source/AuProcAddresses.NT.cpp +++ b/Source/AuProcAddresses.NT.cpp @@ -352,7 +352,7 @@ namespace Aurora if (pCreateFile2W) { _CREATEFILE2_EXTENDED_PARAMETERS params {}; - bool bWrite {}; + bool bRead {}; HANDLE hHandle {}; params.dwSize = sizeof(_CREATEFILE2_EXTENDED_PARAMETERS); @@ -360,11 +360,11 @@ namespace Aurora params.dwFileAttributes = dwAttributes; params.lpSecurityAttributes = &attrs; - if ((bWrite = (::wcscmp(lpFileName, L"CONIN$") == 0))|| - ::wcscmp(lpFileName, L"CONOUT$") == 0 || - ::wcscmp(lpFileName, L"CONERR$") == 0) + if ((bRead = (::wcscmp(lpFileName, L"CONIN$") == 0)) || + (::wcscmp(lpFileName, L"CONOUT$") == 0) || + (::wcscmp(lpFileName, L"CONERR$") == 0)) { - if (bWrite) + if (!bRead) { dwDesiredAccess = GENERIC_READ | GENERIC_WRITE; }