From 72bf171b1bd08795f284f9891a9ab45f2b3d1d98 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Sat, 20 Mar 2004 17:34:25 +0000 Subject: [PATCH] - Minor correction to IopGetSystemPowerDeviceObject. svn path=/trunk/; revision=8817 --- reactos/ntoskrnl/io/pnpmgr.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/reactos/ntoskrnl/io/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr.c index 37db669385d..cad12813c67 100644 --- a/reactos/ntoskrnl/io/pnpmgr.c +++ b/reactos/ntoskrnl/io/pnpmgr.c @@ -1,4 +1,4 @@ -/* $Id: pnpmgr.c,v 1.25 2004/03/18 16:43:56 navaraf Exp $ +/* $Id: pnpmgr.c,v 1.26 2004/03/20 17:34:25 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -240,13 +240,16 @@ IopGetSystemPowerDeviceObject(PDEVICE_OBJECT *DeviceObject) { KIRQL OldIrql; - assert(PopSystemPowerDeviceNode); + if (PopSystemPowerDeviceNode) + { + KeAcquireSpinLock(&IopDeviceTreeLock, &OldIrql); + *DeviceObject = PopSystemPowerDeviceNode->Pdo; + KeReleaseSpinLock(&IopDeviceTreeLock, OldIrql); - KeAcquireSpinLock(&IopDeviceTreeLock, &OldIrql); - *DeviceObject = PopSystemPowerDeviceNode->Pdo; - KeReleaseSpinLock(&IopDeviceTreeLock, OldIrql); + return STATUS_SUCCESS; + } - return STATUS_SUCCESS; + return STATUS_UNSUCCESSFUL; } /**********************************************************************