Remove Lock Routines
Initializes a remove lock for a device object. A driver can use the lock to track outstanding I/O on a device and to determine when the driver can delete its device object in response to an IRP_MN_REMOVE_DEVICE request.
Increments the count for a remove lock, indicating that the associated device object should not be detached from the device stack nor deleted.
Releases a remove lock acquired with a previous call to IoAcquireRemoveLock.
Releases a remove lock acquired with a previous call to IoAcquireRemoveLock and waits until all acquisitions of the lock have been released. A driver typically calls this routine in its dispatch code for an IRP_MN_REMOVE_DEVICE request.