I’m developing a upper disk filter that scans all the volumes of HD (partitions)
to see which has more free space, using the
PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES . My problem is knowing
when I checked all volumes to send the information down.
Today, I stop to check when I get a notification of a CDROM volume , because the
CDROM starts after all HDs. But if the computer has no CDROM, the driver
doesn’t work.
IoReadPartitionTableEx or sending IOCTL_DISK_GET_DRIVE_LAYOUT_EX will give you a basic disk’s partition count.
Regards
Else
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Dienstag, 22. M?rz 2011 12:25
To: Windows System Software Devs Interest List
Subject: [ntdev] How I Know when all volumes of HD is ready
Hello folks,
I’m developing a upper disk filter that scans all the volumes of HD (partitions)
to see which has more free space, using the
PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES . My problem is knowing
when I checked all volumes to send the information down.
Today, I stop to check when I get a notification of a CDROM volume , because the
CDROM starts after all HDs. But if the computer has no CDROM, the driver
doesn’t work.
Utimaco Safeware AG - A member of the Sophos Group
Registergericht Bad Homburg HRB 5302
WEEE-Reg.Nr.: DE39805015
Sitz: Oberursel
Vorstandsmitglieder: Steve Munford (Vorsitzender), Malte Pollmann
Aufsichtsratsvorsitzender: Dr. Peter Lammer
But IOCTL_DISK_GET_DRIVE_LAYOUT_EX, brings the number of partitions, which
is different from volumes (C:, D:).
s,
Thiago Fabre
UNESP / Bauru
(14) 91096114
On Tue, Mar 22, 2011 at 9:13 AM, Else Kluger wrote:
> Hi, > > IoReadPartitionTableEx or sending IOCTL_DISK_GET_DRIVE_LAYOUT_EX will give > you a basic disk’s partition count. > > Regards > Else > > -----Original Message----- > From: xxxxx@lists.osr.com [mailto: > xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com > Sent: Dienstag, 22. M?rz 2011 12:25 > To: Windows System Software Devs Interest List > Subject: [ntdev] How I Know when all volumes of HD is ready > > Hello folks, > > I’m developing a upper disk filter that scans all the volumes of HD > (partitions) > to see which has more free space, using the > PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES . My problem is > knowing > when I checked all volumes to send the information down. > > Today, I stop to check when I get a notification of a CDROM volume , > because the > CDROM starts after all HDs. But if the computer has no CDROM, the driver > doesn’t work. > > Anyone have any clue how I do it? > > Thanks > > — > 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 > > Utimaco Safeware AG - A member of the Sophos Group > > Registergericht Bad Homburg HRB 5302 > WEEE-Reg.Nr.: DE39805015 > Sitz: Oberursel > Vorstandsmitglieder: Steve Munford (Vorsitzender), Malte Pollmann > Aufsichtsratsvorsitzender: Dr. Peter Lammer > > — > 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 >
Basically you don’t ever know when ‘all volumes’ are ready as on many
systems you can just walk up and plug in a new hard disk at any time,
raid controllers can instantiate new luns at any time, the whole
storage configuration is dynamic.
Mark Roddy
On Tue, Mar 22, 2011 at 7:25 AM, wrote: > Hello folks, > > I’m developing a upper disk filter that scans all the volumes of HD (partitions) > to see which has more free space, using the > PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES . My problem is knowing > when I checked all volumes to send the information down. > > Today, I stop to check when I get a notification of a CDROM volume , because the > CDROM starts ?after all HDs. But if the computer has no CDROM, the driver > doesn’t work. > > Anyone have any clue how I do it? > > Thanks > > — > 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 >
Yes,I need to know when the last volume of HD ready. Then I sent through an
IOCTL which volume has more free space. Sinnce there’s no way to detect when
the last volume is ready, as it is dynamic.
I’ll have to think differently, perhaps changing the architecture. Anyone know
any pnp notification, or any way to do this?
Many Thanks!!!
s,
Thiago Fabre
UNESP / Bauru
(14) 91096114
On Tue, Mar 22, 2011 at 5:25 PM, wrote:
> I assume you can query the volume information at the time you’ve got a > notification about this volume. > > Do you want to know when you’ll get a last possible volume? That’s > impossible. > > — > 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 >
IMHO you need to decide which of these categories your algorithm falls into
can run after every change; or
must run after quiescence is achieved
In the first case, you already know how to build it and you live with the fact that it will run many times and give different answerers each time. If you can redesign your algorithm to follow this paradigm this is the easiest and most robust solution.
The second case is much harder to achieve and requires that you can execute synchronously with the state change and implement a shared writer, single reader lock semantic (typically implemented thru an inverted use of a shared reader, single writer lock). I’m not familiar enough with the storage stack in Windows to know if this is possible, but this model is commonly implemented in SAN based storage subsystems as well as other hot reconfiguration applications. My guess is that you cannot implement it in Windows but others will elucidate I hope. You can emulate it by using timers if you really need to but the problem with the timer-based solution is that it needs to meet all the requirements of case one, because it is only a probabilistic guarantee, and so it must be safe to get the ‘wrong’ answer sometimes; this is practically case one again, so I highly recommend that you do not attempt unless you know exactly what you will gain by delaying the re-evaluation of available storage for your application.
“Thiago Fabre” wrote in message news:xxxxx@ntdev… Yes,I need to know when the last volume of HD ready. Then I sent through an IOCTL which volume has more free space. Sinnce there’s no way to detect when the last volume is ready, as it is dynamic.
I’ll have to think differently, perhaps changing the architecture. Anyone know any pnp notification, or any way to do this?
Many Thanks!!!
s, Thiago Fabre UNESP / Bauru (14) 91096114
On Tue, Mar 22, 2011 at 5:25 PM, wrote:
I assume you can query the volume information at the time you’ve got a notification about this volume.
Do you want to know when you’ll get a last possible volume? That’s impossible.