Sample Code

Windows Driver Samples/ Serial Port Driver/ C++/ error.c/

/*++
Copyright (c) Microsoft Corporation

Module Name:

    error.c

Abstract:

    This module contains the code that is very specific to error
    operations in the serial driver

Environment:

    Kernel mode

--*/

#include "precomp.h"

#if defined(EVENT_TRACING)
#include "error.tmh"
#endif


VOID
SerialCommError(
    IN WDFDPC Dpc
    )
/*++

Routine Description:

    This routine is invoked at dpc level to in response to
    a comm error.  All comm errors complete all read and writes

Arguments:


Return Value:

    None.

--*/
{
    PSERIAL_DEVICE_EXTENSION Extension = NULL;

    Extension = SerialGetDeviceExtension(WdfDpcGetParentObject(Dpc));

    SerialDbgPrintEx(TRACE_LEVEL_INFORMATION, DBG_INIT,
                     ">SerialCommError(%p)\n", Extension);

    SerialFlushRequests(
        Extension->WriteQueue,
        &Extension->CurrentWriteRequest
        );

    SerialFlushRequests(
        Extension->ReadQueue,
        &Extension->CurrentReadRequest
        );

    SerialDbgPrintEx(TRACE_LEVEL_INFORMATION, DBG_INIT,
                     "<SerialCommError\n");
}


Our Services

  • What our customers say about us?

© 2011-2024 All Rights Reserved. Joya Systems. 4425 South Mopac Building II Suite 101 Austin, TX 78735 Tel: 800-DEV-KERNEL

Privacy Policy. Terms of use. Valid XHTML & CSS