Basically, we have one that we normally use. We talk to HAL.
HAL provides a device map of everything in the system, and we use this to detect PCI, and USB devices currently. There is a special case where we search for entire categories of devices, such as generic devices like optical disk drives. This is why when we had the HAL bug in 0810 a month ago, almost all pnp detection was affected.
But basically, the DHCPDevice table (which is what is filled when you fill a pnp section of a device template) acts as a filter. As devices are detected, they are sent a whole set of parameters as part of the event, some of them are filled, some are not..such as PCI or USB vendor ID/Model #, MAC address, etc... And the entries in the DHCPDevice table are matched against the incoming event as a conditional, anything matching is returned. If one device is returned, it merely asks to add the device. If multiple devices are returned, then a screen asking the user to pick a device is shown. The user selects a device, and the installation continues.
But technically, anything can fire a New Device Detected event, with a device template, to get the system to go into the routine of asking about and subsequently installing the device.
-Thom