kuasha
Thu Jul 19 11:18:10 CDT 2007
I am very new to driver development. I am working on a software only WDM
driver. I have created experimental drivers to understand the data transfer
mechanism of different methods. With help of docs and books I can now
transfer data both way using any of the three methods with IOCTL requests.
Can create contexts and use them. Can use system thread- use IoMarkIrpPending
in dispatch routines and complete that request from the thread. Reading
books, documents and news groups. Just started to understand the chapters of
System Programming Guide from Intel.
So, I asked the basic question -what to do in the following situation:
I need to use a shared section of 64KB of memory in the driver. It is shared
with an application (service). Currently it is implemented this way:
The service creates a section with NtCreateSection and issues a
DeviceIoControl to the driver with the section handle as one of the
parameter. The service itself uses a call of NtMapViewOfSection to map the
section and use it.
The driver creates a section (!) object with ObReferenceObject from the
section handle received from the service. Now using MmMapViewInSystemSpace
the section is mapped in system space.
But when I tried to port it on X64 platform (64 bit Windows XP) I found that
MmMapViewInSystemSpace is not working. So I recode that part- take the handle
and use ZwMapViewOfSection to map it in system space.
Now I am trying to use the section to transfer data between the driver and
application. Possibly I do not need any other function in normal cases- as
only my service communicate with my driver this way. But, should I lock the
memory before use? Possibly I should probe also?
Trying to understand the right way to do all these.
--
--
Sincerely,
Maruf Maniruzzaman,
Software Engineer,
KAZ Software Limited,
Dhaka, Bangladesh.
http://www.kaz.com.bd
http://www.kuashaonline.com
"Doron Holan [MSFT]" wrote:
> what are you trying to do in the end?
>
> --
> 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.
>
>
> "kuasha" <kuasha@discussions.microsoft.com> wrote in message
> news:ACEBB7B3-8D96-40D3-8A66-ED7C7E1A7179@microsoft.com...
> >I need an alternate to MmMapViewInSystemSpace. Seems it does not work on
> >X64
> > systems. Should the following work?
> >
> > ZwMapViewOfSection
> > IoAllocateMdl
> > MmProbeAndLockPages
> > MmGetSystemAddressForMdlSafe
> >
> > Is there any sample somewhere?
> >
> >
> >
> > --
> > --
> > Sincerely,
> > Maruf Maniruzzaman,
> > Software Engineer,
> > KAZ Software Limited,
> > Dhaka, Bangladesh.
> >
http://www.kaz.com.bd
> >
http://www.kuashaonline.com
> >
>