Don
Mon Sep 11 05:35:56 CDT 2006
Unless you are doing many MB/sec this approach is a terrible way to do
things. First, it is non-standard, second you have to come up with a way to
synchronize the user and kernel space code safely. Third you have to build
in a detection mechanism in case the application dies so you can clean up
things.
Consider using the inverted call mechanism, see
http://www.osronline.com/article.cfm?id=94 This is the common approach
Windows drivers, you use IOCTL's to send data from the user to the driver,
and you use one of more IOCTL's pended in the driver to notify and send data
to the user application.
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
http://www.windrvr.com
Remove StopSpam from the email to reply
"Chin" <chintin@gmail.com> wrote in message
news:1157966999.330406.102650@m73g2000cwd.googlegroups.com...
> Thanks, I ll have to look it other way, but do u have any suggestions
> as how to open the named objects created in kernel by createfilemapping
> .?
>
> Doron Holan [MS] wrote:
>> once you have a shared section, what are you going to do with it? use it
>> to
>> share data between your application and a driver? if so, there are
>> easier
>> (and more documented) ways of doing this.
>>
>> d
>>
>> --
>> Please do not send e-mail directly to this alias. this alias is for
>> newsgroup purposes only.
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>>
>> "Chin" <chintin@gmail.com> wrote in message
>> news:1157950136.857426.78040@p79g2000cwp.googlegroups.com...
>> > Hi ,
>> > I need to allocate memory in kernel mode , fill it and then user mode
>> > application has to read from it.
>> >
>> > I have created a named section object in kernel space with the name
>> > "\\device\\sharedmemory" using ZwCreateSection function.
>> >
>> >
>> > But the problem is when I use the function "CreateFileMapping", with
>> > "\\device\\sharedmemory" as its last argument, in user mode application
>> >
>> > , it fails to open the section object already created in the kernel
>> > mode.
>> >
>> >
>> > If I give different name than "\\device\\sharedmemory" in
>> > ZwCreateSection in kernel mode driver, then ZwCreateSection function
>> > fails.
>> >
>> >
>> > I am not able to figure out the problem .
>> >
>> >
>> > How to access the kernel mode memory from user mode.
>> >
>> >
>> > Please help.
>> >
>> >
>> > Thanking You
>> >
>