Enum drives, partitions and finding drive letters for each partition?

I want to enumerate all hard drives, their partitions
and list the drive letters for each partition.

It’s *not* sufficient to only call GetLogicalDriveStrings
or GetLogicalDrives, since that only gives me the
partitions.

I would like this to work on XP, ME, 98, and 2K (in that
priority order).

I think I should use the CM_* functions, such as
CM_Locate_DevNode, CM_Get_DevNode_Registry_Property,
CM_Get_Child and CM_Get_Sibling. I’ve managed to
enumerate devices, but I have no clue how to find
drive letters.

Thanks in advance.

ME and 98?

For 2K and above, you use FindVolumeMountPoints after GetLogicalDriveStrings
to find the volumes that are mounted without drive letters.

Or, are you looking for things that are not mounted at all?

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mattias
Sent: Tuesday, October 14, 2003 2:26 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Enum drives, partitions and finding drive letters for each
partition?

I want to enumerate all hard drives, their partitions
and list the drive letters for each partition.

It’s *not* sufficient to only call GetLogicalDriveStrings
or GetLogicalDrives, since that only gives me the
partitions.

I would like this to work on XP, ME, 98, and 2K (in that priority order).

I think I should use the CM_* functions, such as CM_Locate_DevNode,
CM_Get_DevNode_Registry_Property, CM_Get_Child and CM_Get_Sibling. I’ve
managed to enumerate devices, but I have no clue how to find drive letters.

Thanks in advance.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@dchbk.us
To unsubscribe send a blank email to xxxxx@lists.osr.com