IoVolumeDeviceToDosName problems...

Hi,

I am tring to retrive the drive letter of a certain device using the IoVolumeDeviceToDosName (on XP), this fails with 0xC0000010 (invalid device request), how should I get the correct device?

To enumerate all available volumes I register a callback with ‘IoRegisterFsRegistrationChange’ (on XP), I use the DeviceObject passed to the callback
In combination with ‘IoVolumeDeviceToDosName’, the return value is 0xC0000010… how can I resolve the ‘real’ device from the device passed by the PDRIVER_REINITIALIZE associated with ‘IoRegisterFsRegistrationChange’???

Thanks
Nadav.


Do You Yahoo!?
Yahoo! Small Business - Try our new Resources site!

Hello Nadav,
You should pass *volume* device object to this function. The device
object which is passed to FsRegistrationChange callback is the device object
that represents the File System which is getting (un)loaded. The device
object represents the file system and not the volume. You will get volume
device object in the mount (mj_file_sytem_control,mn_mount_volume) IRP which
is sent to this device object. You should call IoVolumeDeviceToDosName in
the mount path.
thanks
-Kiran


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Nadav
Sent: Tuesday, May 31, 2005 3:06 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] IoVolumeDeviceToDosName problems…

Hi,

I am tring to retrive the drive letter of a certain device using the
IoVolumeDeviceToDosName (on XP), this fails with 0xC0000010 (invalid device
request), how should I get the correct device?

To enumerate all available volumes I register a callback with
‘IoRegisterFsRegistrationChange’ (on XP), I use the DeviceObject passed to
the callback
In combination with ‘IoVolumeDeviceToDosName’, the return value is
0xC0000010… how can I resolve the ‘real’ device from the device passed by
the PDRIVER_REINITIALIZE associated with ‘IoRegisterFsRegistrationChange’???

Thanks
Nadav.


Do You Yahoo!?
Yahoo! Small Business - Try
http:> our new Resources site! — Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17 You are currently subscribed to
ntfsd as: xxxxx@calsoftinc.com To unsubscribe send a blank email to
xxxxx@lists.osr.com</http:>

Hi Kiran,

Thanks for your responce, well, the filter I am writing is manually loaded, as such it will be loaded AFTER all of the fixed drives/volumes were loaded, ‘mn_mount_volume’ will not be called for those already mounted volumes…
Is there a way to enumerate the mounted volumes?

P.S.
The filespy sample provided with the IFS kit doesn’t resolve the drive letter when FILESPY_ATTACH_ALL_VOLUMES == gFileSpyAttachMode…

xxxxx@calsoftinc.com> wrote:
Hello Nadav,
You should pass *volume* device object to this function. The device object which is passed to FsRegistrationChange callback is the device object that represents the File System which is getting (un)loaded. The device object represents the file system and not the volume. You will get volume device object in the mount (mj_file_sytem_control,mn_mount_volume) IRP which is sent to this device object. You should call IoVolumeDeviceToDosName in the mount path.
thanks
-Kiran


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Nadav
Sent: Tuesday, May 31, 2005 3:06 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] IoVolumeDeviceToDosName problems…

Hi,

I am tring to retrive the drive letter of a certain device using the IoVolumeDeviceToDosName (on XP), this fails with 0xC0000010 (invalid device request), how should I get the correct device?

To enumerate all available volumes I register a callback with ‘IoRegisterFsRegistrationChange’ (on XP), I use the DeviceObject passed to the callback
In combination with ‘IoVolumeDeviceToDosName’, the return value is 0xC0000010… how can I resolve the ‘real’ device from the device passed by the PDRIVER_REINITIALIZE associated with ‘IoRegisterFsRegistrationChange’???

Thanks
Nadav.


Do You Yahoo!?
Yahoo! Small Business - Try our new Resources site! — Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17 You are currently subscribed to ntfsd as: xxxxx@calsoftinc.com To unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

> Is there a way to enumerate the mounted volumes?

Surely there is a way how to enumerate all drive letters.
Just write a “for” loop from “A” to “Z”, create a name
like “??\C:” and use ZwOpenSymbolicLinkObject and
ZwQuerySymbolicLinkObject on it. You will then have the real
volume name, like “\Device\HarddiskVolume2”.
Use IoGetDeviceObjectPointer and you’ll get the device object.

L.

Look at the SFILTER sample in the IFSKit. It shows you how to enumerate all of the volumes (both file system stack and storage stack) when your filter loads.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no Rights


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Nadav
Sent: Tuesday, May 31, 2005 6:35 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] IoVolumeDeviceToDosName problems…

Hi Kiran,
?
Thanks for your responce, well, the?filter I am writing is manually loaded, as such it will be loaded AFTER all of the fixed drives/volumes were loaded, ‘mn_mount_volume’ will not be called for those already mounted volumes…
Is there a way to enumerate the mounted volumes?
?
P.S.
The filespy sample provided with the IFS kit doesn’t resolve the drive letter when FILESPY_ATTACH_ALL_VOLUMES == gFileSpyAttachMode…

xxxxx@calsoftinc.com> wrote:
Hello Nadav,
??? You should pass *volume* device object to this function. The device object which is passed to FsRegistrationChange callback is the device object that represents the?File System which is getting (un)loaded. The device object represents the file system and?not the volume.?You will get volume device object in the mount (mj_file_sytem_control,mn_mount_volume) IRP which is sent to this device object. You should call IoVolumeDeviceToDosName in the mount path.
thanks
-Kiran


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Nadav
Sent: Tuesday, May 31, 2005 3:06 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] IoVolumeDeviceToDosName problems…
Hi,
?
I am tring to retrive the drive letter of a certain device using the IoVolumeDeviceToDosName (on XP), this fails with 0xC0000010 (invalid device request), how should I get the correct device?
?
To enumerate all available volumes I register a callback with?‘IoRegisterFsRegistrationChange’ (on XP), I use the DeviceObject passed to the callback
In combination with ‘IoVolumeDeviceToDosName’, the return value is 0xC0000010… how can I resolve the ‘real’ device from the device passed?by the PDRIVER_REINITIALIZE associated with ‘IoRegisterFsRegistrationChange’???
?
Thanks
?? Nadav.


Do You Yahoo!?
Yahoo! Small Business - Try our new Resources site! — Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17 You are currently subscribed to ntfsd as: xxxxx@calsoftinc.com To unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com — Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17 You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com To unsubscribe send a blank email to xxxxx@lists.osr.com