diff options
author | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
---|---|---|
committer | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
commit | e611b132f9b8abe35b362e5870b74bce94a1e58e (patch) | |
tree | a5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/ntos/ndis/htdsu/debug.c | |
download | NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2 NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip |
Diffstat (limited to 'private/ntos/ndis/htdsu/debug.c')
-rw-r--r-- | private/ntos/ndis/htdsu/debug.c | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/private/ntos/ndis/htdsu/debug.c b/private/ntos/ndis/htdsu/debug.c new file mode 100644 index 000000000..846e51737 --- /dev/null +++ b/private/ntos/ndis/htdsu/debug.c @@ -0,0 +1,112 @@ +/***************************************************************************\ +|* Copyright (c) 1994 Microsoft Corporation *| +|* Developed for Microsoft by TriplePoint, Inc. Beaverton, Oregon *| +|* *| +|* This file is part of the HT Communications DSU41 WAN Miniport Driver. *| +\***************************************************************************/ +#include "version.h" +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Module Name: + + debug.c + +Abstract: + + This module contains code to support driver debugging. + +Author: + + Larry Hattery - TriplePoint, Inc. (larryh@tpi.com) Jun-94 + +Environment: + + Development only. + +Revision History: + +---------------------------------------------------------------------------*/ + +#include <ndis.h> + +#if DBG + + +VOID +DbgPrintData( + IN PUCHAR Data, + IN UINT NumBytes, + IN ULONG Offset + ) + +/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Routine Description: + + Dumps data to the debug display formated in hex and ascii for easy viewing. + Used for debug output only. It is not compiled into the retail version. + +Arguments: + + Data Buffer of data to be displayed + + NumBytes Number of bytes to display + + Offset Beginning offset to be displayed before each line + +Return Value: + + None + +---------------------------------------------------------------------------*/ + +{ + UINT i,j; + + for (i = 0; i < NumBytes; i += 16) + { + DbgPrint("%04lx: ", i + Offset); + + /* + // Output the hex bytes + */ + for (j = i; j < (i+16); j++) + { + if (j < NumBytes) + { + DbgPrint("%02x ",(UINT)((UCHAR)*(Data+j))); + } + else + { + DbgPrint(" "); + } + } + + DbgPrint(" "); + + /* + // Output the ASCII bytes + */ + for (j = i; j < (i+16); j++) + { + if (j < NumBytes) + { + char c = *(Data+j); + + if (c < ' ' || c > 'Z') + { + c = '.'; + } + DbgPrint("%c", (UINT)c); + } + else + { + DbgPrint(" "); + } + } + DbgPrint("\n"); + } +} + +#endif + |