News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

where are the winioctl.h defines ?

Started by Shantanu Gadgil, April 29, 2005, 06:56:21 PM

Previous topic - Next topic

Shantanu Gadgil

Are the winioctl.h eqautes missing from MASM32 ?

Or am I missing them.

If they are missing...the equates are MACRO expansions in the winioctl.h file...
e.g.:
#define FSCTL_LOCK_VOLUME               CTL_CODE(FILE_DEVICE_FILE_SYSTEM,  6, METHOD_BUFFERED, FILE_ANY_ACCESS)

Right now I make do with a function which replicates the behaviour of the macro CTL_CODE:
#define CTL_CODE( DeviceType, Function, Method, Access ) (                 \
    ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
)

So..if the function call is supposed to be:
invoke DeviceIoControl,hVolume, IOCTL_STORAGE_EJECT_MEDIA, NULL, 0, NULL, 0,addr dwBytesReturned, NULL

the IOCTL_STORAGE_EJECT_MEDIA is a macro expansion in the .H file, so what I do is:
---
;reference: Platform SDK
;#define IOCTL_STORAGE_EJECT_MEDIA             CTL_CODE(IOCTL_STORAGE_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)

invoke   GetCtrlCode,IOCTL_STORAGE_BASE,0202h, METHOD_BUFFERED, FILE_READ_ACCESS
mov   dwCtlCodeValue,eax ;required, for the use of "addr" in the next invoke
invoke   DeviceIoControl,hVolume, dwCtlCodeValue, NULL, 0, NULL, 0,addr dwBytesReturned, NULL
---

Any ideas as to how to do it in any other method ?

I already have the small utility which gives the final value of the macro expansion.
What I want to know is, if there is a method in code itself to do it ?
To ret is human, to jmp divine!

Opcode

Hi,

You can find the defines inside the KMDKIT 1.8 at:
http://phr34k.game-host.org/ebook/four-f/

Regards,
Opc0de

thomas_remkus

Is it just me? ... I can't seem to download the zip for the kit. Does anyone else have luck?

thomas