- Implement a helper registry key opening function to reduce code size.

- http://www.tech-archive.net/Archive/Development/microsoft.public.development.device.drivers/2004-10/1623.html

svn path=/trunk/; revision=31540
This commit is contained in:
Aleksey Bragin 2008-01-01 21:01:28 +00:00
parent 3cd13713b0
commit 68981a6100
2 changed files with 32 additions and 2 deletions

View file

@ -556,8 +556,14 @@ IopQueueTargetDeviceEvent(
NTSTATUS
IopInitializePnpServices(
IN PDEVICE_NODE DeviceNode,
IN BOOLEAN BootDrivers)
;
IN BOOLEAN BootDrivers);
NTSTATUS
IopOpenRegistryKeyEx(
PHANDLE KeyHandle,
HANDLE ParentKey,
PUNICODE_STRING Name,
ACCESS_MASK DesiredAccess);
//
// Initialization Routines

View file

@ -3303,6 +3303,30 @@ IopUpdateRootKey(VOID)
}
}
NTSTATUS
IopOpenRegistryKeyEx(PHANDLE KeyHandle,
HANDLE ParentKey,
PUNICODE_STRING Name,
ACCESS_MASK DesiredAccess)
{
OBJECT_ATTRIBUTES ObjectAttributes;
NTSTATUS Status;
PAGED_CODE();
*KeyHandle = NULL;
InitializeObjectAttributes(&ObjectAttributes,
Name,
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE,
ParentKey,
NULL);
Status = ZwOpenKey(KeyHandle, DesiredAccess, &ObjectAttributes);
return Status;
}
static NTSTATUS INIT_FUNCTION
NTAPI
PnpDriverInitializeEmpty(IN struct _DRIVER_OBJECT *DriverObject, IN PUNICODE_STRING RegistryPath)