mirror of https://github.com/lianthony/NT4.0
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
112 lines
2.4 KiB
112 lines
2.4 KiB
/***************************************************************************\
|
|
|* 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. ([email protected]) 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
|
|
|