[BROWSEUI]
[reactos.git] / dll / win32 / browseui / browseuiord.cpp
1 /*
2 * ReactOS browseui
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 #include "precomp.h"
22
23 extern DWORD WINAPI BrowserThreadProc(LPVOID lpThreadParameter);
24
25 /*************************************************************************
26 * InitOCHostClass [BROWSEUI.101]
27 */
28 extern "C" void WINAPI InitOCHostClass(long param8)
29 {
30 // forwards to shdocvw
31 }
32
33 /*************************************************************************
34 * SHOpenFolderWindow [BROWSEUI.102]
35 */
36 extern "C" long WINAPI SHOpenFolderWindow(IEThreadParamBlock *param8)
37 {
38 return 0;
39 }
40
41 /*************************************************************************
42 * SHCreateSavedWindows [BROWSEUI.105]
43 * Called to recreate explorer windows from previous session
44 */
45 extern "C" void WINAPI SHCreateSavedWindows()
46 {
47 }
48
49 /*************************************************************************
50 * SHCreateFromDesktop [BROWSEUI.106]
51 * parameter is a FolderInfo
52 */
53 extern "C" long WINAPI SHCreateFromDesktop(long param8)
54 {
55 return -1;
56 }
57
58 /*************************************************************************
59 * SHExplorerParseCmdLine [BROWSEUI.107]
60 */
61 extern "C" long WINAPI SHExplorerParseCmdLine(LPCTSTR commandLine)
62 {
63 return -1;
64 }
65
66 /*************************************************************************
67 * UEMRegisterNotify [BROWSEUI.118]
68 */
69 extern "C" void WINAPI UEMRegisterNotify(long param8, long paramC)
70 {
71 }
72
73 /*************************************************************************
74 * SHCreateBandForPidl [BROWSEUI.120]
75 */
76 extern "C" HRESULT WINAPI SHCreateBandForPidl(LPCITEMIDLIST param8, IUnknown *paramC, BOOL param10)
77 {
78 return E_NOTIMPL;
79 }
80
81 /*************************************************************************
82 * SHPidlFromDataObject [BROWSEUI.121]
83 */
84 extern "C" HRESULT WINAPI SHPidlFromDataObject(IDataObject *param8, long *paramC, long param10, FILEDESCRIPTORW *param14)
85 {
86 return E_NOTIMPL;
87 }
88
89 /*************************************************************************
90 * IDataObject_GetDeskBandState [BROWSEUI.122]
91 */
92 extern "C" long WINAPI IDataObject_GetDeskBandState(long param8)
93 {
94 return -1;
95 }
96
97 /*************************************************************************
98 * SHCreateIETHREADPARAM [BROWSEUI.123]
99 */
100 extern "C" IEThreadParamBlock *WINAPI SHCreateIETHREADPARAM(
101 long param8, long paramC, IUnknown *param10, IUnknown *param14)
102 {
103 IEThreadParamBlock *result;
104
105 result = (IEThreadParamBlock *)LocalAlloc(LMEM_ZEROINIT, 256);
106 if (result == NULL)
107 return NULL;
108 result->offset0 = param8;
109 result->offset8 = paramC;
110 result->offsetC = param10;
111 if (param10 != NULL)
112 param10->AddRef();
113 result->offset14 = param14;
114 if (param14 != NULL)
115 param14->AddRef();
116 return result;
117 }
118
119 /*************************************************************************
120 * SHCloneIETHREADPARAM [BROWSEUI.124]
121 */
122 extern "C" IEThreadParamBlock *WINAPI SHCloneIETHREADPARAM(IEThreadParamBlock *param)
123 {
124 IEThreadParamBlock *result;
125
126 result = (IEThreadParamBlock *)LocalAlloc(LMEM_FIXED, 256);
127 if (result == NULL)
128 return NULL;
129 memcpy(result, param, 0x40 * 4);
130 if (result->directoryPIDL != NULL)
131 result->directoryPIDL = ILClone(result->directoryPIDL);
132 if (result->offset7C != NULL)
133 result->offset7C = ILClone(result->offset7C);
134 if (result->offset80 != NULL)
135 result->offset80 = ILClone(result->offset80);
136 if (result->offset70 != NULL)
137 result->offset70->AddRef();
138 #if 0
139 if (result->offsetC != NULL)
140 result->offsetC->Method2C();
141 #endif
142 return result;
143 }
144
145 /*************************************************************************
146 * SHParseIECommandLine [BROWSEUI.125]
147 */
148 extern "C" long WINAPI SHParseIECommandLine(long param8, long paramC)
149 {
150 return -1;
151 }
152
153 /*************************************************************************
154 * SHDestroyIETHREADPARAM [BROWSEUI.126]
155 */
156 extern "C" void WINAPI SHDestroyIETHREADPARAM(IEThreadParamBlock *param)
157 {
158 if (param == NULL)
159 return;
160 if (param->directoryPIDL != NULL)
161 ILFree(param->directoryPIDL);
162 if (param->offset7C != NULL)
163 ILFree(param->offset7C);
164 if ((param->offset4 & 0x80000) == 0 && param->offset80 != NULL)
165 ILFree(param->offset80);
166 if (param->offset14 != NULL)
167 param->offset14->Release();
168 if (param->offset70 != NULL)
169 param->offset70->Release();
170 if (param->offset78 != NULL)
171 param->offset78->Release();
172 if (param->offsetC != NULL)
173 param->offsetC->Release();
174 if (param->offsetF8 != NULL)
175 param->offsetF8->Release();
176 LocalFree(param);
177 }
178
179 /*************************************************************************
180 * SHOnCWMCommandLine [BROWSEUI.127]
181 */
182 extern "C" HRESULT WINAPI SHOnCWMCommandLine(long param8)
183 {
184 return E_NOTIMPL;
185 }
186
187 /*************************************************************************
188 * Channel_GetFolderPidl [BROWSEUI.128]
189 */
190 extern "C" LPITEMIDLIST WINAPI Channel_GetFolderPidl()
191 {
192 return NULL;
193 }
194
195 /*************************************************************************
196 * ChannelBand_Create [BROWSEUI.129]
197 */
198 extern "C" IUnknown *WINAPI ChannelBand_Create(LPITEMIDLIST pidl)
199 {
200 return NULL;
201 }
202
203 /*************************************************************************
204 * Channels_SetBandInfoSFB [BROWSEUI.130]
205 */
206 extern "C" HRESULT WINAPI Channels_SetBandInfoSFB(IUnknown *param8)
207 {
208 return E_NOTIMPL;
209 }
210
211 /*************************************************************************
212 * IUnknown_SetBandInfoSFB [BROWSEUI.131]
213 */
214 extern "C" HRESULT WINAPI IUnknown_SetBandInfoSFB(IUnknown *param8, long paramC)
215 {
216 return E_NOTIMPL;
217 }
218
219 /*************************************************************************
220 * Channel_QuickLaunch [BROWSEUI.133]
221 */
222 extern "C" HRESULT WINAPI Channel_QuickLaunch()
223 {
224 return E_NOTIMPL;
225 }
226
227 /*************************************************************************
228 * SHGetNavigateTarget [BROWSEUI.134]
229 */
230 extern "C" HRESULT WINAPI SHGetNavigateTarget(long param8, long paramC, long param10, long param14)
231 {
232 return E_NOTIMPL;
233 }
234
235 /*************************************************************************
236 * GetInfoTip [BROWSEUI.135]
237 */
238 extern "C" HRESULT WINAPI GetInfoTip(IUnknown *param8, long paramC, LPTSTR *param10, long cchMax)
239 {
240 return E_NOTIMPL;
241 }
242
243 /*************************************************************************
244 * SHEnumClassesOfCategories [BROWSEUI.136]
245 */
246 extern "C" HRESULT WINAPI SHEnumClassesOfCategories(long param8, long paramC, long param10, long param14, long param18)
247 {
248 return E_NOTIMPL;
249 }
250
251 /*************************************************************************
252 * SHWriteClassesOfCategories [BROWSEUI.137]
253 */
254 extern "C" HRESULT WINAPI SHWriteClassesOfCategories(long param8, long paramC, long param10,
255 long param14, long param18, long param1C, long param20)
256 {
257 return E_NOTIMPL;
258 }
259
260 /*************************************************************************
261 * SHIsExplorerBrowser [BROWSEUI.138]
262 */
263 extern "C" BOOL WINAPI SHIsExplorerBrowser()
264 {
265 return TRUE;
266 }
267
268 // 75FA56C1h
269 // (pidl, 0, -1, 1)
270 // this function should handle creating a new process if needed, but I'm leaving that out for now
271 // this function always opens a new window - it does NOT check for duplicates
272 /*************************************************************************
273 * SHOpenNewFrame [BROWSEUI.103]
274 */
275 extern "C" HRESULT WINAPI SHOpenNewFrame(LPITEMIDLIST pidl, IUnknown *paramC, long param10, long param14)
276 {
277 IEThreadParamBlock *parameters;
278 HANDLE threadHandle;
279 DWORD threadID;
280
281 parameters = SHCreateIETHREADPARAM(0, 1, paramC, NULL);
282 if (parameters == NULL)
283 {
284 ILFree(pidl);
285 return E_OUTOFMEMORY;
286 }
287 if (paramC != NULL)
288 parameters->offset10 = param10;
289 parameters->directoryPIDL = pidl;
290 parameters->offset4 = param14;
291 threadHandle = CreateThread(NULL, 0x10000, BrowserThreadProc, parameters, 0, &threadID);
292 if (threadHandle != NULL)
293 {
294 CloseHandle(threadHandle);
295 return S_OK;
296 }
297 SHDestroyIETHREADPARAM(parameters);
298 return E_FAIL;
299 }