IoDetachDevice - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// wdm.h

VOID IoDetachDevice(
  [in, out] PDEVICE_OBJECT TargetDevice
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdm-iodetachdevice)

IoDetachDevice function

Description

The IoDetachDevice routine releases an attachment between the caller's device object and a lower driver's device object.

Parameters

TargetDevice [in, out]

Pointer to the lower driver's device object. The caller previously called IoAttachDevice or IoAttachDeviceToDeviceStack successfully to get this pointer.

Remarks

IoDetachDevice decrements the reference count of the TargetDevice object. If the reference count goes to zero and the lower driver has been marked for an unload operation, the lower driver is unloaded.

See also

IoAttachDevice

IoAttachDeviceToDeviceStack