Getting a volume's GUID

NTFSD Folk:

I’d like my filter driver to use a volume’s Unique ID (e.g.,
“??\Volume{1b765b2c-4a2c-11d8-87f9-806e6f6e6963}”) rather than the device
name (e.g., “\Device\HarddiskVolume1”) since the device name might change
some day.

But I can’t find where to get the Unique ID.

I’ve tried IOCTL_MOUNTDEV_QUERY_UNIQUE_ID and
IOCTL_MOUNTDEV_QUERY_STABLE_GUID, but neither seem to return the right
stuff. I’m doing it on the StorageStackDeviceObject that my filter attaches
to.

What’s the trick?

Thanks,
Ken

Use IOCTL_MOUNTDEV_QUERY_UNIQUE_ID on your storage device then query
the MountMgr using IOCTL_MOUNTMGR_QUERY_POINTS. This only works after
the device has started and the MountMgr has done its thing with the
device (eg. assign a drive letter).

OSR has a good article about using some of the features of the Mount
Manager.

On 15-Sep-04, at 11:30 AM, Ken Cross wrote:

NTFSD Folk:

I’d like my filter driver to use a volume’s Unique ID (e.g.,
“??\Volume{1b765b2c-4a2c-11d8-87f9-806e6f6e6963}”) rather than the
device
name (e.g., “\Device\HarddiskVolume1”) since the device name might
change
some day.

But I can’t find where to get the Unique ID.

I’ve tried IOCTL_MOUNTDEV_QUERY_UNIQUE_ID and
IOCTL_MOUNTDEV_QUERY_STABLE_GUID, but neither seem to return the right
stuff. I’m doing it on the StorageStackDeviceObject that my filter
attaches
to.

What’s the trick?

Thanks,
Ken


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@telus.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

Cliff Russell
Software Engineer

e-mail: xxxxx@atimi.com
ichat: xxxxx@mac.com
phone: 250 818 5711

Atimi Software: Software Development - On Time.
http://www.atimi.com