[RSHELL]
[reactos.git] / base / shell / rshell / precomp.h
1
2 #define USE_SYSTEM_MENUDESKBAR 0
3 #define USE_SYSTEM_MENUSITE 0
4 #define USE_SYSTEM_MENUBAND 0
5
6 #define WRAP_MENUDESKBAR 0
7 #define WRAP_MENUSITE 0
8 #define WRAP_MENUBAND 0
9 #define WRAP_TRAYPRIV 0
10
11 #define MERGE_FOLDERS 0
12
13 #include <stdio.h>
14 #include <tchar.h>
15
16 #define WIN32_NO_STATUS
17 #define _INC_WINDOWS
18 #define COM_NO_WINDOWS_H
19
20 #define COBJMACROS
21
22 #include <windef.h>
23 #include <winbase.h>
24 #include <winreg.h>
25 #include <wingdi.h>
26 #include <winnls.h>
27 #include <wincon.h>
28 #include <shellapi.h>
29 #include <shlobj.h>
30 #include <shlobj_undoc.h>
31 #include <shlwapi.h>
32 #include <shlguid_undoc.h>
33 #include <uxtheme.h>
34 #include <strsafe.h>
35
36 #include <atlbase.h>
37 #include <atlcom.h>
38 #include <wine/debug.h>
39
40 #define shell32_hInstance 0
41 #define SMC_EXEC 4
42 extern "C" INT WINAPI Shell_GetCachedImageIndex(LPCWSTR szPath, INT nIndex, UINT bSimulateDoc);
43
44
45 extern "C" HRESULT WINAPI CStartMenu_Constructor(REFIID riid, void **ppv);
46 extern "C" HRESULT WINAPI CMenuDeskBar_Constructor(REFIID riid, LPVOID *ppv);
47 extern "C" HRESULT WINAPI CMenuSite_Constructor(REFIID riid, LPVOID *ppv);
48 extern "C" HRESULT WINAPI CMenuBand_Constructor(REFIID riid, LPVOID *ppv);
49 extern "C" HRESULT WINAPI CMenuDeskBar_Wrapper(IDeskBar * db, REFIID riid, LPVOID *ppv);
50 extern "C" HRESULT WINAPI CMenuSite_Wrapper(IBandSite * bs, REFIID riid, LPVOID *ppv);
51 extern "C" HRESULT WINAPI CMenuBand_Wrapper(IShellMenu * sm, REFIID riid, LPVOID *ppv);
52 extern "C" HRESULT WINAPI CMergedFolder_Constructor(IShellFolder* userLocal, IShellFolder* allUsers, REFIID riid, LPVOID *ppv);
53 extern "C" HRESULT WINAPI CStartMenuSite_Wrapper(ITrayPriv * trayPriv, REFIID riid, LPVOID *ppv);
54
55 static __inline ULONG
56 Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...)
57 {
58 char szMsg[512];
59 char *szMsgStart;
60 const char *fname;
61 va_list vl;
62 ULONG uRet;
63
64 fname = strrchr(filename, '\\');
65 if (fname == NULL)
66 {
67 fname = strrchr(filename, '/');
68 }
69
70 if (fname == NULL)
71 fname = filename;
72 else
73 fname++;
74
75 szMsgStart = szMsg + sprintf(szMsg, "[%10d] %s:%d: ", GetTickCount(), fname, line);
76
77 va_start(vl, lpFormat);
78 uRet = (ULONG) vsprintf(szMsgStart, lpFormat, vl);
79 va_end(vl);
80
81 OutputDebugStringA(szMsg);
82
83 return uRet;
84 }
85
86 #define DbgPrint(fmt, ...) \
87 Win32DbgPrint(__FILE__, __LINE__, fmt, ##__VA_ARGS__)
88
89 #if 1
90 #define FAILED_UNEXPECTEDLY(hr) (FAILED(hr) && (DbgPrint("Unexpected failure %08x.\n", hr), TRUE))
91 #else
92 #define FAILED_UNEXPECTEDLY(hr) FAILED(hr)
93 #endif