From: Alex on
Hello!
I want to list all physical drives on my machine...
anybody knows how to do this?


(win32 api, c++)
From: Kellie Fitton on
On Apr 2, 6:16 am, Alex <h4cker_...(a)hotmail.com> wrote:
> Hello!
> I want to list all physical drives on my machine...
> anybody knows how to do this?
>
> (win32 api, c++)


Hi,

You can use the following APIs to get the currently available disk
drives on your machine:

GetLogicalDrives()

GetLogicalDriveStrings()

GetDriveType()

http://msdn2.microsoft.com/en-us/library/aa364972.aspx

http://msdn2.microsoft.com/en-us/library/aa364975.aspx

http://msdn2.microsoft.com/en-us/library/aa364939.aspx

Kellie.

From: Alex on
sorry but i need physical hard drives and not logical...
From: Sten Westerback (MVP SDK 2005-6 :) on

"Alex" <h4cker_rus(a)hotmail.com> wrote in message
news:ft013m$e81$1(a)aioe.org...
> Hello!
> I want to list all physical drives on my machine...
> anybody knows how to do this?

You should tell a bit more specifically what type of information you want.
SCSI ID's?
Anyway, FindFirstVolume() might give you something useful. Or maybe even
FindFirstVolumeMountPoint().
And ofcourse one knows that the physical devices are accessible
(CreateFile()) using paths such as \\.\PHYSICALDRIVE0
Then there is DeviceIoControl with FSCTL_GET_NTFS_VOLUME_DATA and/or
IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS.

And of course there are PnP related API's but i think they are more
appropriate in kernel mode. But try EnumDeviceDrivers and

If on the other hand you want logical drives, check out GetLogicalDrives().

- Sten


From: Sebastian G. on
Alex wrote:

> Hello!
> I want to list all physical drives on my machine...
> anybody knows how to do this?


Simply enumerate \Device\HarddiskX?