2 * Copyright 2011 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
31 #include "vbscript_classes.h"
33 #include "wine/debug.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(vbscript);
37 static HINSTANCE vbscript_hinstance;
39 static HRESULT WINAPI VBScriptFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppv)
41 FIXME("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppv);
45 static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
49 if(IsEqualGUID(&IID_IUnknown, riid)) {
50 TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv);
52 }else if(IsEqualGUID(&IID_IClassFactory, riid)) {
53 TRACE("(%p)->(IID_IClassFactory %p)\n", iface, ppv);
58 IUnknown_AddRef((IUnknown*)*ppv);
62 FIXME("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
66 static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
68 TRACE("(%p)\n", iface);
72 static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
74 TRACE("(%p)\n", iface);
78 static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
80 TRACE("(%p)->(%x)\n", iface, fLock);
84 static const IClassFactoryVtbl VBScriptFactoryVtbl = {
85 ClassFactory_QueryInterface,
88 VBScriptFactory_CreateInstance,
89 ClassFactory_LockServer
92 static IClassFactory VBScriptFactory = { &VBScriptFactoryVtbl };
94 /******************************************************************
95 * DllMain (vbscript.@)
97 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
99 TRACE("(%p %d %p)\n", hInstDLL, fdwReason, lpv);
103 case DLL_WINE_PREATTACH:
104 return FALSE; /* prefer native version */
105 case DLL_PROCESS_ATTACH:
106 DisableThreadLibraryCalls(hInstDLL);
107 vbscript_hinstance = hInstDLL;
114 /***********************************************************************
115 * DllGetClassObject (vbscript.@)
117 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
119 if(IsEqualGUID(&CLSID_VBScript, rclsid)) {
120 TRACE("(CLSID_VBScript %s %p)\n", debugstr_guid(riid), ppv);
121 return IClassFactory_QueryInterface(&VBScriptFactory, riid, ppv);
124 FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
125 return CLASS_E_CLASSNOTAVAILABLE;
128 /***********************************************************************
129 * DllCanUnloadNow (vbscript.@)
131 HRESULT WINAPI DllCanUnloadNow(void)
137 /***********************************************************************
138 * DllRegisterServer (vbscript.@)
140 HRESULT WINAPI DllRegisterServer(void)
143 return __wine_register_resources(vbscript_hinstance, NULL);
146 /***********************************************************************
147 * DllUnregisterServer (vbscript.@)
149 HRESULT WINAPI DllUnregisterServer(void)
152 return __wine_unregister_resources(vbscript_hinstance, NULL);