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
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
);
36 }else if(IsEqualGUID(riid
, &IID_IWindowsParentalControlsCore
)) {
37 TRACE("(IID_IWindowsParentalControlsCore %p)\n", ppv
);
39 }else if(IsEqualGUID(riid
, &IID_IWindowsParentalControls
)) {
40 TRACE("(IID_IWindowsParentalControls %p)\n", ppv
);
43 FIXME("unsupported iface %s\n", debugstr_guid(riid
));
48 IUnknown_AddRef((IUnknown
*)*ppv
);
52 static ULONG WINAPI
WindowsParentalControls_AddRef(IWindowsParentalControls
*iface
)
57 static ULONG WINAPI
WindowsParentalControls_Release(IWindowsParentalControls
*iface
)
62 static HRESULT WINAPI
WindowsParentalControls_GetVisibility(IWindowsParentalControls
*iface
, WPCFLAG_VISIBILITY
*visibility
)
64 FIXME("(%p)\n", visibility
);
68 static HRESULT WINAPI
WindowsParentalControls_GetUserSettings(IWindowsParentalControls
*iface
, const WCHAR
*sid
, IWPCSettings
**settings
)
70 FIXME("(%s %p)\n", debugstr_w(sid
), settings
);
74 static HRESULT WINAPI
WindowsParentalControls_GetWebSettings(IWindowsParentalControls
*iface
, const WCHAR
*sid
, IWPCWebSettings
**settings
)
76 FIXME("(%s %p)\n", debugstr_w(sid
), settings
);
80 static HRESULT WINAPI
WindowsParentalControls_GetWebFilterInfo(IWindowsParentalControls
*iface
, GUID
*id
, WCHAR
**name
)
82 FIXME("(%p %p)\n", id
, name
);
86 static HRESULT WINAPI
WindowsParentalControls_GetGamesSettings(IWindowsParentalControls
*iface
, const WCHAR
*sid
, IWPCGamesSettings
**settings
)
88 FIXME("(%s %p)\n", debugstr_w(sid
), settings
);
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
)
116 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
117 TRACE("(%p)->(IID_IUnknown %p)\n", iface
, ppv
);
119 }else if(IsEqualGUID(&IID_IClassFactory
, riid
)) {
120 TRACE("(%p)->(IID_IClassFactory %p)\n", iface
, ppv
);
125 IUnknown_AddRef((IUnknown
*)*ppv
);
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
);
139 static ULONG WINAPI
ClassFactory_Release(IClassFactory
*iface
)
141 TRACE("(%p)\n", iface
);
145 static HRESULT WINAPI
ClassFactory_LockServer(IClassFactory
*iface
, BOOL fLock
)
147 TRACE("(%p)->(%x)\n", iface
, fLock
);
151 static const IClassFactoryVtbl WPCFactoryVtbl
= {
152 ClassFactory_QueryInterface
,
154 ClassFactory_Release
,
155 WindowsParentalControls_CreateInstance
,
156 ClassFactory_LockServer
159 static IClassFactory WPCFactory
= { &WPCFactoryVtbl
};
161 /******************************************************************
164 BOOL WINAPI
DllMain(HINSTANCE hInstDLL
, DWORD fdwReason
, LPVOID lpv
)
166 TRACE("(%p %d %p)\n", hInstDLL
, fdwReason
, lpv
);
169 case DLL_WINE_PREATTACH
:
170 return FALSE
; /* prefer native version */
171 case DLL_PROCESS_ATTACH
:
172 DisableThreadLibraryCalls(hInstDLL
);
173 wpc_instance
= hInstDLL
;
180 /***********************************************************************
181 * DllGetClassObject (wpc.@)
183 HRESULT WINAPI
DllGetClassObject(REFCLSID rclsid
, REFIID riid
, void **ppv
)
185 if(IsEqualGUID(&CLSID_WindowsParentalControls
, rclsid
)) {
186 TRACE("(CLSID_WindowsParentalControls %s %p)\n", debugstr_guid(riid
), ppv
);
187 return IClassFactory_QueryInterface(&WPCFactory
, riid
, ppv
);
190 FIXME("Unknown object %s (iface %s)\n", debugstr_guid(rclsid
), debugstr_guid(riid
));
191 return CLASS_E_CLASSNOTAVAILABLE
;
194 /***********************************************************************
195 * DllCanUnloadNow (wpc.@)
197 HRESULT WINAPI
DllCanUnloadNow(void)
203 /***********************************************************************
204 * DllRegisterServer (wpc.@)
206 HRESULT WINAPI
DllRegisterServer(void)
209 return __wine_register_resources(wpc_instance
);
212 /***********************************************************************
213 * DllUnregisterServer (wpc.@)
215 HRESULT WINAPI
DllUnregisterServer(void)
218 return __wine_unregister_resources(wpc_instance
);