Display Driver - sharing memory problem.

Hi.
I’m doing mirror display driver. And I have a problem with using common memory between driver and (ring 3) app. I ’m using file mapping to share that memory. From driver side I use EngMapFile and from app side I use FileOpen, CreateFileMapping functions.
On Windows Xp it’s works normal, but on Windows Vista it isn’t working correctly because app doesn’t has necessary right to access mapped file, even if it’s (app) runnig on admin rights.
Could anyone can tell me please another way to share common memory between driver and app without mapping the file, taking into account that display driver can’t include wdm.h and ntddk.h.

Multiple file mappings of the same file are not guarenteed to be synchronized. Two file unnamed mappings to the same file will be loaded into different address spaces, and the only time they will be synched is if both sides are pagable. I’m suprised that approach worked at all.

You will have better luck if you use an escape callback (see DrvEscape in the DDK and ExtEscape in the platform SDK) and pass back in the handle to a bitmap you create in user mode. HBITMAPS in user mode are equivalent to HSURFs in kernel-mode, so you should be able to use EngLockSurface to establish a common memory space.