ReactOS 0.4.16-dev-88-ga65b6ae
precomp.h File Reference
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <malloc.h>
#include <tchar.h>
#include <windef.h>
#include <winbase.h>
#include <winnls.h>
#include <winreg.h>
#include <winuser.h>
#include <wincon.h>
#include <shellapi.h>
#include <ndk/rtlfuncs.h>
#include <strsafe.h>
#include <conutils.h>
#include "resource.h"
#include "cmd.h"
#include "config.h"
#include "batch.h"
#include <wine/debug.h>
Include dependency graph for precomp.h:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 
#define NTOS_MODE_USER
 
#define debugstr_aw   debugstr_a
 
#define FIXME(fmt, ...)    CmdTrace(__WINE_DBCL_FIXME, __FILE__, __LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)
 
#define ERR(fmt, ...)    CmdTrace(__WINE_DBCL_ERR, __FILE__, __LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)
 
#define WARN(fmt, ...)    CmdTrace(__WINE_DBCL_WARN, __FILE__, __LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)
 
#define TRACE(fmt, ...)    CmdTrace(__WINE_DBCL_TRACE, __FILE__, __LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (cmd)
 
void CmdTrace (INT type, LPCSTR file, INT line, LPCSTR func, LPCSTR fmt,...)
 

Variables

BOOL g_bDynamicTrace
 

Macro Definition Documentation

◆ debugstr_aw

#define debugstr_aw   debugstr_a

Definition at line 44 of file precomp.h.

◆ ERR

#define ERR (   fmt,
  ... 
)     CmdTrace(__WINE_DBCL_ERR, __FILE__, __LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)

Definition at line 57 of file precomp.h.

◆ FIXME

#define FIXME (   fmt,
  ... 
)     CmdTrace(__WINE_DBCL_FIXME, __FILE__, __LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)

Definition at line 53 of file precomp.h.

◆ NTOS_MODE_USER

#define NTOS_MODE_USER

Definition at line 25 of file precomp.h.

◆ TRACE

#define TRACE (   fmt,
  ... 
)     CmdTrace(__WINE_DBCL_TRACE, __FILE__, __LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)

Definition at line 65 of file precomp.h.

◆ WARN

#define WARN (   fmt,
  ... 
)     CmdTrace(__WINE_DBCL_WARN, __FILE__, __LINE__, __FUNCTION__, fmt, ## __VA_ARGS__)

Definition at line 61 of file precomp.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 16 of file precomp.h.

Function Documentation

◆ CmdTrace()

void CmdTrace ( INT  type,
LPCSTR  file,
INT  line,
LPCSTR  func,
LPCSTR  fmt,
  ... 
)

Definition at line 15 of file trace.c.

16{
17 va_list va;
18 int cch;
19 char szTextA[800];
20#ifdef _UNICODE
21 wchar_t szTextW[800];
22#endif
23 static struct __wine_debug_functions s_Debug;
24
25 va_start(va, fmt);
26
27 /* Console output */
29 {
30 StringCchPrintfA(szTextA, _countof(szTextA), "%s (%d): ", file, line);
31 cch = lstrlenA(szTextA);
32 StringCchVPrintfA(&szTextA[cch], _countof(szTextA) - cch, fmt, va);
33
34#ifdef _UNICODE
35 MultiByteToWideChar(OutputCodePage, 0, szTextA, -1, szTextW, _countof(szTextW));
36 szTextW[_countof(szTextW) - 1] = UNICODE_NULL; /* Avoid buffer overrun */
37 ConOutPuts(szTextW);
38#else
39 ConOutPuts(szTextA);
40#endif
41 }
42
43 if (!s_Debug.dbg_vlog)
44 __wine_dbg_set_functions(NULL, &s_Debug, sizeof(s_Debug));
45
46 /* Debug logging */
47 switch (type)
48 {
50 if (__WINE_IS_DEBUG_ON(_FIXME, __wine_dbch___default))
51 s_Debug.dbg_vlog(__WINE_DBCL_FIXME, __wine_dbch___default, file, func, line, fmt, va);
52 break;
53 case __WINE_DBCL_ERR:
54 if (__WINE_IS_DEBUG_ON(_ERR, __wine_dbch___default))
55 s_Debug.dbg_vlog(__WINE_DBCL_ERR, __wine_dbch___default, file, func, line, fmt, va);
56 break;
58 if (__WINE_IS_DEBUG_ON(_WARN, __wine_dbch___default))
59 s_Debug.dbg_vlog(__WINE_DBCL_WARN, __wine_dbch___default, file, func, line, fmt, va);
60 break;
62 if (__WINE_IS_DEBUG_ON(_TRACE, __wine_dbch___default))
63 s_Debug.dbg_vlog(__WINE_DBCL_TRACE, __wine_dbch___default, file, func, line, fmt, va);
64 break;
65 default:
66 break;
67 }
68
69 va_end(va);
70}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
UINT OutputCodePage
Definition: console.c:26
#define ConOutPuts(szStr)
Definition: console.h:29
BOOL g_bDynamicTrace
Definition: trace.c:13
#define NULL
Definition: types.h:112
#define MultiByteToWideChar
Definition: compat.h:110
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLenum func
Definition: glext.h:6028
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
static DWORD DWORD void LPSTR DWORD cch
Definition: str.c:202
#define UNICODE_NULL
#define _WARN(msg)
Definition: debug.h:263
#define __WINE_IS_DEBUG_ON(dbcl, dbch)
Definition: debug.h:87
@ __WINE_DBCL_ERR
Definition: debug.h:52
@ __WINE_DBCL_TRACE
Definition: debug.h:54
@ __WINE_DBCL_FIXME
Definition: debug.h:51
@ __WINE_DBCL_WARN
Definition: debug.h:53
void __wine_dbg_set_functions(const struct __wine_debug_functions *new_funcs, struct __wine_debug_functions *old_funcs, size_t size)
Definition: debug.c:551
#define _countof(array)
Definition: sndvol32.h:70
STRSAFEAPI StringCchPrintfA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszFormat,...)
Definition: strsafe.h:520
STRSAFEAPI StringCchVPrintfA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszFormat, va_list argList)
Definition: strsafe.h:485
Definition: fci.c:127
Definition: dsound.c:943
Definition: parser.c:49

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( cmd  )

Variable Documentation

◆ g_bDynamicTrace

BOOL g_bDynamicTrace
extern

Definition at line 13 of file trace.c.

Referenced by cmd_set(), and CmdTrace().