Problem with handle for applications running on WOW

Hi All,

I am using a driver which opens a file using kernel interface and gives the handle
to user mode. Usermode then uses this handle to read the file. This is ok if both
the driver and application are 64 bit. But on 64 bit OS where driver is 64 bit and
application is 32, I think there will be problem as handle for 32 application is 32 bit
and that for driver is 64 bit. The driver opens the file in the context of process.
Will it happen that driver opens file with handle value that does not fit in 32 bit.
so it get truncated and application that use this get failed.

Thanks & Regards,
Amit.

> I am using a driver which opens a file using kernel interface and gives the handle

to user mode.

This does not work. Redesign your code.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

Actually I want to read a file that is exclusively opened by some other process.
So opening such a file is not possible in usermode. And I am using
IoCreateFileSpecifyDeviceObjectHint to open it in kernel mode.

This is just a tryout to verify that we can read a file that is exclusively opened.