Author: hbelusca
Date: Fri Jul 19 14:03:46 2013
New Revision: 59512
URL:
http://svn.reactos.org/svn/reactos?rev=59512&view=rev
Log:
Add the SYNCHRONIZE flag to the DesiredAccess parameter when using the flags
FILE_SYNCHRONOUS_IO_(NON)ALERT in NtCreateFile or NtOpenFile, even if one uses
DesiredAccess == GENERIC_xxx (which should map to some FILE_GENERIC_xxx already containing
the SYNCHRONIZE flag).
Indeed, it appears after extended testing that, when calling from user-mode, Windows
checks the real presence of the SYNCHRONIZE flag when using FILE_SYNCHRONOUS_IO_(NON)ALERT
even if we pass any of the GENERIC_xxx access flags...
Part 1/X
Modified:
trunk/reactos/base/setup/usetup/bootsup.c
trunk/reactos/base/setup/usetup/filesup.c
trunk/reactos/base/setup/usetup/inicache.c
Modified: trunk/reactos/base/setup/usetup/bootsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/bootsup.…
==============================================================================
--- trunk/reactos/base/setup/usetup/bootsup.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/bootsup.c [iso-8859-1] Fri Jul 19 14:03:46 2013
@@ -683,7 +683,7 @@
NULL);
Status = NtOpenFile(&FileHandle,
- GENERIC_READ,
+ GENERIC_READ | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
0,
@@ -720,7 +720,7 @@
NULL);
Status = NtCreateFile(&FileHandle,
- GENERIC_WRITE,
+ GENERIC_WRITE | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
NULL,
@@ -783,7 +783,7 @@
NULL);
Status = NtOpenFile(&FileHandle,
- GENERIC_READ,
+ GENERIC_READ | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
0,
@@ -828,7 +828,7 @@
NULL);
Status = NtOpenFile(&FileHandle,
- GENERIC_READ,
+ GENERIC_READ | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
0,
@@ -876,7 +876,7 @@
NULL);
Status = NtCreateFile(&FileHandle,
- GENERIC_WRITE,
+ GENERIC_WRITE | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
NULL,
@@ -943,7 +943,7 @@
NULL);
Status = NtOpenFile(&FileHandle,
- GENERIC_READ,
+ GENERIC_READ | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
0,
@@ -988,7 +988,7 @@
NULL);
Status = NtOpenFile(&FileHandle,
- GENERIC_READ,
+ GENERIC_READ | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
0,
@@ -1039,7 +1039,7 @@
NULL);
Status = NtCreateFile(&FileHandle,
- GENERIC_WRITE,
+ GENERIC_WRITE | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
NULL,
@@ -1081,7 +1081,7 @@
NULL);
Status = NtOpenFile(&FileHandle,
- GENERIC_WRITE,
+ GENERIC_WRITE | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
0,
@@ -1145,7 +1145,7 @@
NULL);
Status = NtOpenFile(&FileHandle,
- GENERIC_READ,
+ GENERIC_READ | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
0,
@@ -1193,7 +1193,7 @@
NULL);
Status = NtOpenFile(&FileHandle,
- GENERIC_READ,
+ GENERIC_READ | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
0,
@@ -1240,7 +1240,7 @@
NULL);
Status = NtOpenFile(&FileHandle,
- GENERIC_WRITE,
+ GENERIC_WRITE | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
0,
@@ -1296,7 +1296,7 @@
NULL);
Status = NtOpenFile(&FileHandle,
- GENERIC_READ,
+ GENERIC_READ | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
0,
@@ -1344,7 +1344,7 @@
NULL);
Status = NtOpenFile(&FileHandle,
- GENERIC_READ,
+ GENERIC_READ | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
0,
@@ -1392,7 +1392,7 @@
NULL);
Status = NtOpenFile(&FileHandle,
- GENERIC_WRITE,
+ GENERIC_WRITE | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
0,
@@ -1454,7 +1454,7 @@
NULL);
Status = NtOpenFile(&FileHandle,
- GENERIC_READ,
+ GENERIC_READ | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
0,
@@ -1502,7 +1502,7 @@
NULL);
Status = NtOpenFile(&FileHandle,
- GENERIC_READ,
+ GENERIC_READ | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
0,
@@ -1553,7 +1553,7 @@
NULL);
Status = NtOpenFile(&FileHandle,
- GENERIC_WRITE,
+ GENERIC_WRITE | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
0,
@@ -1617,7 +1617,7 @@
NULL);
Status = NtOpenFile(&FileHandle,
- GENERIC_READ,
+ GENERIC_READ | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
0,
@@ -1663,7 +1663,7 @@
NULL);
Status = NtOpenFile(&FileHandle,
- GENERIC_READ,
+ GENERIC_READ | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
0,
@@ -1717,7 +1717,7 @@
NULL);
Status = NtOpenFile(&FileHandle,
- GENERIC_WRITE,
+ GENERIC_WRITE | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
0,
@@ -1816,7 +1816,7 @@
NULL);
Status = NtOpenFile(&FileHandle,
- GENERIC_READ|GENERIC_WRITE,
+ GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
0,
@@ -1890,7 +1890,7 @@
NULL);
Status = NtOpenFile(&FileHandle,
- GENERIC_READ|GENERIC_WRITE,
+ GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
0,
Modified: trunk/reactos/base/setup/usetup/filesup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/filesup.…
==============================================================================
--- trunk/reactos/base/setup/usetup/filesup.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/filesup.c [iso-8859-1] Fri Jul 19 14:03:46 2013
@@ -198,7 +198,7 @@
NULL);
Status = NtCreateFile(&FileHandleDest,
- GENERIC_WRITE,
+ GENERIC_WRITE | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
NULL,
@@ -377,7 +377,7 @@
NULL);
Status = NtOpenFile(&FileHandle,
- GENERIC_READ,
+ GENERIC_READ | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
0,
Modified: trunk/reactos/base/setup/usetup/inicache.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/inicache…
==============================================================================
--- trunk/reactos/base/setup/usetup/inicache.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/inicache.c [iso-8859-1] Fri Jul 19 14:03:46 2013
@@ -1080,7 +1080,7 @@
NULL);
Status = NtCreateFile(&FileHandle,
- GENERIC_WRITE,
+ GENERIC_WRITE | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
NULL,