wpc: Added class factory stub implementation.
[wine.git] / dlls / wpc / wpc.c
blob20db3fca4f5bff32a02c0fe1547cb82609a07029
1 /*
2 * Copyright 2016 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 #define COBJMACROS
21 #include "initguid.h"
22 #include "wpcapi.h"
23 #include "rpcproxy.h"
25 #include "wine/debug.h"
27 WINE_DEFAULT_DEBUG_CHANNEL(wpc);
29 static HINSTANCE wpc_instance;
31 static HRESULT WINAPI WindowsParentalControls_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
33 FIXME("(%s %p %p)\n", debugstr_guid(riid), outer, ppv);
34 return E_NOTIMPL;
37 static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
39 *ppv = NULL;
41 if(IsEqualGUID(&IID_IUnknown, riid)) {
42 TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv);
43 *ppv = iface;
44 }else if(IsEqualGUID(&IID_IClassFactory, riid)) {
45 TRACE("(%p)->(IID_IClassFactory %p)\n", iface, ppv);
46 *ppv = iface;
49 if(*ppv) {
50 IUnknown_AddRef((IUnknown*)*ppv);
51 return S_OK;
54 FIXME("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
55 return E_NOINTERFACE;
58 static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
60 TRACE("(%p)\n", iface);
61 return 2;
64 static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
66 TRACE("(%p)\n", iface);
67 return 1;
70 static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
72 TRACE("(%p)->(%x)\n", iface, fLock);
73 return S_OK;
76 static const IClassFactoryVtbl WPCFactoryVtbl = {
77 ClassFactory_QueryInterface,
78 ClassFactory_AddRef,
79 ClassFactory_Release,
80 WindowsParentalControls_CreateInstance,
81 ClassFactory_LockServer
84 static IClassFactory WPCFactory = { &WPCFactoryVtbl };
86 /******************************************************************
87 * DllMain
89 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
91 TRACE("(%p %d %p)\n", hInstDLL, fdwReason, lpv);
93 switch(fdwReason) {
94 case DLL_WINE_PREATTACH:
95 return FALSE; /* prefer native version */
96 case DLL_PROCESS_ATTACH:
97 DisableThreadLibraryCalls(hInstDLL);
98 wpc_instance = hInstDLL;
99 break;
102 return TRUE;
105 /***********************************************************************
106 * DllGetClassObject (wpc.@)
108 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv)
110 if(IsEqualGUID(&CLSID_WindowsParentalControls, rclsid)) {
111 TRACE("(CLSID_WindowsParentalControls %s %p)\n", debugstr_guid(riid), ppv);
112 return IClassFactory_QueryInterface(&WPCFactory, riid, ppv);
115 FIXME("Unknown object %s (iface %s)\n", debugstr_guid(rclsid), debugstr_guid(riid));
116 return CLASS_E_CLASSNOTAVAILABLE;
119 /***********************************************************************
120 * DllCanUnloadNow (wpc.@)
122 HRESULT WINAPI DllCanUnloadNow(void)
124 TRACE("\n");
125 return S_FALSE;
128 /***********************************************************************
129 * DllRegisterServer (wpc.@)
131 HRESULT WINAPI DllRegisterServer(void)
133 TRACE("()\n");
134 return __wine_register_resources(wpc_instance);
137 /***********************************************************************
138 * DllUnregisterServer (wpc.@)
140 HRESULT WINAPI DllUnregisterServer(void)
142 TRACE("()\n");
143 return __wine_unregister_resources(wpc_instance);