mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 09:02:57 +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,
|
&IoStatusBlock,
|
||||||
IRP_MN_QUERY_DEVICE_RELATIONS,
|
IRP_MN_QUERY_DEVICE_RELATIONS,
|
||||||
&Stack);
|
&Stack);
|
||||||
if (!NT_SUCCESS(Status) || Status == STATUS_PENDING)
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("IopInitiatePnpIrp() failed with status 0x%08lx\n", 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)
|
if (DeviceRelations)
|
||||||
{
|
{
|
||||||
|
@ -4030,15 +4032,15 @@ IoRequestDeviceEject(IN PDEVICE_OBJECT PhysicalDeviceObject)
|
||||||
&IoStatusBlock,
|
&IoStatusBlock,
|
||||||
IRP_MN_QUERY_DEVICE_RELATIONS,
|
IRP_MN_QUERY_DEVICE_RELATIONS,
|
||||||
&Stack);
|
&Stack);
|
||||||
if (!NT_SUCCESS(Status) || Status == STATUS_PENDING)
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
DPRINT("IopInitiatePnpIrp() failed with status 0x%08lx\n", Status);
|
DPRINT("IopInitiatePnpIrp() failed with status 0x%08lx\n", Status);
|
||||||
IopQueueTargetDeviceEvent(&GUID_DEVICE_EJECT_VETOED,
|
DeviceRelations = NULL;
|
||||||
&DeviceNode->InstancePath);
|
}
|
||||||
return;
|
else
|
||||||
|
{
|
||||||
|
DeviceRelations = (PDEVICE_RELATIONS)IoStatusBlock.Information;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeviceRelations = (PDEVICE_RELATIONS)IoStatusBlock.Information;
|
|
||||||
|
|
||||||
if (DeviceRelations)
|
if (DeviceRelations)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue