I have another problem when i am trying to map the kernel memory to user mode the deviceioctl is returing the outputbuffer to "0" value.I have no clue what is going wrong.the driver is returning the MmMapLockedPagesSpecifyCache address correctly when i used the debug print

In the driver source

#define FIFO_BUFFER_MAX 104857

ExAllocatePoolWithTag(NonPagedPool,FIFO_BUFFER_MAX,'QPRI')

IoAllocateMdl(pBuffer,FIFO_BUFFER_MAX,FALSE,FALSE,NULL)

MmMapLockedPagesSpecifyCache(pMdl
UserMode
MmCached
NULL
FALSE
NormalPagePriority)

Application.c

The IOCTL call i used is METHOD BUFFERED and the stub is like this

bRet = DeviceIoControl(hDevice
HFP_TEST_IOCTL
NULL
0
pBuffer
sizeof(ULONG)
&dwRet
NULL)

the value of pBuffer is 0

please help me out is there anything wrong in the call i made to the driver

sa

RE: MmMapLockedPagesSpecifyCache by anonymous

anonymous
Mon Jan 12 16:26:38 CST 2004

Hi

I was able to map the kernel memory to the user mode.the two things i missed were the output buffer i should take it from UserBuffer of the Irp structure and the other is make info zero

I hope i can use the address returned by "MmMapLockedPagesSpecifyCache" in the ISR
The idea is user thread writes to the above returned address and the driver in the ISR has to read the contents from this address

thank
sai