0

如何将请求发送到堆栈中的下一个驱动程序以进一步完成?

在我的过滤器驱动程序中,我使用回调 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** 
}

我只想做这样事情,但为了请求。

抱歉,我是内核开发的新手,如果有人能指出实现这一目标的正确方法,那将是非常棒的。任何建议将不胜感激。

4

1 回答 1

0

Windows-driver-samples 中存在大量示例如何转发 I/O 请求。以首先简单的代码为例,例如filter.c - 这里由FilterForwardRequestor完成FilterForwardRequestWithCompletionRoutine- 通常称为

WdfRequestSend(Request, WdfDeviceGetIoTarget(WdfIoQueueGetDevice(Queue)),WDF_NO_SEND_OPTIONS);
于 2017-02-02T01:16:59.733 回答