summaryrefslogtreecommitdiffstats
path: root/private/unimodem/mdmdbg/debug.h
blob: 49517c2e97ae5de11f477cf9dfe98f6581e34c77 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
//****************************************************************************
//
//  Module:     Unimdm
//  File:       debug.h
//  Content:    This file contains the declaration for debug macros
//
//  Copyright (c) 1992-1996, Microsoft Corporation, all rights reserved
//
//  History:
//
//****************************************************************************

// Defines for rovcomm.h

#define NORTL
#define NOMEM
#define NODA
#define NOSHAREDHEAP
#define NOFILEINFO
#define NOCOLORHELP
#define NODRAWTEXT
#define NODIALOGHELPER
#define NOMESSAGESTRING
#define NOSTRING
#define NOPATH
#define NOSYNC
#define NODI

#define SZ_MODULEA      "MDMDBG"
#define SZ_MODULEW      L##"MDMDBG"
#define SZ_DEBUGSECTION L##"UNIMDM"
#define SZ_DEBUGINI     L##"unimdm.ini"

#include <rovcomm.h>

// Trace flags
#define TF_DWDEVICEID       0x00010000
#define TF_HDLINE           0x00020000
#define TF_HDCALL           0x00040000
#define TF_PLINEDEV         0x00080000
#define TF_PMODEMINFO       0x00100000

// Traditional DPRINTF defines


#define DPRINTF(sz)                 TRACE_MSG(TF_GENERAL, sz)
#define DPRINTF1(sz,x)              TRACE_MSG(TF_GENERAL, sz, x)
#define DPRINTF2(sz,x,y)            TRACE_MSG(TF_GENERAL, sz, x, y)
#define DPRINTF3(sz,x,y,z)          TRACE_MSG(TF_GENERAL, sz, x, y, z)
#define DPRINTF4(sz,w,x,y,z)        TRACE_MSG(TF_GENERAL, sz, w, x, y, z)
#define DPRINTF5(sz,w,x,y,z,a)      TRACE_MSG(TF_GENERAL, sz, w, x, y, z, a)
#define DPRINTF6(sz,w,x,y,z,a,b)    TRACE_MSG(TF_GENERAL, sz, w, x, y, z, a, b)

#define DPRINTFA(sz)                 TRACE_MSGA(TF_GENERAL, sz)
#define DPRINTFA1(sz,x)              TRACE_MSGA(TF_GENERAL, sz, x)
#define DPRINTFA2(sz,x,y)            TRACE_MSGA(TF_GENERAL, sz, x, y)
#define DPRINTFA3(sz,x,y,z)          TRACE_MSGA(TF_GENERAL, sz, x, y, z)
#define DPRINTFA4(sz,w,x,y,z)        TRACE_MSGA(TF_GENERAL, sz, w, x, y, z)

#define SPTrace(x)  DBG_ENTER(x)

// Supplementary debug print macros

#define DBG_DDI_ENTER(fn)                     \
    TRACE_MSG(TF_FUNC | TF_DWDEVICEID,        \
              ">" fn "(dwDeviceID = %#08lx)", \
              (ULONG)(dwDeviceID))

#define DBG_HDL_ENTER(fn)                 \
    TRACE_MSG(TF_FUNC | TF_HDLINE,        \
              ">" fn "(hdLine = %#08lx)", \
              (ULONG)(hdLine))

#define DBG_HDC_ENTER(fn)                 \
    TRACE_MSG(TF_FUNC | TF_HDCALL,        \
              ">" fn "(hdCall = %#08lx)", \
              (ULONG)(hdCall))

#define DBG_PLD_ENTER(fn)                   \
    TRACE_MSG(TF_FUNC | TF_PLINEDEV,        \
              ">" fn "(pLineDev = %#08lx)", \
              (ULONG)(pLineDev))

#define DBG_PMI_ENTER(fn)                     \
    TRACE_MSG(TF_FUNC | TF_PMODEMINFO,        \
              ">" fn "(pModemInfo = %#08lx)", \
              (ULONG)(pModemInfo))

#define DBG_DDI_EXIT(fn, ul)                              \
    TRACE_MSG(TF_FUNC | TF_DWDEVICEID,                    \
              "<" fn "(dwDeviceID = %#08lx) with %#08lx", \
              (ULONG)(dwDeviceID), (ULONG)(ul))

#define DBG_HDL_EXIT(fn, ul)                          \
    TRACE_MSG(TF_FUNC | TF_HDLINE,                    \
              "<" fn "(hdLine = %#08lx) with %#08lx", \
              (ULONG)(hdLine), (ULONG)(ul))

#define DBG_HDC_EXIT(fn, ul)                          \
    TRACE_MSG(TF_FUNC | TF_HDCALL,                    \
              "<" fn "(hdCall = %#08lx) with %#08lx", \
              (ULONG)(hdCall), (ULONG)(ul))

#define DBG_PLD_EXIT(fn, ul)                            \
    TRACE_MSG(TF_FUNC | TF_PLINEDEV,                    \
              "<" fn "(pLineDev = %#08lx) with %#08lx", \
              (ULONG)(pLineDev), (ULONG)(ul))

#define DBG_PMI_EXIT(fn, ul)                              \
    TRACE_MSG(TF_FUNC | TF_PMODEMINFO,                    \
              "<" fn "(pModemInfo = %#08lx) with %#08lx", \
              (ULONG)(pModemInfo), (ULONG)(ul))

// Debug Messages
//
#ifdef DEBUG

#define D_TRACE(_x) {_x}


#else

#define D_TRACE(_x)


#endif //ifdef DEBUG