Vista, help needed

How to map on Vista \Device\HarddiskVolumeX to \Device\HarddiskY for removable media.
On Xp I do not have such problem because attaching to volume on removable media I have name for example \Device\Harddisk2\DP(1)0-0+7 (on Vista \Device\HarddiskVolumeX).

Have tried IOCTL_STORAGE_GET_DEVICE_NUMBER ?

At 08:33 05/09/2008, xxxxx@techemail.com wrote:

How to map on Vista \Device\HarddiskVolumeX to \Device\HarddiskY
for removable media.
On Xp I do not have such problem because attaching to volume on
removable media I have name for example
\Device\Harddisk2\DP(1)0-0+7 (on Vista \Device\HarddiskVolumeX).

Thanks. I’ll try.

i tried to use IOCTL_STORAGE_GET_DEVICE_NUMBER, but on volume device object it goes to blue screen. When i try to call IOCTL_STORAGE_GET_DEVICE_NUMBER on USBSTOR device object, then i have for example:
Device\Harddiks1 DeviceType = 0x07 ,DeviceNumber=1 , PartitionNumber=0
This information is useless for me because i know that is Harddiks1. In this case i need to get relation to HarddiskVolume2 volume device object.
What to do i don’t know.

I got a lot of useful information from MountManager, as unique usb device identification. But using this information is required a lot of redesign of my code.
Maybe I get some useful information from Volume manager.
If someone know how to get device object of Volume Manager

Its easy to get calling IoGetDeviceObjectPointer where the name is “\??\Volume{GUID}” (i got it before from MountManager)
VolumeManager supplied me with the information i wanted
Thanks a lot to all who wanted to help me.