Author: cgutman Date: Wed Jun 1 01:06:35 2011 New Revision: 52033
URL: http://svn.reactos.org/svn/reactos?rev=52033&view=rev Log: [NTOSKRNL] - Fix a bug in device removal and ejection which caused the request to fail when EjectionRelations or RemovalRelations was not handled by a driver in the stack
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.c... ============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Wed Jun 1 01:06:35 2011 @@ -3917,13 +3917,15 @@ &IoStatusBlock, IRP_MN_QUERY_DEVICE_RELATIONS, &Stack); - if (!NT_SUCCESS(Status) || Status == STATUS_PENDING) + if (!NT_SUCCESS(Status)) { DPRINT("IopInitiatePnpIrp() failed with status 0x%08lx\n", Status); - return Status; - } - - DeviceRelations = (PDEVICE_RELATIONS)IoStatusBlock.Information; + DeviceRelations = NULL; + } + else + { + DeviceRelations = (PDEVICE_RELATIONS)IoStatusBlock.Information; + }
if (DeviceRelations) { @@ -4030,15 +4032,15 @@ &IoStatusBlock, IRP_MN_QUERY_DEVICE_RELATIONS, &Stack); - if (!NT_SUCCESS(Status) || Status == STATUS_PENDING) + if (!NT_SUCCESS(Status)) { DPRINT("IopInitiatePnpIrp() failed with status 0x%08lx\n", Status); - IopQueueTargetDeviceEvent(&GUID_DEVICE_EJECT_VETOED, - &DeviceNode->InstancePath); - return; - } - - DeviceRelations = (PDEVICE_RELATIONS)IoStatusBlock.Information; + DeviceRelations = NULL; + } + else + { + DeviceRelations = (PDEVICE_RELATIONS)IoStatusBlock.Information; + }
if (DeviceRelations) {