Training
Module
Troubleshoot device driver failures - Training
This module focuses on the role of device drivers and troubleshooting problems that pertain to them.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
When a driver or a user-mode component enables or disables a device interface instance, the PnP manager calls all notification callback routines that are registered for EventCategoryDeviceInterfaceChange events on the device interface class. To indicate the reason for the notification, the PnP manager sets the Event member of the callback routine's NotificationStructure parameter to GUID_DEVICE_INTERFACE_ARRIVAL or GUID_DEVICE_INTERFACE_REMOVAL.
When handling a GUID_DEVICE_INTERFACE_ARRIVAL event, a notification callback routine should:
Perform driver-defined tasks for handling the new interface.
Typically, a notification callback routine directly opens the device in the context of the callback. However, if opening the device can cause subsequent PnP events to occur (for example, the enumeration of child devices), the callback routine should instead queue a worker routine to open the device; otherwise, a deadlock can occur.
A callback routine might enable an interface of its own in response to the availability of the new interface.
When handling a GUID_DEVICE_INTERFACE_REMOVAL event, a notification callback routine should:
In addition to EventCategoryDeviceInterfaceChange, the driver must also register for EventCategoryTargetDeviceChange, and close the file handle from the GUID_TARGET_DEVICE_QUERY_REMOVE event callback. Keeping the file handle open will veto the removal process and cause the orderly removal to be canceled.
Training
Module
Troubleshoot device driver failures - Training
This module focuses on the role of device drivers and troubleshooting problems that pertain to them.
Documentation
Using PnP Device Interface Change Notification - Windows drivers
Using PnP Device Interface Change Notification
Registering for Device Interface Change Notification - Windows drivers
Registering for Device Interface Change Notification
Using PnP Target Device Change Notification - Windows drivers
Using PnP Target Device Change Notification