4 * Copyright 2009 Andrew Hill <ash77 at domain reactos.org>
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.
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.
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
23 #include <shlobj_undoc.h>
25 #include <shlguid_undoc.h>
26 #include <shlwapi_undoc.h>
28 extern DWORD WINAPI
BrowserThreadProc(LPVOID lpThreadParameter
);
30 /*************************************************************************
31 * InitOCHostClass [BROWSEUI.101]
33 extern "C" void WINAPI
InitOCHostClass(long param8
)
35 // forwards to shdocvw
38 /*************************************************************************
39 * SHOpenFolderWindow [BROWSEUI.102]
41 extern "C" long WINAPI
SHOpenFolderWindow(IEThreadParamBlock
*param8
)
46 /*************************************************************************
47 * SHCreateSavedWindows [BROWSEUI.105]
48 * Called to recreate explorer windows from previous session
50 extern "C" void WINAPI
SHCreateSavedWindows()
54 /*************************************************************************
55 * SHCreateFromDesktop [BROWSEUI.106]
56 * parameter is a FolderInfo
58 extern "C" long WINAPI
SHCreateFromDesktop(long param8
)
63 /*************************************************************************
64 * SHExplorerParseCmdLine [BROWSEUI.107]
66 extern "C" long WINAPI
SHExplorerParseCmdLine(LPCTSTR commandLine
)
71 /*************************************************************************
72 * UEMRegisterNotify [BROWSEUI.118]
74 extern "C" void WINAPI
UEMRegisterNotify(long param8
, long paramC
)
78 /*************************************************************************
79 * SHCreateBandForPidl [BROWSEUI.120]
81 extern "C" HRESULT WINAPI
SHCreateBandForPidl(LPCITEMIDLIST param8
, IUnknown
*paramC
, BOOL param10
)
86 /*************************************************************************
87 * SHPidlFromDataObject [BROWSEUI.121]
89 extern "C" HRESULT WINAPI
SHPidlFromDataObject(IDataObject
*param8
, long *paramC
, long param10
, FILEDESCRIPTORW
*param14
)
94 /*************************************************************************
95 * IDataObject_GetDeskBandState [BROWSEUI.122]
97 extern "C" long WINAPI
IDataObject_GetDeskBandState(long param8
)
102 /*************************************************************************
103 * SHCreateIETHREADPARAM [BROWSEUI.123]
105 extern "C" IEThreadParamBlock
*WINAPI
SHCreateIETHREADPARAM(long param8
, long paramC
, IUnknown
*param10
, IUnknown
*param14
)
107 IEThreadParamBlock
*result
;
109 result
= (IEThreadParamBlock
*)LocalAlloc(LMEM_ZEROINIT
, 256);
112 result
->offset0
= param8
;
113 result
->offset8
= paramC
;
114 result
->offsetC
= param10
;
117 result
->offset14
= param14
;
123 /*************************************************************************
124 * SHCloneIETHREADPARAM [BROWSEUI.124]
126 extern "C" IEThreadParamBlock
*WINAPI
SHCloneIETHREADPARAM(IEThreadParamBlock
*param
)
128 IEThreadParamBlock
*result
;
130 result
= (IEThreadParamBlock
*)LocalAlloc(LMEM_FIXED
, 256);
133 memcpy(result
, param
, 0x40 * 4);
134 if (result
->directoryPIDL
!= NULL
)
135 result
->directoryPIDL
= ILClone(result
->directoryPIDL
);
136 if (result
->offset7C
!= NULL
)
137 result
->offset7C
= ILClone(result
->offset7C
);
138 if (result
->offset80
!= NULL
)
139 result
->offset80
= ILClone(result
->offset80
);
140 if (result
->offset70
!= NULL
)
141 result
->offset70
->AddRef();
143 if (result
->offsetC
!= NULL
)
144 result
->offsetC
->Method2C();
149 /*************************************************************************
150 * SHParseIECommandLine [BROWSEUI.125]
152 extern "C" long WINAPI
SHParseIECommandLine(long param8
, long paramC
)
157 /*************************************************************************
158 * SHDestroyIETHREADPARAM [BROWSEUI.126]
160 extern "C" void WINAPI
SHDestroyIETHREADPARAM(IEThreadParamBlock
*param
)
164 if (param
->directoryPIDL
!= NULL
)
165 ILFree(param
->directoryPIDL
);
166 if (param
->offset7C
!= NULL
)
167 ILFree(param
->offset7C
);
168 if ((param
->offset4
& 0x80000) == 0 && param
->offset80
!= NULL
)
169 ILFree(param
->offset80
);
170 if (param
->offset14
!= NULL
)
171 param
->offset14
->Release();
172 if (param
->offset70
!= NULL
)
173 param
->offset70
->Release();
174 if (param
->offset78
!= NULL
)
175 param
->offset78
->Release();
176 if (param
->offsetC
!= NULL
)
177 param
->offsetC
->Release();
178 if (param
->offsetF8
!= NULL
)
179 param
->offsetF8
->Release();
183 /*************************************************************************
184 * SHOnCWMCommandLine [BROWSEUI.127]
186 extern "C" HRESULT WINAPI
SHOnCWMCommandLine(long param8
)
191 /*************************************************************************
192 * Channel_GetFolderPidl [BROWSEUI.128]
194 extern "C" LPITEMIDLIST WINAPI
Channel_GetFolderPidl()
199 /*************************************************************************
200 * ChannelBand_Create [BROWSEUI.129]
202 extern "C" IUnknown
*WINAPI
ChannelBand_Create(LPITEMIDLIST pidl
)
207 /*************************************************************************
208 * Channels_SetBandInfoSFB [BROWSEUI.130]
210 extern "C" HRESULT WINAPI
Channels_SetBandInfoSFB(IUnknown
*param8
)
215 /*************************************************************************
216 * IUnknown_SetBandInfoSFB [BROWSEUI.131]
218 extern "C" HRESULT WINAPI
IUnknown_SetBandInfoSFB(IUnknown
*param8
, long paramC
)
223 /*************************************************************************
224 * Channel_QuickLaunch [BROWSEUI.133]
226 extern "C" HRESULT WINAPI
Channel_QuickLaunch()
231 /*************************************************************************
232 * SHGetNavigateTarget [BROWSEUI.134]
234 extern "C" HRESULT WINAPI
SHGetNavigateTarget(long param8
, long paramC
, long param10
, long param14
)
239 /*************************************************************************
240 * GetInfoTip [BROWSEUI.135]
242 extern "C" HRESULT WINAPI
GetInfoTip(IUnknown
*param8
, long paramC
, LPTSTR
*param10
, long cchMax
)
247 /*************************************************************************
248 * SHEnumClassesOfCategories [BROWSEUI.136]
250 extern "C" HRESULT WINAPI
SHEnumClassesOfCategories(long param8
, long paramC
, long param10
, long param14
, long param18
)
255 /*************************************************************************
256 * SHWriteClassesOfCategories [BROWSEUI.137]
258 extern "C" HRESULT WINAPI
SHWriteClassesOfCategories(long param8
, long paramC
, long param10
, long param14
, long param18
, long param1C
, long param20
)
263 /*************************************************************************
264 * SHIsExplorerBrowser [BROWSEUI.138]
266 extern "C" BOOL WINAPI
SHIsExplorerBrowser()
273 // this function should handle creating a new process if needed, but I'm leaving that out for now
274 // this function always opens a new window - it does NOT check for duplicates
275 /*************************************************************************
276 * SHOpenNewFrame [BROWSEUI.103]
278 extern "C" HRESULT WINAPI
SHOpenNewFrame(LPITEMIDLIST pidl
, IUnknown
*paramC
, long param10
, long param14
)
280 IEThreadParamBlock
*parameters
;
284 parameters
= SHCreateIETHREADPARAM(0, 1, paramC
, NULL
);
285 if (parameters
== NULL
)
288 return E_OUTOFMEMORY
;
291 parameters
->offset10
= param10
;
292 parameters
->directoryPIDL
= pidl
;
293 parameters
->offset4
= param14
;
294 threadHandle
= CreateThread(NULL
, 0x10000, BrowserThreadProc
, parameters
, 0, &threadID
);
295 if (threadHandle
!= NULL
)
297 CloseHandle(threadHandle
);
300 SHDestroyIETHREADPARAM(parameters
);