Sync with trunk r63270.
[reactos.git] / dll / win32 / browseui / precomp.h
1 #ifndef _BROWSEUI_PCH_
2 #define _BROWSEUI_PCH_
3
4 #include <stdarg.h>
5
6 #define WIN32_NO_STATUS
7 #define _INC_WINDOWS
8 #define COM_NO_WINDOWS_H
9
10 #include <windef.h>
11 #include <winbase.h>
12 #include <wincon.h>
13 #include <shlobj.h>
14 #include <tlogstg.h>
15 #include <shlobj_undoc.h>
16 #include <shlguid_undoc.h>
17 #include <shdeprecated.h>
18 #include <tchar.h>
19 #include <atlbase.h>
20 #include <atlcom.h>
21 #include <atlwin.h>
22 #include <perhist.h>
23 #include <exdispid.h>
24 #include <shlwapi.h>
25 #include <shlwapi_undoc.h>
26 #include <wine/debug.h>
27
28 #include "resource.h"
29
30 #include "aclmulti.h"
31 #include "addressband.h"
32 #include "addresseditbox.h"
33 #include "bandproxy.h"
34 #include "bandsite.h"
35 #include "bandsitemenu.h"
36 #include "brandband.h"
37 #include "internettoolbar.h"
38 #include "commonbrowser.h"
39 #include "globalfoldersettings.h"
40 #include "regtreeoptions.h"
41 #include <stdio.h>
42
43 static __inline ULONG
44 Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...)
45 {
46 char szMsg[512];
47 char *szMsgStart;
48 const char *fname;
49 va_list vl;
50 ULONG uRet;
51
52 fname = strrchr(filename, '\\');
53 if (fname == NULL)
54 {
55 fname = strrchr(filename, '/');
56 if (fname != NULL)
57 fname++;
58 }
59 else
60 fname++;
61
62 if (fname == NULL)
63 fname = filename;
64
65 szMsgStart = szMsg + sprintf(szMsg, "%s:%d: ", fname, line);
66
67 va_start(vl, lpFormat);
68 uRet = (ULONG) vsprintf(szMsgStart, lpFormat, vl);
69 va_end(vl);
70
71 OutputDebugStringA(szMsg);
72
73 return uRet;
74 }
75
76 #define DbgPrint(fmt, ...) \
77 Win32DbgPrint(__FILE__, __LINE__, fmt, ##__VA_ARGS__)
78
79 #if 1
80 #define FAILED_UNEXPECTEDLY(hr) (FAILED(hr) && (DbgPrint("Unexpected failure %08x.\n", hr), TRUE))
81 #else
82 #define FAILED_UNEXPECTEDLY(hr) FAILED(hr)
83 #endif
84
85 WINE_DEFAULT_DEBUG_CHANNEL(browseui);
86
87 #endif /* _BROWSEUI_PCH_ */