IoInvalidateDeviceRelations function (wdm.h)

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.

Syntax

void IoInvalidateDeviceRelations(
  [in] PDEVICE_OBJECT       DeviceObject,
  [in] DEVICE_RELATION_TYPE Type
);

Parameters

[in] DeviceObject

Pointer to the PDO for the device.

[in] Type

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.

Return value

None

Remarks

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.

Requirements

Requirement Value
Minimum supported client Available starting with Windows 2000.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL <= DISPATCH_LEVEL
DDI compliance rules HwStorPortProhibitedDDIs(storport)

See also

IRP_MN_QUERY_DEVICE_RELATIONS

IRP_MN_REMOVE_DEVICE