diff --git a/ntoskrnl/io/iomgr/deviface.c b/ntoskrnl/io/iomgr/deviface.c index 7d19776c33a..0e1f32f5ca4 100644 --- a/ntoskrnl/io/iomgr/deviface.c +++ b/ntoskrnl/io/iomgr/deviface.c @@ -189,33 +189,34 @@ OpenRegistryHandlesFromSymbolicLink(IN PUNICODE_STRING SymbolicLinkName, cleanup: if (SubKeyName.Buffer != NULL) - ExFreePool(SubKeyName.Buffer); + ExFreePool(SubKeyName.Buffer); if (NT_SUCCESS(Status)) { - if (!GuidKey) - ZwClose(*GuidKeyRealP); + if (!GuidKey) + ZwClose(*GuidKeyRealP); - if (!DeviceKey) - ZwClose(*DeviceKeyRealP); + if (!DeviceKey) + ZwClose(*DeviceKeyRealP); - if (!InstanceKey) - ZwClose(*InstanceKeyRealP); + if (!InstanceKey) + ZwClose(*InstanceKeyRealP); } else { - if (*GuidKeyRealP != NULL) - ZwClose(*GuidKeyRealP); + if (*GuidKeyRealP != NULL) + ZwClose(*GuidKeyRealP); - if (*DeviceKeyRealP != NULL) - ZwClose(*DeviceKeyRealP); + if (*DeviceKeyRealP != NULL) + ZwClose(*DeviceKeyRealP); - if (*InstanceKeyRealP != NULL) - ZwClose(*InstanceKeyRealP); + if (*InstanceKeyRealP != NULL) + ZwClose(*InstanceKeyRealP); } return Status; } + /*++ * @name IoOpenDeviceInterfaceRegistryKey * @unimplemented @@ -246,37 +247,37 @@ IoOpenDeviceInterfaceRegistryKey(IN PUNICODE_STRING SymbolicLinkName, IN ACCESS_MASK DesiredAccess, OUT PHANDLE DeviceInterfaceKey) { - HANDLE InstanceKey, DeviceParametersKey; - NTSTATUS Status; - OBJECT_ATTRIBUTES ObjectAttributes; - UNICODE_STRING DeviceParametersU = RTL_CONSTANT_STRING(L"Device Parameters"); + HANDLE InstanceKey, DeviceParametersKey; + NTSTATUS Status; + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING DeviceParametersU = RTL_CONSTANT_STRING(L"Device Parameters"); - Status = OpenRegistryHandlesFromSymbolicLink(SymbolicLinkName, - KEY_CREATE_SUB_KEY, - NULL, - NULL, - &InstanceKey); - if (!NT_SUCCESS(Status)) - return Status; + Status = OpenRegistryHandlesFromSymbolicLink(SymbolicLinkName, + KEY_CREATE_SUB_KEY, + NULL, + NULL, + &InstanceKey); + if (!NT_SUCCESS(Status)) + return Status; - InitializeObjectAttributes(&ObjectAttributes, - &DeviceParametersU, - OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE | OBJ_OPENIF, - InstanceKey, - NULL); - Status = ZwCreateKey(&DeviceParametersKey, - DesiredAccess, - &ObjectAttributes, - 0, - NULL, - REG_OPTION_NON_VOLATILE, - NULL); - ZwClose(InstanceKey); + InitializeObjectAttributes(&ObjectAttributes, + &DeviceParametersU, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE | OBJ_OPENIF, + InstanceKey, + NULL); + Status = ZwCreateKey(&DeviceParametersKey, + DesiredAccess, + &ObjectAttributes, + 0, + NULL, + REG_OPTION_NON_VOLATILE, + NULL); + ZwClose(InstanceKey); - if (NT_SUCCESS(Status)) - *DeviceInterfaceKey = DeviceParametersKey; + if (NT_SUCCESS(Status)) + *DeviceInterfaceKey = DeviceParametersKey; - return Status; + return Status; } /*++