wshom.ocx: Don't bother with a FIXME in DllCanUnloadNow().
[wine/multimedia.git] / dlls / wshom.ocx / wshom_main.c
blobb05eb86c9e70e3e0c439f049153c34cf47443a3c
1 /*
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
19 #include "initguid.h"
20 #include "wshom_private.h"
21 #include "wshom.h"
22 #include "rpcproxy.h"
24 #include "wine/debug.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(wshom);
28 static HINSTANCE wshom_instance;
30 static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
32 *ppv = NULL;
34 if(IsEqualGUID(&IID_IUnknown, riid)) {
35 TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv);
36 *ppv = iface;
37 }else if(IsEqualGUID(&IID_IClassFactory, riid)) {
38 TRACE("(%p)->(IID_IClassFactory %p)\n", iface, ppv);
39 *ppv = iface;
42 if(*ppv) {
43 IUnknown_AddRef((IUnknown*)*ppv);
44 return S_OK;
47 FIXME("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
48 return E_NOINTERFACE;
51 static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
53 TRACE("(%p)\n", iface);
54 return 2;
57 static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
59 TRACE("(%p)\n", iface);
60 return 1;
63 static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
65 TRACE("(%p)->(%x)\n", iface, fLock);
66 return S_OK;
69 static const IClassFactoryVtbl WshShellFactoryVtbl = {
70 ClassFactory_QueryInterface,
71 ClassFactory_AddRef,
72 ClassFactory_Release,
73 WshShellFactory_CreateInstance,
74 ClassFactory_LockServer
77 static IClassFactory WshShellFactory = { &WshShellFactoryVtbl };
79 /******************************************************************
80 * DllMain (wshom.ocx.@)
82 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
84 TRACE("(%p %d %p)\n", hInstDLL, fdwReason, lpv);
86 switch(fdwReason)
88 case DLL_WINE_PREATTACH:
89 return FALSE; /* prefer native version */
90 case DLL_PROCESS_ATTACH:
91 wshom_instance = hInstDLL;
92 DisableThreadLibraryCalls(wshom_instance);
93 break;
96 return TRUE;
99 /***********************************************************************
100 * DllGetClassObject (wshom.ocx.@)
102 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
104 if(IsEqualGUID(&CLSID_WshShell, rclsid)) {
105 TRACE("(CLSID_WshShell %s %p)\n", debugstr_guid(riid), ppv);
106 return IClassFactory_QueryInterface(&WshShellFactory, riid, ppv);
109 FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
110 return CLASS_E_CLASSNOTAVAILABLE;
113 /***********************************************************************
114 * DllCanUnloadNow (wshom.ocx.@)
116 HRESULT WINAPI DllCanUnloadNow(void)
118 return S_FALSE;
121 /***********************************************************************
122 * DllRegisterServer (wshom.ocx.@)
124 HRESULT WINAPI DllRegisterServer(void)
126 TRACE("()\n");
127 return __wine_register_resources(wshom_instance);
130 /***********************************************************************
131 * DllUnregisterServer (wshom.ocx.@)
133 HRESULT WINAPI DllUnregisterServer(void)
135 TRACE("()\n");
136 return __wine_unregister_resources(wshom_instance);