mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[NTOS:PNP] HACK: release resources when device is removed
CORE-17789
This commit is contained in:
parent
49358f3416
commit
89fd2b86e4
1 changed files with 10 additions and 0 deletions
|
@ -1635,6 +1635,10 @@ PiIrpSendRemoveCheckVpb(
|
|||
return IopSynchronousCall(targetDevice, &stack, &info);
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
IopUpdateResourceMapForPnPDevice(
|
||||
IN PDEVICE_NODE DeviceNode);
|
||||
|
||||
static
|
||||
VOID
|
||||
NTAPI
|
||||
|
@ -1647,6 +1651,12 @@ IopSendRemoveDevice(IN PDEVICE_OBJECT DeviceObject)
|
|||
/* Drivers should never fail a IRP_MN_REMOVE_DEVICE request */
|
||||
PiIrpSendRemoveCheckVpb(DeviceObject, IRP_MN_REMOVE_DEVICE);
|
||||
|
||||
/* Start of HACK: update resources stored in registry, so IopDetectResourceConflict works */
|
||||
DeviceNode->ResourceList->Count = 0;
|
||||
DeviceNode->ResourceListTranslated->Count = 0;
|
||||
IopUpdateResourceMapForPnPDevice(DeviceNode);
|
||||
/* End of HACK */
|
||||
|
||||
PiSetDevNodeState(DeviceNode, DeviceNodeRemoved);
|
||||
PiNotifyTargetDeviceChange(&GUID_TARGET_DEVICE_REMOVE_COMPLETE, DeviceObject, NULL);
|
||||
LONG_PTR refCount = ObDereferenceObject(DeviceObject);
|
||||
|
|
Loading…
Reference in a new issue