A driver registers for notification of device interface arrival and removal events by calling IoRegisterPlugPlayNotification.
The following information applies to calling this routine for device interface change notification:
The GUID for a interface class is typically defined in a header file with the structures, constants, and so forth, for the interface.
This flag directs the PnP Manager to register the CallbackRoutine for future device interface arrivals and departures of the specified class and to call the CallbackRoutine immediately for any relevant device interfaces that are already active.
A driver can call IoGetDeviceInterfaces to get a list of existing interfaces of a specific class and then register its callback routine without this flag, but using the flag is easier and avoids a potential timing issue.
A driver that opens a handle to a device in response to a device interface arrival notification should register for EventCategoryTargetDeviceChange events on the device. (See Using PnP Target Device Change Notification.)
A driver cancels notification registration by calling IoUnregisterPlugPlayNotification with the NotificationEntry returned by IoRegisterPlugPlayNotification.