用户层应用程序传递一个buffer给驱动层
驱动层在一个IRQL为 2的内核线程中,使用用户传递的buffer(需要该内存映射为NONPAGEPOOL)
我的操作是
NTSTATUS DispatchControl(PDEVICE_OBJECT fdo, PIRP Irp)
{
// ....
PMDL pmdl = Irp->MdlAddress;
PDEVICE_EXTENSION pdx = (PDEVICE_EXTENSION) fdo->DeviceExtension;
case IOCTL_TEST
PVOID pBuf = MmGetSystemAddressForMdlSafe(pmdl, NormalPagePriority);
//.........
pdx->lpUsrBuf = pBuf;
break;
default:
//.....
break;
}
//..................
//in the thread which property in IRQL is dispachlevel.
------解决方案--------------------
从字面上看,估计是IRQL没有控制好!