The IoInvalidateDeviceRelations routine notifies the PnP manager that the relations for a device (such as bus relations, ejection relations, removal relations, and the target device relation) have changed.
NTKERNELAPI VOID IoInvalidateDeviceRelations( PDEVICE_OBJECT DeviceObject, DEVICE_RELATION_TYPE Type );
Pointer to the PDO for the device.
Specifies a DEVICE_RELATION_TYPE enumeration value that describes the type of relations that have changed. Possible values include BusRelations, EjectionRelations, RemovalRelations, and TargetDeviceRelation. Starting with Windows 7, the PowerRelations value is also supported.
For some relation types, such as BusRelations, this routine causes the PnP manager or power manager to gather updated relations information by sending an IRP_MN_QUERY_DEVICE_RELATIONS request to the drivers for the device. For other relation types, such as EjectionRelations, the PnP manager does not need to gather new relation information immediately; the PnP manager queries drivers for ejection relations only when it is preparing to eject a device.
After a bus driver calls IoInvalidateDeviceRelations to inform the PnP manager that a device has disappeared, the bus driver must continue to handle PnP IRPs for that device until it receives an IRP_MN_REMOVE_DEVICE request. In response to this IRP, the bus driver returns STATUS_NO_SUCH_DEVICE. Until the bus driver successfully completes the IRP_MN_REMOVE_DEVICE request, the bus driver can access the device extension to check its flags for the device.
|Windows version||Available starting with Windows 2000.|
|Header||wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)|
|DDI compliance rules||HwStorPortProhibitedDDIs|