2 * SHDOCVW - Internet Explorer Web Control
4 * Copyright 2001 John R. Sheets (for CodeWeavers)
5 * Copyright 2004 Mike McCormack (for CodeWeavers)
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #include "wine/unicode.h"
28 #include "wine/debug.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
39 LONG SHDOCVW_refCount = 0;
41 HINSTANCE shdocvw_hinstance = 0;
42 static HMODULE SHDOCVW_hshell32 = 0;
43 static ITypeInfo *wb_typeinfo = NULL;
45 HRESULT get_typeinfo(ITypeInfo **typeinfo)
51 *typeinfo = wb_typeinfo;
55 hres = LoadRegTypeLib(&LIBID_SHDocVw, 1, 1, LOCALE_SYSTEM_DEFAULT, &typelib);
57 ERR("LoadRegTypeLib failed: %08x\n", hres);
61 hres = ITypeLib_GetTypeInfoOfGuid(typelib, &IID_IWebBrowser2, &wb_typeinfo);
62 ITypeLib_Release(typelib);
64 *typeinfo = wb_typeinfo;
68 /*************************************************************************
71 BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID fImpLoad)
73 TRACE("%p 0x%x %p\n", hinst, fdwReason, fImpLoad);
76 case DLL_PROCESS_ATTACH:
77 shdocvw_hinstance = hinst;
78 register_iewindow_class();
80 case DLL_PROCESS_DETACH:
81 if (SHDOCVW_hshell32) FreeLibrary(SHDOCVW_hshell32);
82 unregister_iewindow_class();
84 ITypeInfo_Release(wb_typeinfo);
90 /*************************************************************************
91 * DllCanUnloadNow (SHDOCVW.@)
93 HRESULT WINAPI DllCanUnloadNow(void)
95 return SHDOCVW_refCount ? S_FALSE : S_OK;
98 /***********************************************************************
99 * DllGetVersion (SHDOCVW.@)
101 HRESULT WINAPI DllGetVersion(DLLVERSIONINFO *info)
103 if (info->cbSize != sizeof(DLLVERSIONINFO)) FIXME("support DLLVERSIONINFO2\n");
105 /* this is what IE6 on Windows 98 reports */
106 info->dwMajorVersion = 6;
107 info->dwMinorVersion = 0;
108 info->dwBuildNumber = 2600;
109 info->dwPlatformID = DLLVER_PLATFORM_WINDOWS;
114 /*************************************************************************
115 * DllInstall (SHDOCVW.@)
117 HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline)
119 FIXME("(%s, %s): stub!\n", bInstall ? "TRUE":"FALSE", debugstr_w(cmdline));
124 /*************************************************************************
125 * SHDOCVW_LoadShell32
127 * makes sure the handle to shell32 is valid
129 static BOOL SHDOCVW_LoadShell32(void)
131 if (SHDOCVW_hshell32)
133 return ((SHDOCVW_hshell32 = LoadLibraryA("shell32.dll")) != NULL);
136 /***********************************************************************
139 * Called by Win98 explorer.exe main binary, definitely has 0
142 DWORD WINAPI WinList_Init(void)
144 FIXME("(), stub!\n");
148 /***********************************************************************
151 * Called by Win98 explorer.exe main binary, definitely has only one
154 static BOOL (WINAPI *pShellDDEInit)(BOOL start) = NULL;
156 BOOL WINAPI ShellDDEInit(BOOL start)
158 TRACE("(%d)\n", start);
162 if (!SHDOCVW_LoadShell32())
164 pShellDDEInit = (void *)GetProcAddress(SHDOCVW_hshell32, (LPCSTR)188);
168 return pShellDDEInit(start);
173 /***********************************************************************
176 * Called by Win98 explorer.exe main binary, definitely has 0
179 DWORD WINAPI RunInstallUninstallStubs(void)
181 FIXME("(), stub!\n");
185 /***********************************************************************
186 * SetQueryNetSessionCount (SHDOCVW.@)
188 DWORD WINAPI SetQueryNetSessionCount(DWORD arg)
190 FIXME("(%u), stub!\n", arg);
194 /**********************************************************************
195 * OpenURL (SHDOCVW.@)
197 void WINAPI OpenURL(HWND hWnd, HINSTANCE hInst, LPCSTR lpcstrUrl, int nShowCmd)
199 FIXME("%p %p %s %d\n", hWnd, hInst, debugstr_a(lpcstrUrl), nShowCmd);
202 /**********************************************************************
203 * Some forwards (by ordinal) to SHLWAPI
206 static void* fetch_shlwapi_ordinal(unsigned ord)
208 static const WCHAR shlwapiW[] = {'s','h','l','w','a','p','i','.','d','l','l','\0'};
211 if (!h && !(h = GetModuleHandleW(shlwapiW))) return NULL;
212 return (void*)GetProcAddress(h, (const char*)ord);
215 /******************************************************************
216 * WhichPlatformFORWARD (SHDOCVW.@)
218 DWORD WINAPI WhichPlatformFORWARD(void)
220 static DWORD (WINAPI *p)(void);
222 if (p || (p = fetch_shlwapi_ordinal(276))) return p();
223 return 1; /* not integrated, see shlwapi.WhichPlatform */
226 /******************************************************************
227 * StopWatchModeFORWARD (SHDOCVW.@)
229 void WINAPI StopWatchModeFORWARD(void)
231 static void (WINAPI *p)(void);
233 if (p || (p = fetch_shlwapi_ordinal(241))) p();
236 /******************************************************************
237 * StopWatchFlushFORWARD (SHDOCVW.@)
239 void WINAPI StopWatchFlushFORWARD(void)
241 static void (WINAPI *p)(void);
243 if (p || (p = fetch_shlwapi_ordinal(242))) p();
246 /******************************************************************
247 * StopWatchWFORWARD (SHDOCVW.@)
249 DWORD WINAPI StopWatchWFORWARD(DWORD dwClass, LPCWSTR lpszStr, DWORD dwUnknown,
250 DWORD dwMode, DWORD dwTimeStamp)
252 static DWORD (WINAPI *p)(DWORD, LPCWSTR, DWORD, DWORD, DWORD);
254 if (p || (p = fetch_shlwapi_ordinal(243)))
255 return p(dwClass, lpszStr, dwUnknown, dwMode, dwTimeStamp);
256 return ERROR_CALL_NOT_IMPLEMENTED;
259 /******************************************************************
260 * StopWatchAFORWARD (SHDOCVW.@)
262 DWORD WINAPI StopWatchAFORWARD(DWORD dwClass, LPCSTR lpszStr, DWORD dwUnknown,
263 DWORD dwMode, DWORD dwTimeStamp)
265 static DWORD (WINAPI *p)(DWORD, LPCSTR, DWORD, DWORD, DWORD);
267 if (p || (p = fetch_shlwapi_ordinal(244)))
268 return p(dwClass, lpszStr, dwUnknown, dwMode, dwTimeStamp);
269 return ERROR_CALL_NOT_IMPLEMENTED;