From 14cf136a8c68fa45a72c09409a19d13bb44d3bcf Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 24 Aug 2016 12:40:35 +0200 Subject: [PATCH] wpc: Added class factory stub implementation. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/wpc/wpc.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/dlls/wpc/wpc.c b/dlls/wpc/wpc.c index 48f8edfdbf6..20db3fca4f5 100644 --- a/dlls/wpc/wpc.c +++ b/dlls/wpc/wpc.c @@ -16,6 +16,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define COBJMACROS + +#include "initguid.h" #include "wpcapi.h" #include "rpcproxy.h" @@ -25,6 +28,61 @@ WINE_DEFAULT_DEBUG_CHANNEL(wpc); static HINSTANCE wpc_instance; +static HRESULT WINAPI WindowsParentalControls_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv) +{ + FIXME("(%s %p %p)\n", debugstr_guid(riid), outer, ppv); + return E_NOTIMPL; +} + +static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv) +{ + *ppv = NULL; + + if(IsEqualGUID(&IID_IUnknown, riid)) { + TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv); + *ppv = iface; + }else if(IsEqualGUID(&IID_IClassFactory, riid)) { + TRACE("(%p)->(IID_IClassFactory %p)\n", iface, ppv); + *ppv = iface; + } + + if(*ppv) { + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; + } + + FIXME("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv); + return E_NOINTERFACE; +} + +static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface) +{ + TRACE("(%p)\n", iface); + return 2; +} + +static ULONG WINAPI ClassFactory_Release(IClassFactory *iface) +{ + TRACE("(%p)\n", iface); + return 1; +} + +static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock) +{ + TRACE("(%p)->(%x)\n", iface, fLock); + return S_OK; +} + +static const IClassFactoryVtbl WPCFactoryVtbl = { + ClassFactory_QueryInterface, + ClassFactory_AddRef, + ClassFactory_Release, + WindowsParentalControls_CreateInstance, + ClassFactory_LockServer +}; + +static IClassFactory WPCFactory = { &WPCFactoryVtbl }; + /****************************************************************** * DllMain */ @@ -49,6 +107,11 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) */ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv) { + if(IsEqualGUID(&CLSID_WindowsParentalControls, rclsid)) { + TRACE("(CLSID_WindowsParentalControls %s %p)\n", debugstr_guid(riid), ppv); + return IClassFactory_QueryInterface(&WPCFactory, riid, ppv); + } + FIXME("Unknown object %s (iface %s)\n", debugstr_guid(rclsid), debugstr_guid(riid)); return CLASS_E_CLASSNOTAVAILABLE; }