Prev: OpenDesktop in a Windows service fails, GetLastError returns183
Next: VS 2008 - NMAKE : : macro '$@' is illegal in the context of batchrule '.c.obj'
From: Alex on 2 Apr 2008 09:16 Hello! I want to list all physical drives on my machine... anybody knows how to do this? (win32 api, c++)
From: Kellie Fitton on 2 Apr 2008 10:22 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 2 Apr 2008 10:24 sorry but i need physical hard drives and not logical...
From: Sten Westerback (MVP SDK 2005-6 :) on 2 Apr 2008 10:28 "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 2 Apr 2008 10:30
Alex wrote: > Hello! > I want to list all physical drives on my machine... > anybody knows how to do this? Simply enumerate \Device\HarddiskX? |