wdf 似乎没有 IoMarkIrpPending ,不过好像可以用 WdfRequestForwardToIoQueue 代替。
Newbie question about correct handling for pendingrequests
Hi again!
After digging through all the documentation and a fewsamples I'm still not sure
if my queue/request handling is correct or
maybe has a flaw that will show up sooner or later...
In my KMDF driver I currently have one (sequential) queuefor read and write
requests and one manual
queue for pending read requests. (Writes will alwayssucceed!)
All synchronization and execution levels are left attheir default values.
Now my question:
In my read event handler I simply forward the request (ifI cannot fulfill it
immediately) like this:
status = WdfRequestForwardToIoQueue(Request,pDevContext->PendingReadQueue);
In my write handler - after having written to my memoryI'm looping over the
pending request queue like this:
// Check forpending reads... and move them to main queue
do
{
WDFREQUESTrequest;
status =WdfIoQueueRetrieveNextRequest(pDevContext->PendingReadQueue,
&request);
// Found anentry?
if(NT_SUCCESS(status))
{
status= WdfRequestForwardToIoQueue(request,
pDevContext->ReadQueue);
if(!NT_SUCCESS(status))
{
WdfRequestCompleteWithInformation(request, STATUS_UNSUCCESSFUL,
0);
return;
}
}
}
while(NT_SUCCESS(status));
Now my question: Although this works fine so far I'd liketo ensure that this is
a correct approach or if
someone sees future problems with this code?
本文深入探讨了在KMDF驱动中处理读写请求的方法,包括请求的前向传递和待处理请求队列的管理。通过具体代码示例展示了如何正确地将无法立即满足的请求前向传递到待处理队列,并在完成写操作后重新调度这些请求。讨论了当前实现的优缺点,旨在确保请求处理的高效性和可靠性。
1188

被折叠的 条评论
为什么被折叠?



