[*] (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.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,
&params);
}
else if (pCreateFileW)
{
return pCreateFileW(lpFileName,
dwDesiredAccess,
dwShareMode,
&attrs,
dwCreationDisposition,
dwFlags | dwAttributes,
NULL);
}
else
{
return INVALID_HANDLE_VALUE;