Last change
on this file since 11814 was 11814, checked in by vboxsync, 16 years ago |
Initial commit of the NetFlt driver for Windows
|
-
Property svn:eol-style
set to
native
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
1.8 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
|
---|
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 | #endif
|
---|
74 |
|
---|
75 | ULONG __cdecl DbgPrint(PCH pszFormat, ...)
|
---|
76 | {
|
---|
77 | #ifdef LOG_ENABLED
|
---|
78 | va_list args;
|
---|
79 | va_start(args, pszFormat);
|
---|
80 | # ifdef VBOX
|
---|
81 | RTLogBackdoorPrintfV(pszFormat, args);
|
---|
82 | # else
|
---|
83 | EngDebugPrint(STANDARD_DEBUG_PREFIX, pszFormat, args);
|
---|
84 | # endif
|
---|
85 | va_end(args);
|
---|
86 | #endif
|
---|
87 | return 0;
|
---|
88 | }
|
---|
89 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.