diff --git a/Source/AuProcAddresses.NT.cpp b/Source/AuProcAddresses.NT.cpp index 8868f9c6..a6f18ff3 100644 --- a/Source/AuProcAddresses.NT.cpp +++ b/Source/AuProcAddresses.NT.cpp @@ -313,22 +313,26 @@ namespace Aurora attrs.nLength = sizeof(attrs); attrs.bInheritHandle = bInherit ? TRUE : FALSE; + if ((dwFlags & 0x4ffff7) && + (!pCreateFile2)) + { + SysPushErrorFeatureMissing("Do not use Windows8+ attributes/flags under Win32Open"); + return INVALID_HANDLE_VALUE; + } + + if ((dwAttributes & 0xFFB00008) && + (!pCreateFile2)) + { + SysPushErrorFeatureMissing("Do not use Windows8+ attributes/flags under Win32Open"); + return INVALID_HANDLE_VALUE; + } + if (!dwAttributes) { dwAttributes = FILE_ATTRIBUTE_NORMAL; } - if (pCreateFileW) - { - return pCreateFileW(lpFileName, - dwDesiredAccess, - dwShareMode, - &attrs, - dwCreationDisposition, - dwFlags | dwAttributes, - NULL); - } - else if (pCreateFile2) + if (pCreateFile2) { _CREATEFILE2_EXTENDED_PARAMETERS params {}; @@ -350,6 +354,16 @@ namespace Aurora dwCreationDisposition, ¶ms); } + else if (pCreateFileW) + { + return pCreateFileW(lpFileName, + dwDesiredAccess, + dwShareMode, + &attrs, + dwCreationDisposition, + dwFlags | dwAttributes, + NULL); + } else { return INVALID_HANDLE_VALUE;