I’ll just add to Jerry’s response a little. Please keep in mind that I’m responding based on current OS builds (Windows 7), though I don’t recall any differences from Windows Vista / Server 2008. Server 2003 is back beyond my immediate memory, so I can’t confirm if this all applies to that OS.
First, it’s important to realize the Storport’s bus scans are triggered by the Plug and Play manager of Windows. Specifically, any time that PnP is asked to generate a new list of “children” for a given adapter, it tells Storport to re-enumerate, which causes Storport to issue a bus scan. This can happen for a variety of reasons:
- Device Manager (or some other app) requests for a rescan to be done.
- The miniport sends Storport a “BusChangeDetected” notification, causing Storport to tell PnP to invalidate its current device list.
- Upon initial creation of the device object for the adapter, PnP needs to know if it has children. (This is the first time a bus scan is done.)
During a bus scan, Storport attempts to build a “LUN list” for every possible target (as reported by the miniport). Specifically, for every possible path and target combination, Storport will send a REPORT LUNS request to LUN 0. If that succeeds, the reported LUNs will be added to the LUN list.
If the REPORT LUNS request fails for any reason, the Storport will send an INQUIRY to LUN 0. If the inquiry succeeds, LUN 0 is added to the LUN list, and Storport will likewise send inquiries to LUNS 1-7, adding them to the list of they respond. If the INQUIRY to LUN 0 fails, however, Storport simply moves on to the next target.
In addition to LUNs found up to this point, Storport will also send INQUIRYs to the LUNs that it found on the previous bus scan. If any of those respond, they’ll be added to the list as well.
Once the list is constructed, it is compared to the list from the previous bus scan to determine which devices have arrived and which ones have vanished. In some cases, a device may “change” between bus scans. That is, one device is removed and another is added at that same SCSI address. For this reason, Storport compares the INQUIRY data between the two bus scans to determine if a “change” has taken place for a given LUN. If it has, a new device object is created, causing PnP to request the removal of the old device object and initialization of the new device object.
No registry keys are needed to enable this behavior. But as I said, I can’t speak to Windows Server 2003.
– Keith