我正在编写一个驱动程序,通过注册EvtIoDeviceControl来侦听特定设备上的请求。
DF_IO_QUEUE_CONFIG_INIT_DEFAULT_QUEUE(&IoCallbacks, WdfIoQueueDispatchParallel);
IoCallbacks.PowerManaged = WdfFalse;
IoCallbacks.EvtIoDeviceControl = EvtIoDeviceControlCallback;在Windows10 (KMDF 1.21)上,我可以使用WdfRequestGetRequestorProcessId来获取EvtIoDeviceControlCallback中发出请求的进程的进程ID,但是我很难找到一种方法来完成这一早期版本的KMDF。有洞察力吗?
发布于 2018-01-19 15:42:46
您可以使用WdfRequestWdmGetIrp (最小KMDF版本1.0)和IoGetRequestorProcessId
所以简单地使用
ULONG WdfRequestGetRequestorProcessId_1_0(WDFREQUEST Request)
{
return IoGetRequestorProcessId(WdfRequestWdmGetIrp(Request));
}https://stackoverflow.com/questions/48344217
复制相似问题