Link to home
Start Free TrialLog in
Avatar of drdt3
drdt3

asked on

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!!
Avatar of PinTail
PinTail
Flag of United Kingdom of Great Britain and Northern Ireland image

look in the registry
Avatar of pavel030297
pavel030297

Try DeviceIoControl functions IOCTL_DISK_GET_DRIVE_GEOMETRY,
IOCTL_DISK_GET_DRIVE_LAYOUT,IOCTL_DISK_GET_PARTITION_INFO.

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.
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of drdt3

ASKER

Hi jkr!
Thank you. But what is with NT5 (NT2000)? Sysinternals tells there is nothing the same.


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 ;-)