Tech Support > Microsoft Windows > Drivers > Share memory between user mode and kernel mode
Share memory between user mode and kernel mode
Posted by Pascal on February 26th, 2004


Hi

A windows application (user mode) create a memory area with CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE,0,TAILLE_BUFFER,"SharingImage"

I want to use this area in a driver (kernel mode).
According to the Microsoft knowledge Base 191840. I have to use the following functions
- ZwOpenSection(
-ZwMapViewOfSection(

But I don't know how to get adress of the area

The source is

RtlInitUnicodeString(&ShareMemoryName,L"\\SharingI mage")

InitializeObjectAttributes( &InitializedAttributes, &ShareMemoryName, OBJ_PERMANENT | OBJ_CASE_INSENSITIVE, NULL, NULL)

status = ZwOpenSection( &pat_AcquisitionFile,SECTION_MAP_READ, &InitializedAttributes)

the return code is always
"STATUS_OBJECT_NAME_NOT_FOUND"

What can I do to point to the right are

Thanks
Pasca

Posted by Eliyas Yakub [MSFT] on February 27th, 2004


Try:

RtlInitUnicodeString(&ShareMemoryName,L"\\BaseName dObjects\\SharingImage");

InitializeObjectAttributes (&InitializedAttributes,
&ShareMemoryName,
OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE ,
(HANDLE) NULL,
(PSECURITY_DESCRIPTOR) NULL);
--
-Eliyas
This posting is provided "AS IS" with no warranties, and confers no rights.
http://www.microsoft.com/whdc/hwdev/driver/kb-drv.mspx
"Pascal" <anonymous@discussions.microsoft.com> wrote in message
news:BD5D408C-E900-41BD-B9D2-1DB9A3065B68@microsoft.com...
PAGE_READWRITE,0,TAILLE_BUFFER,"SharingImage")