Author: fireball
Date: Sat Aug 23 12:11:12 2008
New Revision: 35566
URL:
http://svn.reactos.org/svn/reactos?rev=35566&view=rev
Log:
- Implement IopGetRegistryValue (complementary function to IopOpenRegistryKeyEx). Not used
yet.
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 [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/io.h [iso-8859-1] Sat Aug 23 12:11:12 2008
@@ -593,6 +593,13 @@
PUNICODE_STRING Name,
ACCESS_MASK DesiredAccess);
+NTSTATUS
+NTAPI
+IopGetRegistryValue(IN HANDLE Handle,
+ IN PWSTR ValueName,
+ OUT PKEY_VALUE_FULL_INFORMATION *Information);
+
+
//
// 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 [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Sat Aug 23 12:11:12 2008
@@ -2775,6 +2775,51 @@
return Status;
}
+NTSTATUS
+NTAPI
+IopGetRegistryValue(IN HANDLE Handle,
+ IN PWSTR ValueName,
+ OUT PKEY_VALUE_FULL_INFORMATION *Information)
+{
+ UNICODE_STRING ValueString;
+ NTSTATUS Status;
+ PKEY_VALUE_FULL_INFORMATION FullInformation;
+ ULONG Size;
+ PAGED_CODE();
+
+ RtlInitUnicodeString(&ValueString, ValueName);
+
+ Status = ZwQueryValueKey(Handle,
+ &ValueString,
+ KeyValueFullInformation,
+ NULL,
+ 0,
+ &Size);
+ if ((Status != STATUS_BUFFER_OVERFLOW) &&
+ (Status != STATUS_BUFFER_TOO_SMALL))
+ {
+ return Status;
+ }
+
+ FullInformation = ExAllocatePool(NonPagedPool, Size);
+ if (!FullInformation) return STATUS_INSUFFICIENT_RESOURCES;
+
+ Status = ZwQueryValueKey(Handle,
+ &ValueString,
+ KeyValueFullInformation,
+ FullInformation,
+ Size,
+ &Size);
+ if (!NT_SUCCESS(Status))
+ {
+ ExFreePool(FullInformation);
+ return Status;
+ }
+
+ *Information = FullInformation;
+ return STATUS_SUCCESS;
+}
+
static NTSTATUS INIT_FUNCTION
NTAPI
PnpDriverInitializeEmpty(IN struct _DRIVER_OBJECT *DriverObject, IN PUNICODE_STRING
RegistryPath)