Expand Minimize

IoDetachDevice routine

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

Syntax


VOID IoDetachDevice(
  _Inout_  PDEVICE_OBJECT TargetDevice
);

Parameters

TargetDevice [in, out]

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

Return value

None

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.

Requirements

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

PASSIVE_LEVEL

DDI compliance rules

IrqlIoPassive3, PnpSurpriseRemove, PowerIrpDDis, RemoveLockCheck, HwStorPortProhibitedDDIs

See also

IoAttachDevice
IoAttachDeviceToDeviceStack

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft