shdocvw: Get rid of Mozilla ActiveX control dependency.
[wine/dcerpc.git] / dlls / shdocvw / shdocvw_main.c
blob57b49931ed4f439c0447e46299af507fd22cb143
1 /*
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
22 #include "config.h"
24 #include <stdarg.h>
25 #include <stdio.h>
27 #include "wine/unicode.h"
28 #include "wine/debug.h"
30 #include "shdocvw.h"
32 #include "winreg.h"
33 #include "shlwapi.h"
35 #include "initguid.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
39 LONG SHDOCVW_refCount = 0;
41 HINSTANCE shdocvw_hinstance = 0;
42 static HMODULE SHDOCVW_hshell32 = 0;
44 /*************************************************************************
45 * SHDOCVW DllMain
47 BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID fImpLoad)
49 TRACE("%p 0x%lx %p\n", hinst, fdwReason, fImpLoad);
50 switch (fdwReason)
52 case DLL_PROCESS_ATTACH:
53 shdocvw_hinstance = hinst;
54 register_iewindow_class();
55 break;
56 case DLL_PROCESS_DETACH:
57 if (SHDOCVW_hshell32) FreeLibrary(SHDOCVW_hshell32);
58 unregister_iewindow_class();
59 break;
61 return TRUE;
64 /*************************************************************************
65 * DllCanUnloadNow (SHDOCVW.@)
67 HRESULT WINAPI DllCanUnloadNow(void)
69 return SHDOCVW_refCount ? S_FALSE : S_OK;
72 /***********************************************************************
73 * DllGetVersion (SHDOCVW.@)
75 HRESULT WINAPI DllGetVersion(DLLVERSIONINFO *info)
77 if (info->cbSize != sizeof(DLLVERSIONINFO)) FIXME("support DLLVERSIONINFO2\n");
79 /* this is what IE6 on Windows 98 reports */
80 info->dwMajorVersion = 6;
81 info->dwMinorVersion = 0;
82 info->dwBuildNumber = 2600;
83 info->dwPlatformID = DLLVER_PLATFORM_WINDOWS;
85 return NOERROR;
88 /*************************************************************************
89 * DllInstall (SHDOCVW.@)
91 HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline)
93 FIXME("(%s, %s): stub!\n", bInstall ? "TRUE":"FALSE", debugstr_w(cmdline));
95 return S_OK;
98 /*************************************************************************
99 * SHDOCVW_LoadShell32
101 * makes sure the handle to shell32 is valid
103 BOOL SHDOCVW_LoadShell32(void)
105 if (SHDOCVW_hshell32)
106 return TRUE;
107 return ((SHDOCVW_hshell32 = LoadLibraryA("shell32.dll")) != NULL);
110 /***********************************************************************
111 * @ (SHDOCVW.110)
113 * Called by Win98 explorer.exe main binary, definitely has 0
114 * parameters.
116 DWORD WINAPI WinList_Init(void)
118 FIXME("(), stub!\n");
119 return 0x0deadfeed;
122 /***********************************************************************
123 * @ (SHDOCVW.118)
125 * Called by Win98 explorer.exe main binary, definitely has only one
126 * parameter.
128 static BOOL (WINAPI *pShellDDEInit)(BOOL start) = NULL;
130 BOOL WINAPI ShellDDEInit(BOOL start)
132 TRACE("(%d)\n", start);
134 if (!pShellDDEInit)
136 if (!SHDOCVW_LoadShell32())
137 return FALSE;
138 pShellDDEInit = GetProcAddress(SHDOCVW_hshell32, (LPCSTR)188);
141 if (pShellDDEInit)
142 return pShellDDEInit(start);
143 else
144 return FALSE;
147 /***********************************************************************
148 * @ (SHDOCVW.125)
150 * Called by Win98 explorer.exe main binary, definitely has 0
151 * parameters.
153 DWORD WINAPI RunInstallUninstallStubs(void)
155 FIXME("(), stub!\n");
156 return 0x0deadbee;
159 /***********************************************************************
160 * SetQueryNetSessionCount (SHDOCVW.@)
162 DWORD WINAPI SetQueryNetSessionCount(DWORD arg)
164 FIXME("(%lu), stub!\n", arg);
165 return 0;
168 /**********************************************************************
169 * OpenURL (SHDOCVW.@)
171 void WINAPI OpenURL(HWND hWnd, HINSTANCE hInst, LPCSTR lpcstrUrl, int nShowCmd)
173 FIXME("%p %p %s %d\n", hWnd, hInst, debugstr_a(lpcstrUrl), nShowCmd);
176 /**********************************************************************
177 * Some forwards (by ordinal) to SHLWAPI
180 static void* fetch_shlwapi_ordinal(unsigned ord)
182 static const WCHAR shlwapiW[] = {'s','h','l','w','a','p','i','.','d','l','l','\0'};
183 static HANDLE h;
185 if (!h && !(h = GetModuleHandleW(shlwapiW))) return NULL;
186 return (void*)GetProcAddress(h, (const char*)ord);
189 /******************************************************************
190 * WhichPlatformFORWARD (SHDOCVW.@)
192 DWORD WINAPI WhichPlatformFORWARD(void)
194 static DWORD (*WINAPI p)(void);
196 if (p || (p = fetch_shlwapi_ordinal(276))) return p();
197 return 1; /* not integrated, see shlwapi.WhichPlatform */
200 /******************************************************************
201 * StopWatchModeFORWARD (SHDOCVW.@)
203 void WINAPI StopWatchModeFORWARD(void)
205 static void (*WINAPI p)(void);
207 if (p || (p = fetch_shlwapi_ordinal(241))) p();
210 /******************************************************************
211 * StopWatchFlushFORWARD (SHDOCVW.@)
213 void WINAPI StopWatchFlushFORWARD(void)
215 static void (*WINAPI p)(void);
217 if (p || (p = fetch_shlwapi_ordinal(242))) p();
220 /******************************************************************
221 * StopWatchWFORWARD (SHDOCVW.@)
223 DWORD WINAPI StopWatchWFORWARD(DWORD dwClass, LPCWSTR lpszStr, DWORD dwUnknown,
224 DWORD dwMode, DWORD dwTimeStamp)
226 static DWORD (*WINAPI p)(DWORD, LPCWSTR, DWORD, DWORD, DWORD);
228 if (p || (p = fetch_shlwapi_ordinal(243)))
229 return p(dwClass, lpszStr, dwUnknown, dwMode, dwTimeStamp);
230 return ERROR_CALL_NOT_IMPLEMENTED;
233 /******************************************************************
234 * StopWatchAFORWARD (SHDOCVW.@)
236 DWORD WINAPI StopWatchAFORWARD(DWORD dwClass, LPCSTR lpszStr, DWORD dwUnknown,
237 DWORD dwMode, DWORD dwTimeStamp)
239 static DWORD (*WINAPI p)(DWORD, LPCSTR, DWORD, DWORD, DWORD);
241 if (p || (p = fetch_shlwapi_ordinal(244)))
242 return p(dwClass, lpszStr, dwUnknown, dwMode, dwTimeStamp);
243 return ERROR_CALL_NOT_IMPLEMENTED;