如何预处理缓冲区并通过
How to preprocess buffer and pass through
如何将请求发送到堆栈中的下一个驱动程序以进一步完成?
在我的过滤器驱动程序中,我使用回调 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 的事情,但为了请求。
抱歉,我是内核开发的新手,如果有人能指出我实现这一目标的正确方法,那就太好了。如有任何建议,我们将不胜感激。
在Windows-driver-samples exist huge count of examples how do Forwarding I/O Requests. take for example first simply code like in filter.c - here this done by FilterForwardRequest
or FilterForwardRequestWithCompletionRoutine
中-所以通常称为
WdfRequestSend(Request, WdfDeviceGetIoTarget(WdfIoQueueGetDevice(Queue)),WDF_NO_SEND_OPTIONS);
如何将请求发送到堆栈中的下一个驱动程序以进一步完成?
在我的过滤器驱动程序中,我使用回调 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 的事情,但为了请求。
抱歉,我是内核开发的新手,如果有人能指出我实现这一目标的正确方法,那就太好了。如有任何建议,我们将不胜感激。
在Windows-driver-samples exist huge count of examples how do Forwarding I/O Requests. take for example first simply code like in filter.c - here this done by FilterForwardRequest
or FilterForwardRequestWithCompletionRoutine
中-所以通常称为
WdfRequestSend(Request, WdfDeviceGetIoTarget(WdfIoQueueGetDevice(Queue)),WDF_NO_SEND_OPTIONS);