Click here to Skip to main content
15,886,617 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: DeviceIoControl question Pin
Randor 28-Feb-12 15:17
professional Randor 28-Feb-12 15:17 
GeneralRe: DeviceIoControl question Pin
RomTibi1-Mar-12 4:49
RomTibi1-Mar-12 4:49 
GeneralRe: DeviceIoControl question Pin
Randor 1-Mar-12 8:00
professional Randor 1-Mar-12 8:00 
GeneralRe: DeviceIoControl question Pin
RomTibi1-Mar-12 9:53
RomTibi1-Mar-12 9:53 
GeneralRe: DeviceIoControl question Pin
Randor 2-Mar-12 0:39
professional Randor 2-Mar-12 0:39 
GeneralRe: DeviceIoControl question Pin
RomTibi2-Mar-12 4:25
RomTibi2-Mar-12 4:25 
GeneralRe: DeviceIoControl question Pin
Randor 2-Mar-12 18:18
professional Randor 2-Mar-12 18:18 
GeneralRe: DeviceIoControl question Pin
RomTibi5-Mar-12 8:25
RomTibi5-Mar-12 8:25 
My project is to make an app that erases media (HDD, USB flash, USB HDD, etc.) showing some information on them. I use \\.\PhysicalDriveX to access the media for details on the size and type (fixed, removable, etc.).
I found that the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Disk\Enum\
keeps up-to-date the drives in order that they are attached.
First it comes the first HDD - subkey "0" something like IDE\DiskWDC_WD5000BEVT-0A0RT0__________________01.01A01\5&2c0d176e&0&0.0.0, next, the next HDD ... .
Then follows the USB devices, in the order that they were attached.

Here comes trouble...

Consider you have 1 HDD and 2 USB devices A and B.
Subkey 0 holds data for the HDD.

Attach A, subkey 1 holds data for A.
Attach B, subkey 2 holds data for B.
Detach A, subkey 1 holds data for B.
Attach A, subkey 2 holds data for A.

... and all this time ...

A remained \\.\PhysicalDrive1
B remained \\.\PhysicalDrive2

I can`t count on registry for that information, so I have to obtain them - via DeviceIoControl with a handle for \\.\PhysicalDriveX so I can map the devices to the description, exactly.

I hope that is clear enough, now, what is my problem. Cry | :((

36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.

SUN-TZU - Art of War

GeneralRe: DeviceIoControl question Pin
Randor 5-Mar-12 12:38
professional Randor 5-Mar-12 12:38 
GeneralRe: DeviceIoControl question Pin
RomTibi5-Mar-12 18:14
RomTibi5-Mar-12 18:14 
GeneralRe: DeviceIoControl question Pin
Randor 6-Mar-12 4:16
professional Randor 6-Mar-12 4:16 
GeneralRe: DeviceIoControl question Pin
RomTibi6-Mar-12 4:29
RomTibi6-Mar-12 4:29 
GeneralRe: DeviceIoControl question Pin
RomTibi9-Mar-12 9:19
RomTibi9-Mar-12 9:19 
QuestionRe: DeviceIoControl question Pin
Randor 9-Mar-12 11:45
professional Randor 9-Mar-12 11:45 
AnswerRe: DeviceIoControl question Pin
RomTibi10-Mar-12 9:31
RomTibi10-Mar-12 9:31 
AnswerRe: DeviceIoControl question Pin
RomTibi16-Mar-12 6:31
RomTibi16-Mar-12 6:31 
GeneralRe: DeviceIoControl question Pin
Randor 16-Mar-12 14:01
professional Randor 16-Mar-12 14:01 
GeneralRe: DeviceIoControl question Pin
RomTibi16-Mar-12 20:29
RomTibi16-Mar-12 20:29 
GeneralRe: DeviceIoControl question Pin
Randor 21-Mar-12 10:55
professional Randor 21-Mar-12 10:55 
GeneralRe: DeviceIoControl question Pin
K4HVDs22-Mar-12 6:39
K4HVDs22-Mar-12 6:39 
QuestionRe: DeviceIoControl question Pin
Randor 27-Mar-12 14:00
professional Randor 27-Mar-12 14:00 
AnswerRe: DeviceIoControl question Pin
K4HVDs27-Mar-12 17:56
K4HVDs27-Mar-12 17:56 
QuestionNeed debugger Pin
Mast Avalons28-Feb-12 5:06
Mast Avalons28-Feb-12 5:06 
AnswerRe: Need debugger Pin
Richard MacCutchan28-Feb-12 5:27
mveRichard MacCutchan28-Feb-12 5:27 
AnswerRe: Need debugger Pin
Randor 28-Feb-12 16:10
professional Randor 28-Feb-12 16:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.