d3d11: Use wined3d_device_context_draw().
[wine.git] / dlls / wpc / wpc.c
blob3dcca050bcde77c220ae949bc4a03ab96b01b29a
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_QueryInterface(IWindowsParentalControls *iface, REFIID riid, void **ppv)
33 if(IsEqualGUID(riid, &IID_IUnknown)) {
34 TRACE("(IID_IUnknown %p)\n", ppv);
35 *ppv = iface;
36 }else if(IsEqualGUID(riid, &IID_IWindowsParentalControlsCore)) {
37 TRACE("(IID_IWindowsParentalControlsCore %p)\n", ppv);
38 *ppv = iface;
39 }else if(IsEqualGUID(riid, &IID_IWindowsParentalControls)) {
40 TRACE("(IID_IWindowsParentalControls %p)\n", ppv);
41 *ppv = iface;
42 }else {
43 FIXME("unsupported iface %s\n", debugstr_guid(riid));
44 *ppv = NULL;
45 return E_NOINTERFACE;
48 IUnknown_AddRef((IUnknown*)*ppv);
49 return S_OK;
52 static ULONG WINAPI WindowsParentalControls_AddRef(IWindowsParentalControls *iface)
54 return 2;
57 static ULONG WINAPI WindowsParentalControls_Release(IWindowsParentalControls *iface)
59 return 1;
62 static HRESULT WINAPI WindowsParentalControls_GetVisibility(IWindowsParentalControls *iface, WPCFLAG_VISIBILITY *visibility)
64 FIXME("(%p)\n", visibility);
65 return E_NOTIMPL;
68 static HRESULT WINAPI WindowsParentalControls_GetUserSettings(IWindowsParentalControls *iface, const WCHAR *sid, IWPCSettings **settings)
70 FIXME("(%s %p)\n", debugstr_w(sid), settings);
71 return E_NOTIMPL;
74 static HRESULT WINAPI WindowsParentalControls_GetWebSettings(IWindowsParentalControls *iface, const WCHAR *sid, IWPCWebSettings **settings)
76 FIXME("(%s %p)\n", debugstr_w(sid), settings);
77 return E_NOTIMPL;
80 static HRESULT WINAPI WindowsParentalControls_GetWebFilterInfo(IWindowsParentalControls *iface, GUID *id, WCHAR **name)
82 FIXME("(%p %p)\n", id, name);
83 return E_NOTIMPL;
86 static HRESULT WINAPI WindowsParentalControls_GetGamesSettings(IWindowsParentalControls *iface, const WCHAR *sid, IWPCGamesSettings **settings)
88 FIXME("(%s %p)\n", debugstr_w(sid), settings);
89 return E_NOTIMPL;
92 static const IWindowsParentalControlsVtbl WindowsParentalControlsVtbl = {
93 WindowsParentalControls_QueryInterface,
94 WindowsParentalControls_AddRef,
95 WindowsParentalControls_Release,
96 WindowsParentalControls_GetVisibility,
97 WindowsParentalControls_GetUserSettings,
98 WindowsParentalControls_GetWebSettings,
99 WindowsParentalControls_GetWebFilterInfo,
100 WindowsParentalControls_GetGamesSettings
103 static HRESULT WINAPI WindowsParentalControls_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
105 static IWindowsParentalControls wpc = { &WindowsParentalControlsVtbl };
107 TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv);
109 return IWindowsParentalControls_QueryInterface(&wpc, riid, ppv);
112 static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
114 *ppv = NULL;
116 if(IsEqualGUID(&IID_IUnknown, riid)) {
117 TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv);
118 *ppv = iface;
119 }else if(IsEqualGUID(&IID_IClassFactory, riid)) {
120 TRACE("(%p)->(IID_IClassFactory %p)\n", iface, ppv);
121 *ppv = iface;
124 if(*ppv) {
125 IUnknown_AddRef((IUnknown*)*ppv);
126 return S_OK;
129 FIXME("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
130 return E_NOINTERFACE;
133 static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
135 TRACE("(%p)\n", iface);
136 return 2;
139 static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
141 TRACE("(%p)\n", iface);
142 return 1;
145 static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
147 TRACE("(%p)->(%x)\n", iface, fLock);
148 return S_OK;
151 static const IClassFactoryVtbl WPCFactoryVtbl = {
152 ClassFactory_QueryInterface,
153 ClassFactory_AddRef,
154 ClassFactory_Release,
155 WindowsParentalControls_CreateInstance,
156 ClassFactory_LockServer
159 static IClassFactory WPCFactory = { &WPCFactoryVtbl };
161 /******************************************************************
162 * DllMain
164 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
166 TRACE("(%p %d %p)\n", hInstDLL, fdwReason, lpv);
168 switch(fdwReason) {
169 case DLL_PROCESS_ATTACH:
170 DisableThreadLibraryCalls(hInstDLL);
171 wpc_instance = hInstDLL;
172 break;
175 return TRUE;
178 /***********************************************************************
179 * DllGetClassObject (wpc.@)
181 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv)
183 if(IsEqualGUID(&CLSID_WindowsParentalControls, rclsid)) {
184 TRACE("(CLSID_WindowsParentalControls %s %p)\n", debugstr_guid(riid), ppv);
185 return IClassFactory_QueryInterface(&WPCFactory, riid, ppv);
188 FIXME("Unknown object %s (iface %s)\n", debugstr_guid(rclsid), debugstr_guid(riid));
189 return CLASS_E_CLASSNOTAVAILABLE;
192 /***********************************************************************
193 * DllCanUnloadNow (wpc.@)
195 HRESULT WINAPI DllCanUnloadNow(void)
197 TRACE("\n");
198 return S_FALSE;
201 /***********************************************************************
202 * DllRegisterServer (wpc.@)
204 HRESULT WINAPI DllRegisterServer(void)
206 TRACE("()\n");
207 return __wine_register_resources(wpc_instance);
210 /***********************************************************************
211 * DllUnregisterServer (wpc.@)
213 HRESULT WINAPI DllUnregisterServer(void)
215 TRACE("()\n");
216 return __wine_unregister_resources(wpc_instance);