Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[serial/VirtualSerial2] Line 176 in serial/VirtualSerial2/queue.c should be removed #1202

Closed
aspist opened this issue Aug 5, 2024 · 0 comments
Assignees
Labels

Comments

@aspist
Copy link

aspist commented Aug 5, 2024

NTSTATUS
RequestCopyToBuffer(
    _In_  WDFREQUEST        Request,
    _In_  PVOID             DestinationBuffer,
    _In_  size_t            NumBytesToCopyTo
    )
{
    NTSTATUS                status;
    WDFMEMORY               memory;

    status = WdfRequestRetrieveInputMemory(Request, &memory);
    if( !NT_SUCCESS(status) ) {
        Trace(TRACE_LEVEL_ERROR,
            "Error: WdfRequestRetrieveInputMemory failed 0x%x", status);
        return status;
    }

    status = WdfMemoryCopyToBuffer(memory, 0,
                            DestinationBuffer, NumBytesToCopyTo);
    if( !NT_SUCCESS(status) ) {
        Trace(TRACE_LEVEL_ERROR,
            "Error: WdfMemoryCopyToBuffer failed 0x%x", status);
        return status;
    }

    WdfRequestSetInformation(Request, NumBytesToCopyTo);
    return status;
}

“WdfRequestSetInformation(Request, NumBytesToCopyTo);” should be removed because RequestCopyToBuffer doesn‘t write the output buffer of irp。

@NeoAdonis NeoAdonis added the bug label Aug 15, 2024
@NeoAdonis NeoAdonis changed the title Line 176 in serial/VirtualSerial2/queue.c should be removed [serial/VirtualSerial2] Line 176 in serial/VirtualSerial2/queue.c should be removed Aug 15, 2024
wm1 added a commit that referenced this issue Aug 16, 2024
@wm1 wm1 closed this as completed Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants