Author: fireball
Date: Wed Jan 2 00:01:28 2008
New Revision: 31540
URL:
http://svn.reactos.org/svn/reactos?rev=31540&view=rev
Log:
- Implement a helper registry key opening function to reduce code size.
-
http://www.tech-archive.net/Archive/Development/microsoft.public.developmen…
Modified:
trunk/reactos/ntoskrnl/include/internal/io.h
trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
Modified: trunk/reactos/ntoskrnl/include/internal/io.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/io.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/io.h Wed Jan 2 00:01:28 2008
@@ -556,8 +556,14 @@
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
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c Wed Jan 2 00:01:28 2008
@@ -3303,6 +3303,30 @@
}
}
+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)