mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 12:06:52 +00:00
[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 svn path=/trunk/; revision=52033
This commit is contained in:
parent
f1ad369297
commit
47328a7510
1 changed files with 12 additions and 10 deletions
|
@ -3917,13 +3917,15 @@ IopPrepareDeviceForRemoval(IN PDEVICE_OBJECT DeviceObject)
|
|||
&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 = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
DeviceRelations = (PDEVICE_RELATIONS)IoStatusBlock.Information;
|
||||
}
|
||||
|
||||
DeviceRelations = (PDEVICE_RELATIONS)IoStatusBlock.Information;
|
||||
|
||||
if (DeviceRelations)
|
||||
{
|
||||
|
@ -4030,15 +4032,15 @@ IoRequestDeviceEject(IN PDEVICE_OBJECT PhysicalDeviceObject)
|
|||
&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 = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
DeviceRelations = (PDEVICE_RELATIONS)IoStatusBlock.Information;
|
||||
}
|
||||
|
||||
DeviceRelations = (PDEVICE_RELATIONS)IoStatusBlock.Information;
|
||||
|
||||
if (DeviceRelations)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue