My driver is currently called from a third-party 32-bit process regardless of the OS it is on.
The driver however will be native 32/64 bit.
If I use an IOCTL to pass a buffer and size down into the driver - a la:
and given that all the parameters are correctly typed for the DeviceIoControl call, will the driver correctly thunk the buffer pointer when I call GetDataBuffer() on the memory object, or will I have to code for this?
If I pass in a structure containing pointers, I presume that I WILL need to code for these as they will not have been thunked.
If you're running at a 64 bit system and a 32 bit application call DeviceIoControl, all the buffers (input/output) will be translated from 32 to 64 bit by the WOW64 (not WDF).
That translation will be done for the addresses you have used at the input and output buffers on a DeviceIoControl call but, if the data you are transferring to the driver takes an embedded pointer, that pointer cannot be translated.
Take a look at this page for further details.
Regards,
Fernando Roberto da Silva
DriverEntry Kernel Development
Another concern here is that the layout of your buffers might differ between
platforms due to alignment issues.
Good luck,
mm
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@driverentry.com.br
Sent: Friday, March 04, 2011 8:15 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Does WDF do 32/64 bit thunking for you?
Hi Peter,
If you're running at a 64 bit system and a 32 bit application call
DeviceIoControl, all the buffers (input/output) will be translated from 32
to 64 bit by the WOW64 (not WDF).
That translation will be done for the addresses you have used at the input
and output buffers on a DeviceIoControl call but, if the data you are
transferring to the driver takes an embedded pointer, that pointer cannot be
translated.
Take a look at this page for further details.
Regards,
Fernando Roberto da Silva
DriverEntry Kernel Development
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
To unsubscribe, visit the List Server section of OSR Online at
Thank you for clarifying this.
My driver is simple enough that I don’t need to pass embedded pointers within structures into, or out of, the driver so I think I am good to go on this score.
Any recommendations on passing a BOOL - should I use a BYTE value instead?
The main concern about having different struture sizes between a 32 bit application and a 64 bit driver is about the types that refer to pointers indexing or pointers itselves.
That page shows a table of data types that need thunking.