[*] (dwFlags & 0x4ffff7) && (!pCreateFile2) check

[*] (dwAttributes & 0xFFB00008) && (!pCreateFile2)
This commit is contained in:
Reece Wilson 2023-09-13 03:30:54 +01:00
parent b4d5f4c127
commit 18ac961ac9

View File

@ -313,22 +313,26 @@ namespace Aurora
attrs.nLength = sizeof(attrs); attrs.nLength = sizeof(attrs);
attrs.bInheritHandle = bInherit ? TRUE : FALSE; 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) if (!dwAttributes)
{ {
dwAttributes = FILE_ATTRIBUTE_NORMAL; dwAttributes = FILE_ATTRIBUTE_NORMAL;
} }
if (pCreateFileW) if (pCreateFile2)
{
return pCreateFileW(lpFileName,
dwDesiredAccess,
dwShareMode,
&attrs,
dwCreationDisposition,
dwFlags | dwAttributes,
NULL);
}
else if (pCreateFile2)
{ {
_CREATEFILE2_EXTENDED_PARAMETERS params {}; _CREATEFILE2_EXTENDED_PARAMETERS params {};
@ -350,6 +354,16 @@ namespace Aurora
dwCreationDisposition, dwCreationDisposition,
&params); &params);
} }
else if (pCreateFileW)
{
return pCreateFileW(lpFileName,
dwDesiredAccess,
dwShareMode,
&attrs,
dwCreationDisposition,
dwFlags | dwAttributes,
NULL);
}
else else
{ {
return INVALID_HANDLE_VALUE; return INVALID_HANDLE_VALUE;