I need to present the user-friendly Windows “names” of real physical
non-removable disks in a GUI. I’m far from expert on Windows admin
tasks, so I’d be grateful for corrections to any assumptions, as
well as any answers.
The best user-friendly name appears to be “Disk n” since this is the
name used in the Disk Management applet. From what I can tell, these
names are invented by this applet (or its helpers) and aren’t
stored anywhere. Is it safe to assume that the number in this name
will always be the same as the numbers in the \Device\Harddiskn\DRn
name for the same disk? (I’m guessing this is how Disk Management
makes up the name.)
I only currently have access to systems with a few disks. Is ‘n’ a
simple decimal number when there are many disks - for example,
“Disk 328” and “\Device\Harddisk328\DR328”?
My apologies if you feel this is off-topic - the GUI is part of a
project that’s mainly drivers, if that’s any consolation…
IOCTL_STORAGE_GET_DEVICE_NUMBER should give you this information
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of J. J. Farrell
Sent: Wednesday, August 11, 2004 4:02 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Disk Naming and Numbering
I need to present the user-friendly Windows “names” of real physical
non-removable disks in a GUI. I’m far from expert on Windows admin
tasks, so I’d be grateful for corrections to any assumptions, as well as
any answers.
The best user-friendly name appears to be “Disk n” since this is the
name used in the Disk Management applet. From what I can tell, these
names are invented by this applet (or its helpers) and aren’t stored
anywhere. Is it safe to assume that the number in this name will always
be the same as the numbers in the \Device\Harddiskn\DRn name for the
same disk? (I’m guessing this is how Disk Management makes up the name.)
I only currently have access to systems with a few disks. Is ‘n’ a
simple decimal number when there are many disks - for example, “Disk
328” and “\Device\Harddisk328\DR328”?
My apologies if you feel this is off-topic - the GUI is part of a
project that’s mainly drivers, if that’s any consolation…
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
>I need to present the user-friendly Windows “names” of real physical
non-removable disks in a GUI. I’m far from expert on Windows admin
tasks, so I’d be grateful for corrections to any assumptions, as
well as any answers.
You can also use the SetupDI*** set of APIs to enumerate the disk drives on
your system and get a “friendly” name. Here’s a utility I wrote to do just
that (among other things):
http://www.bustrace.com/downloads/GuidExp.exe
Click on the “GUID_DEVCLASS_DISKDRIVE” option, then click on the disk drive
you want more details on and then click on SPDRP_FRIENDLYNAME to view the
disk drive’s name (among many other options). The DDK has sample code on
using the SetupDI APIs. Good luck.
Mike Berhan
Get ready for school! Find articles, homework help and more in the Back to
School Guide! http://special.msn.com/network/04backtoschool.armx