diff --git a/reactos/ntoskrnl/config/cmsysini.c b/reactos/ntoskrnl/config/cmsysini.c index b1658b24579..a0cbb197ea8 100644 --- a/reactos/ntoskrnl/config/cmsysini.c +++ b/reactos/ntoskrnl/config/cmsysini.c @@ -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, diff --git a/reactos/ntoskrnl/io/iomgr/driver.c b/reactos/ntoskrnl/io/iomgr/driver.c index 877fd73d5e6..68e7a8e2920 100644 --- a/reactos/ntoskrnl/io/iomgr/driver.c +++ b/reactos/ntoskrnl/io/iomgr/driver.c @@ -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); diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c index 61ce9735cb7..608ab159432 100644 --- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c +++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c @@ -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); diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpres.c b/reactos/ntoskrnl/io/pnpmgr/pnpres.c index 806e0196a1a..ef77e7f8790 100644 --- a/reactos/ntoskrnl/io/pnpmgr/pnpres.c +++ b/reactos/ntoskrnl/io/pnpmgr/pnpres.c @@ -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, diff --git a/reactos/ntoskrnl/mm/pagefile.c b/reactos/ntoskrnl/mm/pagefile.c index e5b88a58a3d..5afba2bc1f8 100644 --- a/reactos/ntoskrnl/mm/pagefile.c +++ b/reactos/ntoskrnl/mm/pagefile.c @@ -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)) diff --git a/reactos/ntoskrnl/vdm/vdmmain.c b/reactos/ntoskrnl/vdm/vdmmain.c index 76fa7aa1be8..8bedcd9cdc9 100644 --- a/reactos/ntoskrnl/vdm/vdmmain.c +++ b/reactos/ntoskrnl/vdm/vdmmain.c @@ -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,