Fix an issue caused by DesiredAccess not being correctly set when FILE_SYNCHRONOUS is used in CreateOptions

This commit is contained in:
Luke Usher 2017-10-17 23:14:13 +01:00
parent d2514874de
commit f4573d097a
1 changed files with 6 additions and 0 deletions

View File

@ -260,6 +260,12 @@ XBSYSAPI EXPORTNUM(66) xboxkrnl::NTSTATUS NTAPI xboxkrnl::IoCreateFile
NativeObjectAttributes nativeObjectAttributes;
NTSTATUS ret = CxbxObjectAttributesToNT(ObjectAttributes, /*OUT*/nativeObjectAttributes, "IoCreateFile");
// When a Synchronous CreateOption is specified, DesiredAccess must have SYNCHRONIZE set
if ((CreateOptions & FILE_SYNCHRONOUS_IO_NONALERT) != 0 ||
(CreateOptions & FILE_SYNCHRONOUS_IO_ALERT) != 0) {
DesiredAccess |= SYNCHRONIZE;
}
// Force ShareAccess to all
ShareAccess = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE;