When a non-boot volume is ready?

I’m developing a storage filter and I want to know if there is any way of knowing when a non-boot volume (D:, F:) is ready??
I need to create a file with ZwCreateFile, but if I call this function before the volume is ready, the boot crashes.

I put a Count var, that every time it goes through the Write routine is incremented. So I use ZwCreateFile() after the variable value is 70, and is working +D.

But I need to know if there is any way of knowing where the volume is ready exacty

Thanks…

Hello, please

Aanyone have any idea or any clue to help me??

Ty

Whit kind of storage filter do you have? If it resided below Partition Manager your filter could only get Disk related IOCTLs. You should move your filter up in the stack.
There are some number IOCTLs which may help you. For example, IOCTL_MOUNTMGR_VOLUME_XXX may help you.

Igor Sharovar

Sorry, I’m a little beginner in driver development. So I am using a example of
the WDF: the diskperf. Is it possible to use this IOCTLs?

att,
Thiago Fabre
UNESP / Bauru

On Mon, Feb 28, 2011 at 2:42 PM, wrote:

> Whit kind of storage filter do you have? If it resided below Partition
> Manager your filter could only get Disk related IOCTLs. You should move your
> filter up in the stack.
> There are some number IOCTLs which may help you. For example,
> IOCTL_MOUNTMGR_VOLUME_XXX may help you.
>
> Igor Sharovar
>
>
> —
> 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
>

Could you explain your design and what you want to achieve? Because you are beginner you may be on wrong path.

Igor Sharovar

I need to know which partition has more free space in boot time. So I use
the ZwCreateFile with NT namespace of the device (\Device\HarddiskVolume1)
to get the handle to use the ZwQueryVolumeInformationFile(). But the problem
is when I try to use ZwCreateFile before the volume is ready.

So I put a Count var, that every time it goes through the Write routine is
incremented. So I use ZwCreateFile() after the variable value is around 60,
and is working +D. But I need to know if there is any way of knowing where
the volume is ready exacty, because this number could change depending on
the computer.

And I’m using the diskderf source of the WDK. My code the checks which
partition has more space is in the Write Routine

att,
Thiago Fabre
LTIA - Laborat?rio de Tecnologia da Informa??o Aplicada
UNESP / Bauru
(14) 91096114

On Mon, Feb 28, 2011 at 3:49 PM, wrote:

> Could you explain your design and what you want to achieve? Because you are
> beginner you may be on wrong path.
>
> Igor Sharovar
>
> —
> 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
>

I think IoRegisterPlugPlayNotification () with GUID_DEVINTERFACE_VOLUME tells you when a volume arrives and is ready to be accessed.

You need to track MOUNTMGR IOCTLs. diskperf could not get this stuff. Try to install a filter in Volume class.

Igor Sharovar

In the callback function of the IoRegisterPlugPlayNotification(), I used the
UNICODE_STRING (SymbolicLinkName) that comes with the
DEVICE_INTERFACE_CHANGE_NOTIFICATION in the ObjectAttributes of the
ZwCreateFile, I can open the volume, but when I call the
ZwQueryVolumeInformationFile to get the information, return ERROR

s,
Thiago Fabre
UNESP / Bauru - Brasil

On Mon, Feb 28, 2011 at 4:39 PM, wrote:

> I think IoRegisterPlugPlayNotification () with GUID_DEVINTERFACE_VOLUME
> tells you when a volume arrives and is ready to be accessed.
>
> —
> 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
>

It’s working, the problem was that I can get information just opening the
volume, I need to open a file inside the volume, like
this: STORAGE#VOLUME#(dcfa7623-2f91-11e0-88d7-806e6f6e6963)\teste.txt

Many thanks,
Thiago Fabre
UNESP / Bauru

On Tue, Mar 1, 2011 at 10:46 AM, Thiago Fabre wrote:

> In the callback function of the IoRegisterPlugPlayNotification(), I used
> the UNICODE_STRING (SymbolicLinkName) that comes with the
> DEVICE_INTERFACE_CHANGE_NOTIFICATION in the ObjectAttributes of the
> ZwCreateFile, I can open the volume, but when I call the
> ZwQueryVolumeInformationFile to get the information, return ERROR
>
>
> s,
> Thiago Fabre
> UNESP / Bauru - Brasil
>
>
>
> On Mon, Feb 28, 2011 at 4:39 PM, wrote:
>
>> I think IoRegisterPlugPlayNotification () with GUID_DEVINTERFACE_VOLUME
>> tells you when a volume arrives and is ready to be accessed.
>>
>> —
>> 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
>>
>
>