Last change
on this file since 1 was 1, checked in by vboxsync, 55 years ago |
import
|
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
1.7 KB
|
Line | |
---|
1 | /******************************Module*Header*******************************\
|
---|
2 | *
|
---|
3 | * *******************
|
---|
4 | * * GDI SAMPLE CODE *
|
---|
5 | * *******************
|
---|
6 | *
|
---|
7 | * Module Name: debug.c
|
---|
8 | *
|
---|
9 | * debug helpers routine
|
---|
10 | *
|
---|
11 | * Copyright (c) 1992-1998 Microsoft Corporation
|
---|
12 | *
|
---|
13 | \**************************************************************************/
|
---|
14 |
|
---|
15 | #include "driver.h"
|
---|
16 |
|
---|
17 | #ifdef LOG_ENABLED // #if DBG
|
---|
18 |
|
---|
19 | #ifdef VBOX
|
---|
20 | #include <VBox/log.h>
|
---|
21 | #endif
|
---|
22 |
|
---|
23 | ULONG DebugLevel = 0;
|
---|
24 |
|
---|
25 | /*****************************************************************************
|
---|
26 | *
|
---|
27 | * Routine Description:
|
---|
28 | *
|
---|
29 | * This function is variable-argument, level-sensitive debug print
|
---|
30 | * routine.
|
---|
31 | * If the specified debug level for the print statement is lower or equal
|
---|
32 | * to the current debug level, the message will be printed.
|
---|
33 | *
|
---|
34 | * Arguments:
|
---|
35 | *
|
---|
36 | * DebugPrintLevel - Specifies at which debugging level the string should
|
---|
37 | * be printed
|
---|
38 | *
|
---|
39 | * DebugMessage - Variable argument ascii c string
|
---|
40 | *
|
---|
41 | * Return Value:
|
---|
42 | *
|
---|
43 | * None.
|
---|
44 | *
|
---|
45 | ***************************************************************************/
|
---|
46 |
|
---|
47 | VOID
|
---|
48 | DebugPrint(
|
---|
49 | ULONG DebugPrintLevel,
|
---|
50 | PCHAR DebugMessage,
|
---|
51 | ...
|
---|
52 | )
|
---|
53 |
|
---|
54 | {
|
---|
55 |
|
---|
56 | va_list ap;
|
---|
57 |
|
---|
58 | va_start(ap, DebugMessage);
|
---|
59 |
|
---|
60 | #ifdef VBOX
|
---|
61 | RTLogBackdoorPrintfV(DebugMessage, ap);
|
---|
62 | #else
|
---|
63 | if (DebugPrintLevel <= DebugLevel)
|
---|
64 | {
|
---|
65 | EngDebugPrint(STANDARD_DEBUG_PREFIX, DebugMessage, ap);
|
---|
66 | }
|
---|
67 | #endif
|
---|
68 |
|
---|
69 | va_end(ap);
|
---|
70 |
|
---|
71 | }
|
---|
72 |
|
---|
73 | ULONG __cdecl DbgPrint(PCH pszFormat, ...)
|
---|
74 | {
|
---|
75 | va_list args;
|
---|
76 | va_start(args, pszFormat);
|
---|
77 | #ifdef VBOX
|
---|
78 | RTLogBackdoorPrintfV(pszFormat, args);
|
---|
79 | #else
|
---|
80 | EngDebugPrint(STANDARD_DEBUG_PREFIX, pszFormat, args);
|
---|
81 | #endif
|
---|
82 | va_end(args);
|
---|
83 | return 0;
|
---|
84 | }
|
---|
85 |
|
---|
86 | #endif
|
---|
87 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.