does any one knowes how to use DeviceIoControl function, i've noticed that one of its params can be IOCTL_STORAGE_CHECK_VERIFY which my API reference explain like:
The IOCTL_STORAGE_CHECK_VERIFY DeviceIoControl operation determines whether a device's media is accessible; for example, whether the media is in the device.

i've want use this func to check if the CD-compact is in the drive and this way maybe i'll be able to do this.... finly:)

when i tried to assemble: Invoke DeviceIoControl, Eax, IOCTL_STORAGE_CHECK_VERIFY, 0, 0, 0, 0, 0, 0 i've got an error couse in there is no definition of IOCTL_STORAGE_CHECK_VERIFY, when i google it i've found this site where i found this:
and i do not know how to interpret this, i dont know C/C++ yet :(

help.... any one
Posted on 2002-02-03 08:02:51 by NEMO
I just made a C++ program and IOCTL_STORAGE_CHECK_VERIFY is defined to be 0x002d4800

MS gets this number by doing several bit shifts and ORs with other predefined things. That header you linked to contains all the defines and the macro for generating the DWORD

#define CTL_CODE( DeviceType, Function, Method, Access ) ( \
((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \

#define FILE_DEVICE_MASS_STORAGE 0x0000002d
#define FILE_READ_ACCESS ( 0x0001 )

So the macro takes 0x0000002d as it's first parameter and shifts it 16 bits to the left ( the << means bit shift).
Access (0x0001) is shifted to the left 14 bits and Function (0x200) is shifted 2 bits. The | means OR the values together. So to get the final number OR all the shifted values and Method ( 0 ) together.

Also, be aware that in some cases, DeviceIoControl works differently on NT,2k vs 95,98, ME.
Posted on 2002-02-03 10:58:30 by Mecurius