Annotation of ntddk/src/input/sermouse/debug.c, revision 1.1

1.1     ! root        1: /*++
        !             2: 
        !             3: Copyright (c) 1993  Microsoft Corporation
        !             4: Copyright (c) 1993  Logitech Inc.
        !             5: 
        !             6: Module Name:
        !             7: 
        !             8:     debug.c
        !             9: 
        !            10: Abstract:
        !            11: 
        !            12:     Debugging support routines.
        !            13: 
        !            14: Environment:
        !            15: 
        !            16:     Kernel mode only.
        !            17: 
        !            18: Notes:
        !            19: 
        !            20: Revision History:
        !            21: 
        !            22: --*/
        !            23: 
        !            24: #include "stdarg.h"
        !            25: #include "stdio.h"
        !            26: #include "string.h"
        !            27: #include "ntddk.h"
        !            28: #include "debug.h"
        !            29: 
        !            30: 
        !            31: #if DBG
        !            32: //
        !            33: // Declare the global debug flag for this driver.
        !            34: //
        !            35: 
        !            36: ULONG SerialMouseDebug = 0;
        !            37: 
        !            38: //
        !            39: // Undocumented call (prototype).
        !            40: // Use it to avoid timing problems and conflicts with the serial device. 
        !            41: // This call is valid only during initialization and before the display 
        !            42: // driver takes ownership of the display.
        !            43: //
        !            44: 
        !            45: VOID HalDisplayString(PSZ Buffer);
        !            46: 
        !            47: static ULONG DebugOutput = DBG_SERIAL;
        !            48: 
        !            49: VOID
        !            50: _SerMouSetDebugOutput(
        !            51:     IN ULONG Destination
        !            52:     )
        !            53: /*++
        !            54: 
        !            55: Routine Description:
        !            56: 
        !            57:    Set the destination of the debugging string. The options are:
        !            58:        DBG_COLOR:    Main computer screen.
        !            59:        DBG_SERIAL:   Serial debugger port
        !            60: 
        !            61:    Note: The output to the DBG_COLOR screen can be used only during 
        !            62:    initilialization before we switch to graphical mode.
        !            63: 
        !            64: Arguments:
        !            65: 
        !            66:     Destination - The debugging string destination.
        !            67: 
        !            68: Return Value:
        !            69: 
        !            70:     None.
        !            71: 
        !            72: --*/
        !            73: {
        !            74:     DebugOutput = Destination;
        !            75:     return;
        !            76: }
        !            77: 
        !            78: int
        !            79: _SerMouGetDebugOutput(
        !            80:     VOID
        !            81:     )
        !            82: /*++
        !            83: 
        !            84: Routine Description:
        !            85: 
        !            86:     Get the current debugger string output destination.
        !            87: 
        !            88: Arguments:
        !            89: 
        !            90:     None.
        !            91: 
        !            92: Return Value:
        !            93: 
        !            94:     Current debugging output destination.
        !            95: 
        !            96: --*/
        !            97: {
        !            98:     return DebugOutput;
        !            99: }
        !           100: 
        !           101: VOID
        !           102: SerMouDebugPrint(
        !           103:     ULONG DebugPrintLevel,
        !           104:     PCSZ DebugMessage,
        !           105:     ...
        !           106:     )
        !           107: 
        !           108: /*++
        !           109: 
        !           110: Routine Description:
        !           111: 
        !           112:     Debug print routine.
        !           113: 
        !           114: Arguments:
        !           115: 
        !           116:     Debug print level between 0 and 3, with 3 being the most verbose.
        !           117: 
        !           118: Return Value:
        !           119: 
        !           120:     None.
        !           121: 
        !           122: --*/
        !           123: 
        !           124: {
        !           125:     va_list ap;
        !           126: 
        !           127:     va_start(ap, DebugMessage);
        !           128: 
        !           129:     if (DebugPrintLevel <= SerialMouseDebug) {
        !           130: 
        !           131:         CHAR buffer[128];
        !           132: 
        !           133:         (VOID) vsprintf(buffer, DebugMessage, ap);
        !           134: 
        !           135:         if (DebugOutput & DBG_SERIAL) {
        !           136:             DbgPrint(buffer);
        !           137:         }
        !           138: 
        !           139:         if (DebugOutput & DBG_COLOR) {
        !           140:             HalDisplayString(buffer);
        !           141:         }
        !           142:     }
        !           143: 
        !           144:     va_end(ap);
        !           145: 
        !           146: }
        !           147: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.