• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2841
  • Last Modified:

D:\ -> \\.\PHYSICALDRIVE0 or 1 ?

I need to know how I can get the physical drive number (winNT) that belongs to a specified logical volume drive.

E.g.

Does "D:\" belong to "\\.\PHYSICALDRIVE0" or to "\\.\PHYSICALDRIVE1"?

There must be an API somewhere.

Thanx for your help!!
0
drdt3
Asked:
drdt3
1 Solution
 
PinTailCommented:
look in the registry
0
 
pavel030297Commented:
Try DeviceIoControl functions IOCTL_DISK_GET_DRIVE_GEOMETRY,
IOCTL_DISK_GET_DRIVE_LAYOUT,IOCTL_DISK_GET_PARTITION_INFO.

0
 
naveenkohliCommented:
Look at this URL.... http://www.codeguru.com/atl/atlcontain.shtml

The implementation of DeviceIoControl to get the physical drive number is in SystemHDisk project of the source code..
The file name is HDiskInformation.cpp.
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
jkrCommented:
Take a look at 'http://www.sysinternals.com/diskkey.htm' - this should give you the relevant information along with some source code...
0
 
drdt3Author Commented:
Hi jkr!
Thank you. But what is with NT5 (NT2000)? Sysinternals tells there is nothing the same.


0
 
jkrCommented:
Hmm, sysinternals tells that the registry key is kept for backward compatibility, only the fault tolerance information is stored on the medium directly. From my experience with MS OSs, these 'backward compatibility' issues are kept quite a while (IMHO until Win2005 ;-)
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now