[NTOS:CM]
authorThomas Faber <thomas.faber@reactos.org>
Sat, 15 Oct 2016 20:16:47 +0000 (20:16 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sat, 15 Oct 2016 20:16:47 +0000 (20:16 +0000)
- Ignore the KEY_WOW64_32KEY and KEY_WOW64_64KEY flags in NtOpenKey/NtCreateKey, as shown by tests.
CORE-9691 #resolve

svn path=/trunk/; revision=72975

reactos/ntoskrnl/config/ntapi.c

index 7a10d14..b47f77f 100644 (file)
@@ -39,6 +39,9 @@ NtCreateKey(OUT PHANDLE KeyHandle,
             ObjectAttributes->ObjectName, ObjectAttributes->RootDirectory,
             DesiredAccess, CreateOptions);
 
+    /* Ignore the WOW64 flag, it's not valid in the kernel */
+    DesiredAccess &= ~KEY_WOW64_RES;
+
     /* Check for user-mode caller */
     if (PreviousMode != KernelMode)
     {
@@ -126,6 +129,9 @@ NtOpenKey(OUT PHANDLE KeyHandle,
     DPRINT("NtOpenKey(Path: %wZ, Root %x, Access: %x)\n",
             ObjectAttributes->ObjectName, ObjectAttributes->RootDirectory, DesiredAccess);
 
+    /* Ignore the WOW64 flag, it's not valid in the kernel */
+    DesiredAccess &= ~KEY_WOW64_RES;
+
     /* Check for user-mode caller */
     if (PreviousMode != KernelMode)
     {