3f14fd1eb0e10b4e84a06381a6a19c18a61463f8
[reactos.git] / dll / win32 / stobject / precomp.h
1 #pragma once
2
3 #define WIN32_NO_STATUS
4 #include <stdarg.h>
5 #include <tchar.h>
6
7 #define COBJMACROS
8 #define WIN32_NO_STATUS
9 #define _INC_WINDOWS
10 #define COM_NO_WINDOWS_H
11 #define NTOS_MODE_USER
12
13 #include <windef.h>
14 #include <winbase.h>
15 #include <winreg.h>
16 #include <winuser.h>
17 #include <wincon.h>
18 #include <ddeml.h>
19 #include <shlguid_undoc.h>
20 #include <shlwapi.h>
21 #include <shlobj.h>
22 #include <shlobj_undoc.h>
23 #include <shlwapi_undoc.h>
24 #include <tchar.h>
25 #include <strsafe.h>
26 #include <atlbase.h>
27 #include <atlcom.h>
28
29 #include <wine/debug.h>
30 #include <wine/unicode.h>
31
32 extern const GUID CLSID_SysTray;
33
34 #include "resource.h"
35
36 static __inline ULONG
37 Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...)
38 {
39 char szMsg[512];
40 char *szMsgStart;
41 const char *fname;
42 va_list vl;
43 ULONG uRet;
44
45 fname = strrchr(filename, '\\');
46 if (fname == NULL)
47 {
48 fname = strrchr(filename, '/');
49 }
50
51 if (fname == NULL)
52 fname = filename;
53 else
54 fname++;
55
56 szMsgStart = szMsg + sprintf(szMsg, "[%10lu] %s:%d: ", GetTickCount(), fname, line);
57
58 va_start(vl, lpFormat);
59 uRet = (ULONG) vsprintf(szMsgStart, lpFormat, vl);
60 va_end(vl);
61
62 OutputDebugStringA(szMsg);
63
64 return uRet;
65 }
66
67 #define DbgPrint(fmt, ...) \
68 Win32DbgPrint(__FILE__, __LINE__, fmt, ##__VA_ARGS__)
69
70 #if 1
71 #define FAILED_UNEXPECTEDLY(hr) (FAILED(hr) && (DbgPrint("Unexpected failure %08x.\n", hr), TRUE))
72 #else
73 #define FAILED_UNEXPECTEDLY(hr) FAILED(hr)
74 #endif
75