Move include/bitmaps/*.xpm where they belong.
[wine] / dlls / shdocvw / shdocvw_main.c
1 /*
2  * SHDOCVW - Internet Explorer Web Control
3  *
4  * Copyright 2001 John R. Sheets (for CodeWeavers)
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 #define COM_NO_WINDOWS_H
22 #include <stdarg.h>
23 #include <string.h>
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winreg.h"
27 #include "winuser.h"
28 #include "ole2.h"
29 #include "shlwapi.h"
30
31 #include "shdocvw.h"
32 #include "wine/debug.h"
33
34 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
35
36 HINSTANCE shdocvw_hinstance = 0;
37 HMODULE SHDOCVW_hshell32 = 0;
38
39 /*************************************************************************
40  * SHDOCVW DllMain
41  */
42 BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID fImpLoad)
43 {
44         TRACE("%p 0x%lx %p\n", hinst, fdwReason, fImpLoad);
45         switch (fdwReason)
46         {
47           case DLL_PROCESS_ATTACH:
48             shdocvw_hinstance = hinst;
49             break;
50           case DLL_PROCESS_DETACH:
51             if (SHDOCVW_hshell32) FreeLibrary(SHDOCVW_hshell32);
52             break;
53         }
54         return TRUE;
55 }
56
57 /*************************************************************************
58  *              DllCanUnloadNow (SHDOCVW.@)
59  */
60 HRESULT WINAPI SHDOCVW_DllCanUnloadNow(void)
61 {
62     FIXME("(void): stub\n");
63
64     return S_FALSE;
65 }
66
67 /*************************************************************************
68  *              DllGetClassObject (SHDOCVW.@)
69  */
70 HRESULT WINAPI SHDOCVW_DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
71 {
72     TRACE("\n");
73
74     if (IsEqualGUID(&IID_IClassFactory, riid))
75     {
76         /* Pass back our shdocvw class factory */
77         *ppv = (LPVOID)&SHDOCVW_ClassFactory;
78         IClassFactory_AddRef((IClassFactory*)&SHDOCVW_ClassFactory);
79
80         return S_OK;
81     }
82
83     return CLASS_E_CLASSNOTAVAILABLE;
84 }
85
86 /***********************************************************************
87  *              DllGetVersion (SHDOCVW.@)
88  */
89 HRESULT WINAPI SHDOCVW_DllGetVersion (DLLVERSIONINFO *pdvi)
90 {
91     FIXME("(void): stub\n");
92     return S_FALSE;
93 }
94
95 /*************************************************************************
96  *              DllInstall (SHDOCVW.@)
97  */
98 HRESULT WINAPI SHDOCVW_DllInstall(BOOL bInstall, LPCWSTR cmdline)
99 {
100    FIXME("(%s, %s): stub!\n", bInstall ? "TRUE":"FALSE", debugstr_w(cmdline));
101
102    return S_OK;
103 }
104
105 /*************************************************************************
106  * SHDOCVW_LoadShell32
107  *
108  * makes sure the handle to shell32 is valid
109  */
110  BOOL SHDOCVW_LoadShell32(void)
111 {
112      if (SHDOCVW_hshell32)
113        return TRUE;
114      return ((SHDOCVW_hshell32 = LoadLibraryA("shell32.dll")) != NULL);
115 }
116
117 /***********************************************************************
118  *              @ (SHDOCVW.110)
119  *
120  * Called by Win98 explorer.exe main binary, definitely has 0
121  * parameters.
122  */
123 DWORD WINAPI WinList_Init(void)
124 {
125     FIXME("(), stub!\n");
126     return 0x0deadfeed;
127 }
128
129 /***********************************************************************
130  *              @ (SHDOCVW.118)
131  *
132  * Called by Win98 explorer.exe main binary, definitely has only one
133  * parameter.
134  */
135 static BOOL (WINAPI *pShellDDEInit)(BOOL start) = NULL;
136
137 BOOL WINAPI ShellDDEInit(BOOL start)
138 {
139     TRACE("(%d)\n", start);
140
141     if (!pShellDDEInit)
142     {
143       if (!SHDOCVW_LoadShell32())
144         return FALSE;
145       pShellDDEInit = GetProcAddress(SHDOCVW_hshell32, (LPCSTR)188);
146     }
147
148     if (pShellDDEInit)
149       return pShellDDEInit(start);
150     else
151       return FALSE;
152 }
153
154 /***********************************************************************
155  *              @ (SHDOCVW.125)
156  *
157  * Called by Win98 explorer.exe main binary, definitely has 0
158  * parameters.
159  */
160 DWORD WINAPI RunInstallUninstallStubs(void)
161 {
162     FIXME("(), stub!\n");
163     return 0x0deadbee;
164 }