Yet again catching up with En.rc.
[wine.git] / dlls / shdocvw / factory.c
blobf29ec17a2bc7e6b326f8d06b68a78a7c103a70ca
1 /*
2 * Implementation of class factory for IE Web Browser
4 * Copyright 2001 John R. Sheets (for CodeWeavers)
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
21 #include <string.h>
22 #include "wine/debug.h"
23 #include "shdocvw.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
27 /**********************************************************************
28 * Implement the IWebBrowser class factory
30 * (Based on implementation in ddraw/main.c)
33 /**********************************************************************
34 * WBCF_QueryInterface (IUnknown)
36 static HRESULT WINAPI WBCF_QueryInterface(LPCLASSFACTORY iface,
37 REFIID riid, LPVOID *ppobj)
39 ICOM_THIS(IClassFactoryImpl, iface);
41 TRACE ("\n");
44 * Perform a sanity check on the parameters.
46 if ((This == NULL) || (ppobj == NULL) )
47 return E_INVALIDARG;
49 return E_NOINTERFACE;
52 /************************************************************************
53 * WBCF_AddRef (IUnknown)
55 static ULONG WINAPI WBCF_AddRef(LPCLASSFACTORY iface)
57 ICOM_THIS(IClassFactoryImpl, iface);
59 TRACE("\n");
60 return ++(This->ref);
63 /************************************************************************
64 * WBCF_Release (IUnknown)
66 static ULONG WINAPI WBCF_Release(LPCLASSFACTORY iface)
68 ICOM_THIS(IClassFactoryImpl, iface);
70 /* static class, won't be freed */
71 TRACE("\n");
72 return --(This->ref);
75 /************************************************************************
76 * WBCF_CreateInstance (IClassFactory)
78 static HRESULT WINAPI WBCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter,
79 REFIID riid, LPVOID *ppobj)
81 ICOM_THIS(IClassFactoryImpl, iface);
83 /* Don't support aggregation (yet?) */
84 if (pOuter)
86 TRACE ("Failed attempt to aggregate IWebBrowser\n");
87 return CLASS_E_NOAGGREGATION;
90 TRACE("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj);
92 if ((IsEqualGUID (&IID_IOleObject, riid)))
94 TRACE ("Instantiating IOleObject component\n");
95 *ppobj = (LPVOID)&SHDOCVW_OleObject;
97 return S_OK;
99 return CLASS_E_CLASSNOTAVAILABLE;
102 /************************************************************************
103 * WBCF_LockServer (IClassFactory)
105 static HRESULT WINAPI WBCF_LockServer(LPCLASSFACTORY iface, BOOL dolock)
107 ICOM_THIS(IClassFactoryImpl, iface);
108 FIXME("(%p)->(%d),stub!\n", This, dolock);
109 return S_OK;
112 static ICOM_VTABLE(IClassFactory) WBCF_Vtbl =
114 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
115 WBCF_QueryInterface,
116 WBCF_AddRef,
117 WBCF_Release,
118 WBCF_CreateInstance,
119 WBCF_LockServer
122 IClassFactoryImpl SHDOCVW_ClassFactory = { &WBCF_Vtbl, 1 };