su_yu
Tue Jun 22 18:09:29 CDT 2004
Thanks a lot. Could you please send me some sample code on what you
suggested?
I am not sure how to "pass it to the driver in an IOCTL" and "pend
this IOCTL till MJ_CLEANUP will arrive for this file."
Thanks in advance.
Jack
>
"Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message news:<ePuUE0GWEHA.716@TK2MSFTNGP11.phx.gbl>...
> What you do will not work. Specifying the allocation tag as a parameter to
> OpenFileMapping is the same as specifying the file name for a registry key :-)
> if not worse.
>
> A much better way is to:
>
> - allocate the memory in the app
> - pass it to the driver in an IOCTL
> - pend this IOCTL till MJ_CLEANUP will arrive for this file.
>
> The driver will have MmGetSystemAddressForMdlSafe(Irp->MdlAddress) to
> access the area.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@storagecraft.com
>
http://www.storagecraft.com
>
>
> "JackSu" <su_yu@yahoo.com> wrote in message
> news:8e35816c.0406220717.468e7f02@posting.google.com...
> > Hi all,
> >
> > I am newbie for driver programming.
> >
> > I created a shared memory in driver program using
> > ExAllocatePoolWithTag,
> > the last parameter is the address a string "ADDR".
> >
> > Then I tried to access that shared memory from one application using
> > OpenFileMapping with lpName "ADDR".
> >
> > It failed, shows no access to that memory. Then I changed the
> > parameter in OpenFileMapping to a random bad name, I got the same
> > error.
> >
> > That program can work with shared memory which created using
> > CreateFileMapping.
> >
> > Any suggestion are highly welcome.