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
IN ACCESS_MASK DesiredAccess,
OUT PHANDLE DeviceInterfaceKey)
{
- 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;
-
- 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;
-
- return Status;
+ 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;
+
+ 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;
+
+ return Status;
}
/*++