Author: dgorbachev
Date: Mon Sep 26 15:35:24 2011
New Revision: 53862
URL:
http://svn.reactos.org/svn/reactos?rev=53862&view=rev
Log:
[NTOSKRNL]
- Do not reference/dereference device node, but device object.
- Fix compiler warning.
Modified:
trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
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] Mon Sep 26 15:35:24 2011
@@ -122,7 +122,7 @@
if (!SystemPowerDeviceNodeCreated)
{
PopSystemPowerDeviceNode = DeviceNode;
- ObReferenceObject(PopSystemPowerDeviceNode);
+ ObReferenceObject(PopSystemPowerDeviceNode->PhysicalDeviceObject);
SystemPowerDeviceNodeCreated = TRUE;
}
}
@@ -1937,7 +1937,7 @@
{
/* Ignore this DO */
DPRINT1("IopCreateDeviceNode() failed with status 0x%08x. Skipping
PDO %u\n", Status, i);
- ObDereferenceObject(ChildDeviceNode);
+ ObDereferenceObject(ChildDeviceObject);
}
}
else
@@ -2764,7 +2764,8 @@
OBJECT_ATTRIBUTES ObjectAttributes;
HANDLE hPnpKey;
PKEY_VALUE_PARTIAL_INFORMATION KeyInformation;
- ULONG DesiredLength, Length, KeyValue;
+ ULONG DesiredLength, Length;
+ ULONG KeyValue = 0;
NTSTATUS Status;
InitializeObjectAttributes(&ObjectAttributes, &KeyPathU, OBJ_KERNEL_HANDLE |
OBJ_CASE_INSENSITIVE, NULL, NULL);
@@ -2797,7 +2798,6 @@
else
{
DPRINT1("ZwQueryValueKey(%wZ%wZ) failed\n", &KeyPathU,
&KeyNameU);
- KeyValue = 0;
}
ExFreePool(KeyInformation);
@@ -2805,13 +2805,11 @@
else
{
DPRINT1("Failed to allocate memory for registry query\n");
- KeyValue = 0;
}
}
else
{
DPRINT1("ZwQueryValueKey(%wZ%wZ) failed with status 0x%08lx\n",
&KeyPathU, &KeyNameU, Status);
- KeyValue = 0;
}
ZwClose(hPnpKey);