Advertisement

11.20.2008 at 11:24AM PST, ID: 23922733 | Points: 500
[x]
Attachment Details

How to Enumerate Physical Disks ?

Asked by verpies in Windows Programming

How to enumerate all of the physical disks attached to the system in User Mode and without WMI ?

Note:
1) I am interested in all physical disks including harddisks and USB disks. Fixed and removable.
2) I am interested in enumerating disks that do not contain any partitions and file systems.
3) I am not interested in enumerating only disks with partitions or assigned drive letters.
4) I am not interested in enumerating partitions.
5) If somebody suggests trying all \\.\PhysicalDrive0, \\.\PhysicalDrive1, \\.\PhysicalDrive3, ..., \\.\PhysicalDriveX, please prove that all of the disks, that I am interested in, will always be named in that manner.


Below is an example how to do it in Kernel Mode, (but I prefer not to load any drivers to accomplish such simple task) :

Enumerating device objects representing disks and partitions
http://www.codeproject.com/KB/system/rawsectorio.aspx
Start Free Trial
 
 
[+][-]11.20.2008 at 12:36PM PST, ID: 23007860

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.20.2008 at 03:42PM PST, ID: 23009500

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 - Hierarchy / EE_QW_2_20070628