[CPLS]
[reactos.git] / reactos / dll / cpl / appwiz / appwiz.h
1 #ifndef _APPWIZ_H
2 #define _APPWIZ_H
3
4 #include <config.h>
5 #include <wine/port.h>
6
7 #include <stdarg.h>
8
9 #define WIN32_NO_STATUS
10 #define _INC_WINDOWS
11 #define COM_NO_WINDOWS_H
12
13 #define COBJMACROS
14
15 #include <windef.h>
16 #include <winbase.h>
17 #include <winreg.h>
18 #include <winnls.h>
19 #include <shlobj.h>
20
21 #include <wine/debug.h>
22 WINE_DEFAULT_DEBUG_CHANNEL(appwiz);
23
24 #include "resource.h"
25
26 typedef struct
27 {
28 WCHAR szTarget[MAX_PATH];
29 WCHAR szWorkingDirectory[MAX_PATH];
30 WCHAR szDescription[MAX_PATH];
31 WCHAR szLinkName[MAX_PATH];
32 } CREATE_LINK_CONTEXT, *PCREATE_LINK_CONTEXT;
33
34 extern HINSTANCE hApplet;
35
36 /* createlink.c */
37 INT_PTR CALLBACK
38 WelcomeDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
39
40 INT_PTR CALLBACK
41 FinishDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
42
43 LONG CALLBACK
44 NewLinkHere(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2);
45
46 void ShowLastWin32Error(HWND hWndOwner);
47
48 typedef enum {
49 ADDON_GECKO,
50 ADDON_MONO
51 } addon_t;
52
53 BOOL install_addon(addon_t) DECLSPEC_HIDDEN;
54
55 extern HINSTANCE hInst DECLSPEC_HIDDEN;
56
57 static inline void *heap_alloc(size_t len)
58 {
59 return HeapAlloc(GetProcessHeap(), 0, len);
60 }
61
62 static inline void *heap_realloc(void *mem, size_t len)
63 {
64 return HeapReAlloc(GetProcessHeap(), 0, mem, len);
65 }
66
67 static inline BOOL heap_free(void *mem)
68 {
69 return HeapFree(GetProcessHeap(), 0, mem);
70 }
71
72 static inline WCHAR *heap_strdupAtoW(const char *str)
73 {
74 WCHAR *ret = NULL;
75
76 if(str) {
77 size_t len;
78
79 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
80 ret = heap_alloc(len*sizeof(WCHAR));
81 if(ret)
82 MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
83 }
84
85 return ret;
86 }
87
88 #endif /* _APPWIZ_H */