summaryrefslogtreecommitdiff
path: root/tests/projects/windows/driver/kmdf/serial/error.c
diff options
context:
space:
mode:
authorruki <[email protected]>2021-12-07 23:23:40 +0800
committerruki <[email protected]>2021-12-07 23:23:40 +0800
commitb3ae4feec5afe623183d92f8f3f9f0347f6abaea (patch)
tree7c011f929a2902aeec3c56a31949c3755b367b5c /tests/projects/windows/driver/kmdf/serial/error.c
parent9d19f1a747c0ebf692fbeca25a78f41b7fcd55e3 (diff)
add linux driver example
Diffstat (limited to 'tests/projects/windows/driver/kmdf/serial/error.c')
-rw-r--r--tests/projects/windows/driver/kmdf/serial/error.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/tests/projects/windows/driver/kmdf/serial/error.c b/tests/projects/windows/driver/kmdf/serial/error.c
new file mode 100644
index 000000000..904e54b05
--- /dev/null
+++ b/tests/projects/windows/driver/kmdf/serial/error.c
@@ -0,0 +1,67 @@
+/*++
+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");
+}
+
+