We have an NT Legacy driver that, amongst other things, maps the registers
of a PCI device into User application memory space. (There are reasons for
doing this.) It does this by taking the memory value obtained from the
resource list, translating it and then uses IoAllocateMdl,
MmBuildMdlForNonPagedPool and MmMapLockedPages. The address obtained is
then passed to the application which is then able to access the PCI
registers directly via pointers. It has been working fine.
We have the same code in the WDM version of the driver (the translated
memory address is obtained directly from the translated resource list),
but it doesn’t work. When the application attempts to write to a register
in mapped memory, the PC crashes with a black screen that displays
*** Hardware Malfunction
Call your hardware vendor for support
NMI: Parity Check / Memory Parity Error
*** The system has halted
However, the driver is able to use the same pointer to perform reads and
writes without any problems.
In both the NT and WDM cases, the routine that performs the mapping
operation is called in response to IRP_MJ_CREATE, so the context should be
that of the User application.
If I change the WDM driver code and specify KernelMode to MmMapLockedPages
instead of UserMode, the application throws an exception when a read of
the mapped memory is attempted.
Can anyone tell me how to get the WDM version working and why it should
require different treatment to the NT4 case?
Any help would be appreciated.
Richard
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com