mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:52:57 +00:00
convert the device object to a temporary device before deleting it
svn path=/trunk/; revision=14706
This commit is contained in:
parent
353f0bf39d
commit
377ffd2516
2 changed files with 15 additions and 0 deletions
|
@ -557,6 +557,15 @@ IoDeleteDevice(PDEVICE_OBJECT DeviceObject)
|
||||||
|
|
||||||
/* I guess this should be removed later... but it shouldn't cause problems */
|
/* I guess this should be removed later... but it shouldn't cause problems */
|
||||||
DeviceObject->DeviceObjectExtension->ExtensionFlags |= DOE_DELETE_PENDING;
|
DeviceObject->DeviceObjectExtension->ExtensionFlags |= DOE_DELETE_PENDING;
|
||||||
|
|
||||||
|
/* Make the object temporary. This should automatically remove the device
|
||||||
|
from the namespace */
|
||||||
|
ObMakeTemporaryObject(DeviceObject);
|
||||||
|
|
||||||
|
/* Dereference the driver object */
|
||||||
|
ObDereferenceObject(DeviceObject->DriverObject);
|
||||||
|
|
||||||
|
/* Remove the keep-alive reference */
|
||||||
ObDereferenceObject(DeviceObject);
|
ObDereferenceObject(DeviceObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -224,6 +224,12 @@ ObpSetPermanentObject (IN PVOID ObjectBody, IN BOOLEAN Permanent)
|
||||||
|
|
||||||
ObjectHeader = BODY_TO_HEADER(ObjectBody);
|
ObjectHeader = BODY_TO_HEADER(ObjectBody);
|
||||||
ObjectHeader->Permanent = Permanent;
|
ObjectHeader->Permanent = Permanent;
|
||||||
|
|
||||||
|
if (ObjectHeader->HandleCount == 0 && !Permanent && ObjectHeader->Parent != NULL)
|
||||||
|
{
|
||||||
|
/* Remove the object from the namespace */
|
||||||
|
ObpRemoveEntryDirectory(ObjectHeader);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue