1 /*
2  * ReactOS shlwapi
3  *
4  * Copyright 2009 Andrew Hill <ash77 at domain reactos.org>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20 
21 #ifndef __BROWSEUI_UNDOC_H
22 #define __BROWSEUI_UNDOC_H
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif /* defined(__cplusplus) */
27 
28 #define FCW_ADDRESSBAR 9 // GetControlWindow/IsControlWindowShown
29 
30 // Name is IETHREADPARAM according to symbols / mangled function names
31 #ifdef _WIN64
32 typedef struct IEThreadParamBlock
33 {
34     long                            offset0;  // 0x00
35     UCHAR gap4[4];
36     DWORD                   dwFlags;          // 0x08
37     long                            offset8;  // 0x0c
38     IUnknown*                       offsetC;  // 0x10
39     long                            offset10; // 0x18
40     char padding1[4];                         // 0x1c
41     IUnknown*                       offset14; // 0x20
42     LPITEMIDLIST            directoryPIDL;    // 0x28
43     WCHAR awsz_30[21];                        // 0x30
44     WCHAR awszEventName[21];                  // 0x5A
45     char padding2[4];                         // 0x84
46     IUnknown*                       offset70; // 0x88
47     long                            offset74; // 0x90 unknown contents
48     char padding3[4];                         // 0x94
49     IUnknown*                       offset78; // 0x98
50     LPITEMIDLIST                    offset7C; // 0xa0
51     LPITEMIDLIST                    offset80; // 0xa8
52     LONG                            offset84; // 0xb0
53     LONG                            offset88; // 0xb4
54     LONG                            offset8C; // 0xb8
55     LONG                            offset90; // 0xbc
56     LONG                            offset94; // 0xc0
57     LONG                            offset98; // 0xc4
58     LONG                            offset9C; // 0xc8
59     LONG                            offsetA0; // 0xcc
60     char field_B4[52];
61     LONG                            offsetD8; // 0x104
62     UCHAR gap108[24];
63     DWORD dword120;
64     DWORD dword124;
65     IUnknown*                       pExplorerInstance; // 0x128 instance explorer
66     UCHAR byteflags_130;
67 } IE_THREAD_PARAM_BLOCK, * PIE_THREAD_PARAM_BLOCK;
68 #else
69 typedef struct IEThreadParamBlock
70 {
71     long                            offset0;
72     DWORD                   dwFlags;
73     long                            offset8;
74     IUnknown                      * offsetC;
75     long                            offset10;
76     IUnknown                      * offset14;
77     LPITEMIDLIST            directoryPIDL;      // 0x18
78     char                            offset1C[0x70-0x1C];    // unknown contents -- 0x1C..0x6c
79     IUnknown                      * offset70;
80     long                            offset74;        // unknown contents
81     IUnknown                      * offset78;
82     LPITEMIDLIST                    offset7C;
83     LPITEMIDLIST                    offset80;
84     LONG                            offset84;
85     LONG                            offset88;
86     LONG                            offset8C;
87     LONG                            offset90;
88     LONG                            offset94;
89     LONG                            offset98;
90     LONG                            offset9C;
91     LONG                            offsetA0;
92     char                            offsetA4[0xD8-0xA4];    // unknown contents -- 0xA4..0xD8
93     LONG                            offsetD8;
94     char                            offsetDC[0xF8-0xDC];    // unknown contents -- 0xDC..0xF8
95     IUnknown                      * pExplorerInstance;        // instance explorer
96     LONG                            offsetFC;        // unknown contents
97 } IE_THREAD_PARAM_BLOCK, *PIE_THREAD_PARAM_BLOCK;
98 #endif
99 
100 typedef struct ExplorerCommandLineParseResults
101 {
102     LPWSTR                  strPath;
103     // TODO: PIDLIST_ABSOLUTE?
104     LPITEMIDLIST            pidlPath;
105     DWORD                   dwFlags;
106     int                     nCmdShow;
107     DWORD                   offset10_18;
108     DWORD                   offset14_1C;
109     DWORD                   offset18_20;
110     DWORD                   offset1C_24;
111     // TODO: PIDLIST_ABSOLUTE?
112     LPITEMIDLIST            pidlRoot;
113     CLSID                   clsid;
114     GUID                    guidInproc;
115     // TODO: 'ULONG                   Padding[0x100];'?
116 } EXPLORER_CMDLINE_PARSE_RESULTS, *PEXPLORER_CMDLINE_PARSE_RESULTS;
117 
118 #define SH_EXPLORER_CMDLINE_FLAG_NEWWND   0x00000001
119 #define SH_EXPLORER_CMDLINE_FLAG_S        0x00000002
120 // unknown/unused                         0x00000004
121 #define SH_EXPLORER_CMDLINE_FLAG_E        0x00000008
122 // unknown/unused                         0x00000010
123 // unknown/unused                         0x00000020
124 #define SH_EXPLORER_CMDLINE_FLAG_SELECT   0x00000040
125 #define SH_EXPLORER_CMDLINE_FLAG_EMBED    0x00000080
126 // unknown/unused                         0x00000100
127 #define SH_EXPLORER_CMDLINE_FLAG_IDLIST   0x00000200
128 #define SH_EXPLORER_CMDLINE_FLAG_INPROC   0x00000400
129 // unknown/unused                         0x00000800
130 #define SH_EXPLORER_CMDLINE_FLAG_NOUI     0x00001000
131 // unknown/unused                         0x00002000
132 #define SH_EXPLORER_CMDLINE_FLAG_NOREUSE  0x00004000 // Don't use IShellWindows
133 // unknown/unused                         0x00008000
134 // unknown/unused                         0x00010000
135 #define SH_EXPLORER_CMDLINE_FLAG_SEPARATE 0x00020000
136 // unknown/unused                         0x00040000
137 // unknown/unused                         0x00080000
138 // unknown/unused                         0x00100000
139 // unknown/unused                         0x00200000
140 // unknown/unused                         0x00400000
141 // unknown/unused                         0x00800000
142 // unknown/unused                         0x01000000
143 #define SH_EXPLORER_CMDLINE_FLAG_STRING   0x02000000
144 
145 #define WM_EXPLORER_OPEN_NEW_WINDOW (WM_USER+11)
146 #define WM_EXPLORER_1037 (WM_USER+13)
147 
148 void WINAPI InitOCHostClass(long param8);
149 long WINAPI SHOpenFolderWindow(PIE_THREAD_PARAM_BLOCK parameters);
150 void WINAPI SHCreateSavedWindows(void);
151 BOOL WINAPI SHCreateFromDesktop(_In_ PEXPLORER_CMDLINE_PARSE_RESULTS parseResults);
152 UINT_PTR WINAPI SHExplorerParseCmdLine(_Out_ PEXPLORER_CMDLINE_PARSE_RESULTS pInfo);
153 void WINAPI UEMRegisterNotify(long param8, long paramC);
154 HRESULT WINAPI SHCreateBandForPidl(LPCITEMIDLIST param8, IUnknown *paramC, BOOL param10);
155 HRESULT WINAPI SHPidlFromDataObject(IDataObject *param8, long *paramC, long param10, FILEDESCRIPTORW *param14);
156 long WINAPI IDataObject_GetDeskBandState(long param8);
157 PIE_THREAD_PARAM_BLOCK WINAPI SHCreateIETHREADPARAM(long param8, long paramC, IUnknown *param10, IUnknown *param14);
158 PIE_THREAD_PARAM_BLOCK WINAPI SHCloneIETHREADPARAM(PIE_THREAD_PARAM_BLOCK param);
159 long WINAPI SHParseIECommandLine(long param8, long paramC);
160 void WINAPI SHDestroyIETHREADPARAM(PIE_THREAD_PARAM_BLOCK param);
161 BOOL WINAPI SHOnCWMCommandLine(HANDLE hSharedInfo);
162 LPITEMIDLIST WINAPI Channel_GetFolderPidl(void);
163 IUnknown *WINAPI ChannelBand_Create(LPITEMIDLIST pidl);
164 HRESULT WINAPI Channels_SetBandInfoSFB(IUnknown *param8);
165 HRESULT WINAPI IUnknown_SetBandInfoSFB(IUnknown *param8, long paramC);
166 HRESULT WINAPI Channel_QuickLaunch(void);
167 HRESULT WINAPI SHGetNavigateTarget(long param8, long paramC, long param10, long param14);
168 HRESULT WINAPI GetInfoTip(IUnknown *param8, long paramC, LPTSTR *param10, long cchMax);
169 HRESULT WINAPI SHEnumClassesOfCategories(ULONG cImplemented, CATID *pImplemented, ULONG cRequired, CATID *pRequired, IEnumGUID **out);
170 HRESULT WINAPI SHWriteClassesOfCategories(long param8, long paramC, long param10, long param14, long param18, long param1C, long param20);
171 BOOL WINAPI SHIsExplorerBrowser(void);
172 HRESULT WINAPI SHOpenNewFrame(LPITEMIDLIST pidl, IUnknown *paramC, long param10, DWORD dwFlags);
173 
174 
175 #define INTERFACE IACLCustomMRU
176 DECLARE_INTERFACE_IID_(IACLCustomMRU, IUnknown, "F729FC5E-8769-4F3E-BDB2-D7B50FD2275B")
177 {
178     // *** IUnknown methods ***
179     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE;
180     STDMETHOD_(ULONG, AddRef) (THIS)PURE;
181     STDMETHOD_(ULONG, Release) (THIS)PURE;
182 
183     // *** IACLCustomMRU specific methods ***
184     STDMETHOD(Initialize) (THIS_ LPCWSTR pwszMRURegKey, DWORD dwMax) PURE;
185     STDMETHOD(AddMRUString) (THIS_ LPCWSTR pwszEntry) PURE;
186 };
187 #undef INTERFACE
188 
189 #ifdef __cplusplus
190 } /* extern "C" */
191 #endif /* defined(__cplusplus) */
192 
193 #endif /* __BROWSEUI_UNDOC_H */
194