Hi,

I am part of a team, developing an application which will reside on a
CD. We want this application not to execute from any media other than
CD-ROM.
Hence, we intend to use GET_CONFIGURATION_IOCTL_INPUT to determine
media type.
The developed application is built using VC++ 6.0.

Now, I have with me Windows DDK XP SP1 and am able to compile the
application (on VC++) using the header files required for
GET_CONFIGURATION_IOCTL_INPUT.

I have beentrying this:
code starts >>>

GET_CONFIGURATION_HEADER cfg_header;
GET_CONFIGURATION_IOCTL_INPUT cfg_ip;
IO_STACK_LOCATION *io_stk_loc;

ZeroMemory(&cfg_ip, sizeof(GET_CONFIGURATION_IOCTL_INPUT));
ZeroMemory(&cfg_header, sizeof(GET_CONFIGURATION_HEADER));

// io_stk_loc = IoGetCurrentIrpStackLocation(IRP_MJ_CREATE);

cfg_ip.Feature = FeatureProfileList;
cfg_ip.RequestType = SCSI_GET_CONFIGURATION_REQUEST_TYPE_ALL;

IOCTL_CDROM_GET_CONFIGURATION;

code ends >>>

There are two issues that I would like to get clarified:
1. The DDK documentation mentions that the input parameters are:
Parameters.DeviceIoControl.InputBufferLength =
sizeof(GET_CONFIGURATION_IOCTL_INPUT);
Parameters.DeviceIoControl.OutputBufferLength =
sizeof(GET_CONFIGURATION_HEADER). How do I get handle to this
IO_STACK_LOCATION structure.

2. In the above code snippet, if I use IoGetCurrentIrpStackLocation
call (currently commented)to get the IO_STACK_LOCATION, I get the
"Compiler version not supported by Windows DDK" error. But, I do not
want to use the compiler given by DDK as the rest of the app requires
VC++.

Being new to Device level programming, I would like some help, in the
form of code snippet or anything that could be of help.

Our only requirement is that "We want this application not to execute
from any media other than CD-ROM."

Best Regards,
Achilles Pereira.