[NTOS]
authorThomas Faber <thomas.faber@reactos.org>
Fri, 18 Sep 2015 14:22:12 +0000 (14:22 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Fri, 18 Sep 2015 14:22:12 +0000 (14:22 +0000)
- Add some missing OBJ_KERNEL_HANDLE
CORE-10207

svn path=/trunk/; revision=69269

reactos/ntoskrnl/config/cmsysini.c
reactos/ntoskrnl/io/iomgr/driver.c
reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
reactos/ntoskrnl/io/pnpmgr/pnpres.c
reactos/ntoskrnl/mm/pagefile.c
reactos/ntoskrnl/vdm/vdmmain.c

index b1658b2..a0cbb19 100644 (file)
@@ -1203,7 +1203,7 @@ CmpGetRegistryPath(IN PWCHAR ConfigPath)
         /* Setup the object attributes */
         InitializeObjectAttributes(&ObjectAttributes,
                                    &KeyName,
-                                   OBJ_CASE_INSENSITIVE,
+                                   OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
                                    NULL,
                                    NULL);
         /* Open the key */
@@ -2185,7 +2185,7 @@ CmpSetVersionData(VOID)
     RtlInitUnicodeString(&KeyName, L"\\REGISTRY\\MACHINE\\SOFTWARE");
     InitializeObjectAttributes(&ObjectAttributes,
                                &KeyName,
-                               OBJ_CASE_INSENSITIVE,
+                               OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
                                NULL,
                                NULL);
     Status = NtCreateKey(&SoftwareKeyHandle,
@@ -2204,7 +2204,7 @@ CmpSetVersionData(VOID)
     RtlInitUnicodeString(&KeyName, L"Microsoft");
     InitializeObjectAttributes(&ObjectAttributes,
                                &KeyName,
-                               OBJ_CASE_INSENSITIVE,
+                               OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
                                SoftwareKeyHandle,
                                NULL);
     Status = NtCreateKey(&MicrosoftKeyHandle,
@@ -2223,7 +2223,7 @@ CmpSetVersionData(VOID)
     RtlInitUnicodeString(&KeyName, L"Windows NT");
     InitializeObjectAttributes(&ObjectAttributes,
                                &KeyName,
-                               OBJ_CASE_INSENSITIVE,
+                               OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
                                MicrosoftKeyHandle,
                                NULL);
     Status = NtCreateKey(&WindowsNtKeyHandle,
@@ -2242,7 +2242,7 @@ CmpSetVersionData(VOID)
     RtlInitUnicodeString(&KeyName, L"CurrentVersion");
     InitializeObjectAttributes(&ObjectAttributes,
                                &KeyName,
-                               OBJ_CASE_INSENSITIVE,
+                               OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
                                WindowsNtKeyHandle,
                                NULL);
     Status = NtCreateKey(&CurrentVersionKeyHandle,
index 877fd73..68e7a8e 100644 (file)
@@ -1510,7 +1510,7 @@ try_again:
     ObjectSize = sizeof(DRIVER_OBJECT) + sizeof(EXTENDED_DRIVER_EXTENSION);
     InitializeObjectAttributes(&ObjectAttributes,
                                &LocalDriverName,
-                               OBJ_PERMANENT | OBJ_CASE_INSENSITIVE,
+                               OBJ_PERMANENT | OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
                                NULL,
                                NULL);
 
index 61ce973..608ab15 100644 (file)
@@ -805,7 +805,7 @@ IopStartDevice(
    RtlInitUnicodeString(&KeyName, L"Control");
    InitializeObjectAttributes(&ObjectAttributes,
                               &KeyName,
-                              OBJ_CASE_INSENSITIVE,
+                              OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
                               InstanceHandle,
                               NULL);
    Status = ZwCreateKey(&ControlHandle, KEY_SET_VALUE, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL);
@@ -1474,7 +1474,7 @@ IopCreateDeviceKeyPath(IN PCUNICODE_STRING RegistryPath,
         /* Open key */
         InitializeObjectAttributes(&ObjectAttributes,
                                    &KeyName,
-                                   OBJ_CASE_INSENSITIVE,
+                                   OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
                                    hParent,
                                    NULL);
         Status = ZwCreateKey(&hKey,
@@ -1531,7 +1531,7 @@ IopSetDeviceInstanceData(HANDLE InstanceKey,
    RtlInitUnicodeString(&KeyName, L"LogConf");
    InitializeObjectAttributes(&ObjectAttributes,
                               &KeyName,
-                              OBJ_CASE_INSENSITIVE,
+                              OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
                               InstanceKey,
                               NULL);
    Status = ZwCreateKey(&LogConfKey,
@@ -1599,7 +1599,7 @@ IopSetDeviceInstanceData(HANDLE InstanceKey,
    RtlInitUnicodeString(&KeyName, L"Control");
    InitializeObjectAttributes(&ObjectAttributes,
                               &KeyName,
-                              OBJ_CASE_INSENSITIVE,
+                              OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
                               InstanceKey,
                               NULL);
    Status = ZwCreateKey(&ControlHandle, 0, &ObjectAttributes, 0, NULL, REG_OPTION_VOLATILE, NULL);
@@ -4298,8 +4298,11 @@ IoOpenDeviceRegistryKey(IN PDEVICE_OBJECT DeviceObject,
     */
 
    RtlInitUnicodeString(&KeyName, DeviceParametersKeyName);
-   InitializeObjectAttributes(&ObjectAttributes, &KeyName,
-                              OBJ_CASE_INSENSITIVE, *DevInstRegKey, NULL);
+   InitializeObjectAttributes(&ObjectAttributes,
+                              &KeyName,
+                              OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
+                              *DevInstRegKey,
+                              NULL);
    Status = ZwCreateKey(DevInstRegKey, DesiredAccess, &ObjectAttributes,
                         0, NULL, ExpInTextModeSetup ? REG_OPTION_VOLATILE : 0, NULL);
    ZwClose(ObjectAttributes.RootDirectory);
index 806e019..ef77e7f 100644 (file)
@@ -699,7 +699,7 @@ IopUpdateControlKeyWithResources(IN PDEVICE_NODE DeviceNode)
    /* Create/Open the Control key */
    InitializeObjectAttributes(&ObjectAttributes,
                               &Control,
-                              OBJ_CASE_INSENSITIVE,
+                              OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
                               InstanceKey,
                               NULL);
    Status = ZwCreateKey(&ControlKey,
@@ -772,8 +772,8 @@ IopUpdateResourceMap(IN PDEVICE_NODE DeviceNode, PWCHAR Level1Key, PWCHAR Level2
                L"\\Registry\\Machine\\HARDWARE\\RESOURCEMAP");
   InitializeObjectAttributes(&ObjectAttributes,
                  &KeyName,
-                 OBJ_CASE_INSENSITIVE | OBJ_OPENIF,
-                 0,
+                 OBJ_CASE_INSENSITIVE | OBJ_OPENIF | OBJ_KERNEL_HANDLE,
+                 NULL,
                  NULL);
   Status = ZwCreateKey(&ResourceMapKey,
                KEY_ALL_ACCESS,
@@ -788,7 +788,7 @@ IopUpdateResourceMap(IN PDEVICE_NODE DeviceNode, PWCHAR Level1Key, PWCHAR Level2
   RtlInitUnicodeString(&KeyName, Level1Key);
   InitializeObjectAttributes(&ObjectAttributes,
                  &KeyName,
-                 OBJ_CASE_INSENSITIVE | OBJ_OPENIF,
+                 OBJ_CASE_INSENSITIVE | OBJ_OPENIF | OBJ_KERNEL_HANDLE,
                  ResourceMapKey,
                  NULL);
   Status = ZwCreateKey(&PnpMgrLevel1,
@@ -805,7 +805,7 @@ IopUpdateResourceMap(IN PDEVICE_NODE DeviceNode, PWCHAR Level1Key, PWCHAR Level2
   RtlInitUnicodeString(&KeyName, Level2Key);
   InitializeObjectAttributes(&ObjectAttributes,
                  &KeyName,
-                 OBJ_CASE_INSENSITIVE | OBJ_OPENIF,
+                 OBJ_CASE_INSENSITIVE | OBJ_OPENIF | OBJ_KERNEL_HANDLE,
                  PnpMgrLevel1,
                  NULL);
   Status = ZwCreateKey(&PnpMgrLevel2,
index e5b88a5..5afba2b 100644 (file)
@@ -559,7 +559,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
 
     InitializeObjectAttributes(&ObjectAttributes,
                                &CapturedFileName,
-                               0,
+                               OBJ_KERNEL_HANDLE,
                                NULL,
                                NULL);
 
@@ -625,7 +625,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
     Status = ObReferenceObjectByHandle(FileHandle,
                                        FILE_ALL_ACCESS,
                                        IoFileObjectType,
-                                       PreviousMode,
+                                       KernelMode,
                                        (PVOID*)&FileObject,
                                        NULL);
     if (!NT_SUCCESS(Status))
index 76fa7aa..8bedcd9 100644 (file)
@@ -54,7 +54,7 @@ KeI386VdmInitialize(VOID)
                          L"Control\\Wow");
     InitializeObjectAttributes(&ObjectAttributes,
                                &Name,
-                               OBJ_CASE_INSENSITIVE,
+                               OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
                                NULL,
                                NULL);
     Status = ZwOpenKey(&RegHandle, KEY_READ, &ObjectAttributes);
@@ -99,7 +99,7 @@ VdmpInitialize(PVOID ControlData)
     /* Open the physical memory section */
     InitializeObjectAttributes(&ObjectAttributes,
                                &PhysMemName,
-                               0,
+                               OBJ_KERNEL_HANDLE,
                                NULL,
                                NULL);
     Status = ZwOpenSection(&PhysMemHandle,