如何将请求发送到堆栈中的下一个驱动程序以进一步完成?
在我的过滤器驱动程序驱动程序中,我使用回调EvtDeviceIoWrite为EventWrite注册一个队列,如下所示:
VOID
EvtDeviceIoWrite(
IN WDFQUEUE Queue,
IN WDFREQUEST Request,
IN size_t Length
)
{
WDFMEMORY memory;
NTSTATUS status;
PUCHAR characters;
UCHAR currentChar;
UNREFERENCED_PARAMETER(Queue);
status = WdfRequestRetrieveInputMemory(Request, &memory);
if (!NT_SUCCESS(status)) {
KdPrint(("RetreiveInputMemo: failed 0x%x\n", status));
return;
}
characters = (PUCHAR)WdfMemoryGetBuffer(memory, NULL);
while (Length != 0) {
Length--;
currentChar = *(characters++);
// Here I would like to edit the buffer
// copy it to output buffer WdfMemoryCopyFromBuffer
}
**// what should be here for send**
}
我只想做this之类的事情,但是对于请求。
对不起,我是内核开发方面的新手,如果有人能指出我正确的方法来实现这一点,那将是非常棒的。任何sugestions将不胜感激。
答案 0 :(得分:0)
存在大量示例Forwarding I/O Requests。例如,首先简单地使用代码filter.c - 这里由FilterForwardRequest
或FilterForwardRequestWithCompletionRoutine
完成 - 因此通常称为
WdfRequestSend(Request, WdfDeviceGetIoTarget(WdfIoQueueGetDevice(Queue)),WDF_NO_SEND_OPTIONS);