Click here to Skip to main content
15,917,176 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Return value from a funtion Pin
«_Superman_»10-Aug-09 18:41
professional«_Superman_»10-Aug-09 18:41 
GeneralRe: Return value from a funtion Pin
AkashAg10-Aug-09 18:46
AkashAg10-Aug-09 18:46 
GeneralRe: Return value from a funtion Pin
«_Superman_»10-Aug-09 18:47
professional«_Superman_»10-Aug-09 18:47 
AnswerRe: Return value from a funtion Pin
Stuart Dootson10-Aug-09 21:22
professionalStuart Dootson10-Aug-09 21:22 
QuestionTranslate Logical Drive to Physical Drive Pin
Bram van Kampen10-Aug-09 14:55
Bram van Kampen10-Aug-09 14:55 
AnswerRe: Translate Logical Drive to Physical Drive Pin
Randor 10-Aug-09 17:45
professional Randor 10-Aug-09 17:45 
GeneralRe: Translate Logical Drive to Physical Drive [modified] Pin
Bram van Kampen11-Aug-09 11:09
Bram van Kampen11-Aug-09 11:09 
GeneralRe: Translate Logical Drive to Physical Drive Pin
Randor 11-Aug-09 13:06
professional Randor 11-Aug-09 13:06 
Bram van Kampen wrote:
Cannot find the (hex)Value of IOCTL_STORAGE_GET_DEVICE_NUMBER.



Interesting. They are declared in the Winioctl.h header file.

Some questions:

1.) What development environment are you using?
2.) What version of the Platform/Windows SDK are you using if any?

You can probably get away with dropping these declarations somewhere:

#define FILE_ANY_ACCESS                 0
#define FILE_SPECIAL_ACCESS    (FILE_ANY_ACCESS)
#define FILE_READ_ACCESS          ( 0x0001 )    // file & pipe
#define FILE_WRITE_ACCESS         ( 0x0002 )    // file & pipe

#define METHOD_BUFFERED                 0
#define METHOD_IN_DIRECT                1
#define METHOD_OUT_DIRECT               2
#define METHOD_NEITHER                  3

#define FILE_DEVICE_MASS_STORAGE        0x0000002d
#define IOCTL_STORAGE_BASE FILE_DEVICE_MASS_STORAGE

#define CTL_CODE( DeviceType, Function, Method, Access ) (                 \
    ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
)
#define IOCTL_STORAGE_GET_DEVICE_NUMBER       CTL_CODE(IOCTL_STORAGE_BASE, 0x0420, METHOD_BUFFERED, FILE_ANY_ACCESS)

typedef struct _STORAGE_DEVICE_NUMBER {

    //
    // The FILE_DEVICE_XXX type for this device.
    //

    DEVICE_TYPE DeviceType;

    //
    // The number of this device
    //

    DWORD       DeviceNumber;

    //
    // If the device is partitionable, the partition number of the device.
    // Otherwise -1
    //

    DWORD       PartitionNumber;
} STORAGE_DEVICE_NUMBER, *PSTORAGE_DEVICE_NUMBER;


You should really correctly setup your development environment rather than dropping the above declarations into your project. Are you using VC6 or something?

Best Wishes,
-David Delaune
GeneralRe: Translate Logical Drive to Physical Drive Pin
Bram van Kampen12-Aug-09 8:31
Bram van Kampen12-Aug-09 8:31 
GeneralRe: Translate Logical Drive to Physical Drive Pin
Andy Belton24-Dec-11 21:37
Andy Belton24-Dec-11 21:37 
GeneralRe: Translate Logical Drive to Physical Drive Pin
Randor 26-Dec-11 11:13
professional Randor 26-Dec-11 11:13 
GeneralRe: Translate Logical Drive to Physical Drive Pin
Andy Belton1-Jan-12 1:40
Andy Belton1-Jan-12 1:40 
GeneralRe: Translate Logical Drive to Physical Drive Pin
Randor 1-Jan-12 2:54
professional Randor 1-Jan-12 2:54 
GeneralRe: Translate Logical Drive to Physical Drive Pin
Andy Belton4-Jun-12 4:34
Andy Belton4-Jun-12 4:34 
QuestionIostream processing\flags question Pin
GuimaSun10-Aug-09 12:23
GuimaSun10-Aug-09 12:23 
AnswerRe: Iostream processing\flags question Pin
Stuart Dootson10-Aug-09 21:10
professionalStuart Dootson10-Aug-09 21:10 
GeneralRe: Iostream processing\flags question Pin
GuimaSun11-Aug-09 2:55
GuimaSun11-Aug-09 2:55 
QuestionWait Until Event Occurs Pin
staticv10-Aug-09 4:50
staticv10-Aug-09 4:50 
AnswerRe: Wait Until Event Occurs Pin
Stuart Dootson10-Aug-09 8:32
professionalStuart Dootson10-Aug-09 8:32 
GeneralRe: Wait Until Event Occurs Pin
staticv10-Aug-09 20:30
staticv10-Aug-09 20:30 
GeneralRe: Wait Until Event Occurs Pin
Stuart Dootson10-Aug-09 21:01
professionalStuart Dootson10-Aug-09 21:01 
GeneralRe: Wait Until Event Occurs Pin
staticv10-Aug-09 21:25
staticv10-Aug-09 21:25 
QuestionSHGetFolderPath returns E_FAIL for CSIDL_BITBUCKET Pin
Nitheesh George10-Aug-09 4:43
Nitheesh George10-Aug-09 4:43 
AnswerRe: SHGetFolderPath returns E_FAIL for CSIDL_BITBUCKET Pin
Stuart Dootson10-Aug-09 8:27
professionalStuart Dootson10-Aug-09 8:27 
AnswerRe: SHGetFolderPath returns E_FAIL for CSIDL_BITBUCKET Pin
Randor 10-Aug-09 9:44
professional Randor 10-Aug-09 9:44 

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.