Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > Share memory between user mode and kernel mode

Reply
Thread Tools Display Modes

Share memory between user mode and kernel mode

 
 
Pascal
Guest
Posts: n/a

 
      02-26-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

 
Reply With Quote
 
 
 
 
Eliyas Yakub [MSFT]
Guest
Posts: n/a

 
      02-27-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" <> wrote in message
news:BD5D408C-E900-41BD-B9D2-...
> 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 area
>
>
> Thanks,
> Pascal
>



 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
communication between user mode and kernel mode Monty Windows Vista Drivers 1 02-16-2004 01:12 PM
How to get the PUNICODE_STRING from Kernel mode to User mode? Siva Prakash Windows Vista Drivers 0 12-13-2003 01:25 PM
How to get the PUNICODE_STRING from Kernel mode to User mode? Siva Prakash Windows Vista Drivers 0 12-13-2003 01:25 PM
kernel mode to user mode saurabh Windows Vista Drivers 4 11-17-2003 11:45 AM
Re: How detect USER Mode Application is loaded in kernel mode driver William Ingle Windows Vista Drivers 5 07-02-2003 01:14 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59