Thanks all responses …
Any removable disk will not be used, I just want to know the fixed
disks (in my scenario, it will be for sure just a SATA internal disk).
I’m already using the IoRegisterPlugPlayNotification for
GUID_DEVINTERFACE_VOLUME, so I get all the arrivals, but I need to
choose the partition with the most free space before I can proceed
with the machine boot, so I cant wait too much time, so I think a kind
of probing will be the only way, using a fixed time to wait.
besides that, I’m in trouble with the ZwCreateFile and
ZwQueryVolumeInformationFile, that keep failing with INVALID_REQUEST ,
I checked the parameters, but cant find any error. I’m using
notification->SymbolicLinkName that comes with the
GUID_DEVICE_INTERFACE_ARRIVAL, the ZwCreateFile occurs well, but
ZwQueryVolumeInformationFile always return invalid request, any clue?
Guilherme Moro
On Thu, Jul 8, 2010 at 5:40 AM, Jan Bottorff wrote:
>> > Is there any way to ensure that the initial volume listing is over
>
> During boot, the PnP discovery goes something like (simplified):
>
> Put root ACPI device on PnP action queue
> While PnP action queue is not empty {
> ? ? ? ?Process devices in the PnP action queue and add them to the devnode
> tree and start the ones you can
> ? ? ? ?Enumerate any bus that has never been enumerated or have changed
> relationships
> ? ? ? ?Add any new devices reported on a bus to the PnP action queue
> ? ? ? ?Add any busses that need enumeration to the PnP action queue
> }
> Mount the system disk, crash if no system volume found
>
> The system stalls during boot until all discovered busses have enumerated
> (or enumeration times out because the link is down). When PnP believes all
> busses are correctly enumerated, it looks for the boot disk volume. If it
> doesn’t find it, the system crashes. After that, volumes can arrive and
> depart at any time, except for the system boot volume or any volume with a
> paging file on it, which can never depart.
>
> A bus driver can take a while (seconds or more) to enumerate a bus, on Vista
> and later, busses can enumerate in parallel (reducing boot elapsed time).
> It’s a tricky business to know how long to wait for some external fabric to
> fully get enumerated. The iSCSI bus driver for example I believe will wait 2
> minutes or so to try and connect to persistent mounted disks (it has to wait
> for the network stacks to come up first).
>
> I don’t believe there is a convenient API to register for a callback when
> the PnP enumeration is complete.
>
> If you make your driver a non-boot start driver, it will not be loaded by
> the OS loader, so will get loaded off the system volume after it’s online.
> At this point, you know the “initial” enumeration must have already
> happened.
>
> There is no guarantee of when ALL the volumes eventually accessible will be
> enumerated. For example, after a power failure of a server, SAN and storage
> array, it can be a while before all the volumes are online again. Or another
> example, a user might insert a USB storage fob 3 minutes after turning on
> the computer, was that supposed to be part of the “initial” volume listing?
>
> Jan
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>