summaryrefslogtreecommitdiffstats
path: root/private/unimodem/tapisp/debug.h
blob: f007231600ea87c7ec1ee8d99569567f068125b6 (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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
//****************************************************************************
//
//  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      "UNIMDM"
#define SZ_MODULEW      L##"UNIMDM"
#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 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

// LineEventProc spewing code.
void DebugSetEventProc(LINEEVENT lineEventProc);
void CALLBACK DebugEventProc(HTAPILINE   htLine,
                             HTAPICALL   htCall,
                             DWORD       dwMsg,
                             DWORD       dwParam1,
                             DWORD       dwParam2,
                             DWORD       dwParam3);

HLOCAL WINAPI DebugLocalFree(HLOCAL hMem);

#define LocalFree(hMem) DebugLocalFree(hMem)

// Non-Unicode
VOID WINAPIV
McxDpf(
    UINT     Id,
    LPSTR   FormatString,
    ...
    );

// Unicode
VOID WINAPIV
TspDpf(
    UINT     Id,
    LPTSTR   FormatString,
    ...
    );


#define D_TRACE(_x) {_x}

#define MCXPRINTF(sz)          McxDpf(pModemInfo->mi_dwID, sz)
#define MCXPRINTF1(sz,x)       McxDpf(pModemInfo->mi_dwID, sz,x)
#define MCXPRINTF2(sz,x,y)     McxDpf(pModemInfo->mi_dwID, sz,x,y)
#define MCXPRINTF3(sz,x,y,z)   McxDpf(pModemInfo->mi_dwID, sz,x,y,z)
#define MCXPRINTF4(sz,w,x,y,z) McxDpf(pModemInfo->mi_dwID, sz,w,x,y,z)

#define TSPPRINTF(sz)          TspDpf(pLineDev->dwID, TEXT(sz))
#define TSPPRINTF1(sz,x)       TspDpf(pLineDev->dwID, TEXT(sz),x)
#define TSPPRINTF2(sz,x,y)     TspDpf(pLineDev->dwID, TEXT(sz),x,y)
#define TSPPRINTF3(sz,x,y,z)   TspDpf(pLineDev->dwID, TEXT(sz),x,y,z)
#define TSPPRINTF4(sz,w,x,y,z) TspDpf(pLineDev->dwID, TEXT(sz),w,x,y,z)




#else

#define D_TRACE(_x)

#define MCXPRINTF(sz)
#define MCXPRINTF1(sz,x)
#define MCXPRINTF2(sz,x,y)
#define MCXPRINTF3(sz,x,y,z)
#define MCXPRINTF4(sz,w,x,y,z)

#define TSPPRINTF(sz)
#define TSPPRINTF1(sz,x)
#define TSPPRINTF2(sz,x,y)
#define TSPPRINTF3(sz,x,y,z)
#define TSPPRINTF4(sz,w,x,y,z)




#endif //ifdef DEBUG