2 * Copyright 2012 Hans Leidekker 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
30 #include "wine/debug.h"
31 #include "wine/unicode.h"
32 #include "wbemprox_private.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(wbemprox);
36 struct client_security
38 IClientSecurity IClientSecurity_iface;
41 static inline struct client_security *impl_from_IClientSecurity( IClientSecurity *iface )
43 return CONTAINING_RECORD( iface, struct client_security, IClientSecurity_iface );
46 static HRESULT WINAPI client_security_QueryInterface(
47 IClientSecurity *iface,
51 struct client_security *cs = impl_from_IClientSecurity( iface );
53 TRACE("%p %s %p\n", cs, debugstr_guid( riid ), ppvObject );
55 if ( IsEqualGUID( riid, &IID_IClientSecurity ) ||
56 IsEqualGUID( riid, &IID_IUnknown ) )
62 FIXME("interface %s not implemented\n", debugstr_guid(riid));
65 IClientSecurity_AddRef( iface );
69 static ULONG WINAPI client_security_AddRef(
70 IClientSecurity *iface )
76 static ULONG WINAPI client_security_Release(
77 IClientSecurity *iface )
83 static HRESULT WINAPI client_security_QueryBlanket(
84 IClientSecurity *iface,
88 OLECHAR **pServerPrincName,
92 DWORD *pCapabilities )
98 static HRESULT WINAPI client_security_SetBlanket(
99 IClientSecurity *iface,
103 OLECHAR *pServerPrincName,
109 FIXME("%p, %p, %u, %u, %s, %u, %u, %p, 0x%08x\n", iface, pProxy, AuthnSvc, AuthzSvc,
110 debugstr_w(pServerPrincName), AuthnLevel, ImpLevel, pAuthInfo, Capabilities);
111 return WBEM_NO_ERROR;
114 static HRESULT WINAPI client_security_CopyProxy(
115 IClientSecurity *iface,
120 return WBEM_E_FAILED;
123 static const IClientSecurityVtbl client_security_vtbl =
125 client_security_QueryInterface,
126 client_security_AddRef,
127 client_security_Release,
128 client_security_QueryBlanket,
129 client_security_SetBlanket,
130 client_security_CopyProxy
133 static IClientSecurity client_security = { &client_security_vtbl };
137 IWbemServices IWbemServices_iface;
142 static inline struct wbem_services *impl_from_IWbemServices( IWbemServices *iface )
144 return CONTAINING_RECORD( iface, struct wbem_services, IWbemServices_iface );
147 static ULONG WINAPI wbem_services_AddRef(
148 IWbemServices *iface )
150 struct wbem_services *ws = impl_from_IWbemServices( iface );
151 return InterlockedIncrement( &ws->refs );
154 static ULONG WINAPI wbem_services_Release(
155 IWbemServices *iface )
157 struct wbem_services *ws = impl_from_IWbemServices( iface );
158 LONG refs = InterlockedDecrement( &ws->refs );
161 TRACE("destroying %p\n", ws);
162 heap_free( ws->namespace );
168 static HRESULT WINAPI wbem_services_QueryInterface(
169 IWbemServices *iface,
173 struct wbem_services *ws = impl_from_IWbemServices( iface );
175 TRACE("%p %s %p\n", ws, debugstr_guid( riid ), ppvObject );
177 if ( IsEqualGUID( riid, &IID_IWbemServices ) ||
178 IsEqualGUID( riid, &IID_IUnknown ) )
182 else if ( IsEqualGUID( riid, &IID_IClientSecurity ) )
184 *ppvObject = &client_security;
189 FIXME("interface %s not implemented\n", debugstr_guid(riid));
190 return E_NOINTERFACE;
192 IWbemServices_AddRef( iface );
196 static HRESULT WINAPI wbem_services_OpenNamespace(
197 IWbemServices *iface,
198 const BSTR strNamespace,
201 IWbemServices **ppWorkingNamespace,
202 IWbemCallResult **ppResult )
205 return WBEM_E_FAILED;
208 static HRESULT WINAPI wbem_services_CancelAsyncCall(
209 IWbemServices *iface,
210 IWbemObjectSink *pSink )
213 return WBEM_E_FAILED;
216 static HRESULT WINAPI wbem_services_QueryObjectSink(
217 IWbemServices *iface,
219 IWbemObjectSink **ppResponseHandler )
222 return WBEM_E_FAILED;
225 static HRESULT WINAPI wbem_services_GetObject(
226 IWbemServices *iface,
227 const BSTR strObjectPath,
230 IWbemClassObject **ppObject,
231 IWbemCallResult **ppCallResult )
234 return WBEM_E_FAILED;
237 static HRESULT WINAPI wbem_services_GetObjectAsync(
238 IWbemServices *iface,
239 const BSTR strObjectPath,
242 IWbemObjectSink *pResponseHandler )
245 return WBEM_E_FAILED;
248 static HRESULT WINAPI wbem_services_PutClass(
249 IWbemServices *iface,
250 IWbemClassObject *pObject,
253 IWbemCallResult **ppCallResult )
256 return WBEM_E_FAILED;
259 static HRESULT WINAPI wbem_services_PutClassAsync(
260 IWbemServices *iface,
261 IWbemClassObject *pObject,
264 IWbemObjectSink *pResponseHandler )
267 return WBEM_E_FAILED;
270 static HRESULT WINAPI wbem_services_DeleteClass(
271 IWbemServices *iface,
275 IWbemCallResult **ppCallResult )
278 return WBEM_E_FAILED;
281 static HRESULT WINAPI wbem_services_DeleteClassAsync(
282 IWbemServices *iface,
286 IWbemObjectSink *pResponseHandler )
289 return WBEM_E_FAILED;
292 static HRESULT WINAPI wbem_services_CreateClassEnum(
293 IWbemServices *iface,
294 const BSTR strSuperclass,
297 IEnumWbemClassObject **ppEnum )
300 return WBEM_E_FAILED;
303 static HRESULT WINAPI wbem_services_CreateClassEnumAsync(
304 IWbemServices *iface,
305 const BSTR strSuperclass,
308 IWbemObjectSink *pResponseHandler )
311 return WBEM_E_FAILED;
314 static HRESULT WINAPI wbem_services_PutInstance(
315 IWbemServices *iface,
316 IWbemClassObject *pInst,
319 IWbemCallResult **ppCallResult )
322 return WBEM_E_FAILED;
325 static HRESULT WINAPI wbem_services_PutInstanceAsync(
326 IWbemServices *iface,
327 IWbemClassObject *pInst,
330 IWbemObjectSink *pResponseHandler )
333 return WBEM_E_FAILED;
336 static HRESULT WINAPI wbem_services_DeleteInstance(
337 IWbemServices *iface,
338 const BSTR strObjectPath,
341 IWbemCallResult **ppCallResult )
344 return WBEM_E_FAILED;
347 static HRESULT WINAPI wbem_services_DeleteInstanceAsync(
348 IWbemServices *iface,
349 const BSTR strObjectPath,
352 IWbemObjectSink *pResponseHandler )
355 return WBEM_E_FAILED;
358 static HRESULT WINAPI wbem_services_CreateInstanceEnum(
359 IWbemServices *iface,
360 const BSTR strFilter,
363 IEnumWbemClassObject **ppEnum )
366 return WBEM_E_FAILED;
369 static HRESULT WINAPI wbem_services_CreateInstanceEnumAsync(
370 IWbemServices *iface,
371 const BSTR strFilter,
374 IWbemObjectSink *pResponseHandler )
377 return WBEM_E_FAILED;
380 static HRESULT WINAPI wbem_services_ExecQuery(
381 IWbemServices *iface,
382 const BSTR strQueryLanguage,
386 IEnumWbemClassObject **ppEnum )
388 static const WCHAR wqlW[] = {'W','Q','L',0};
390 TRACE("%p, %s, %s, 0x%08x, %p, %p\n", iface, debugstr_w(strQueryLanguage),
391 debugstr_w(strQuery), lFlags, pCtx, ppEnum);
393 if (!strQueryLanguage || !strQuery) return WBEM_E_INVALID_PARAMETER;
394 if (strcmpiW( strQueryLanguage, wqlW )) return WBEM_E_INVALID_QUERY_TYPE;
395 return exec_query( strQuery, ppEnum );
398 static HRESULT WINAPI wbem_services_ExecQueryAsync(
399 IWbemServices *iface,
400 const BSTR strQueryLanguage,
404 IWbemObjectSink *pResponseHandler )
407 return WBEM_E_FAILED;
410 static HRESULT WINAPI wbem_services_ExecNotificationQuery(
411 IWbemServices *iface,
412 const BSTR strQueryLanguage,
416 IEnumWbemClassObject **ppEnum )
419 return WBEM_E_FAILED;
422 static HRESULT WINAPI wbem_services_ExecNotificationQueryAsync(
423 IWbemServices *iface,
424 const BSTR strQueryLanguage,
428 IWbemObjectSink *pResponseHandler )
431 return WBEM_E_FAILED;
434 static HRESULT WINAPI wbem_services_ExecMethod(
435 IWbemServices *iface,
436 const BSTR strObjectPath,
437 const BSTR strMethodName,
440 IWbemClassObject *pInParams,
441 IWbemClassObject **ppOutParams,
442 IWbemCallResult **ppCallResult )
445 return WBEM_E_FAILED;
448 static HRESULT WINAPI wbem_services_ExecMethodAsync(
449 IWbemServices *iface,
450 const BSTR strObjectPath,
451 const BSTR strMethodName,
454 IWbemClassObject *pInParams,
455 IWbemObjectSink *pResponseHandler )
458 return WBEM_E_FAILED;
461 static const IWbemServicesVtbl wbem_services_vtbl =
463 wbem_services_QueryInterface,
464 wbem_services_AddRef,
465 wbem_services_Release,
466 wbem_services_OpenNamespace,
467 wbem_services_CancelAsyncCall,
468 wbem_services_QueryObjectSink,
469 wbem_services_GetObject,
470 wbem_services_GetObjectAsync,
471 wbem_services_PutClass,
472 wbem_services_PutClassAsync,
473 wbem_services_DeleteClass,
474 wbem_services_DeleteClassAsync,
475 wbem_services_CreateClassEnum,
476 wbem_services_CreateClassEnumAsync,
477 wbem_services_PutInstance,
478 wbem_services_PutInstanceAsync,
479 wbem_services_DeleteInstance,
480 wbem_services_DeleteInstanceAsync,
481 wbem_services_CreateInstanceEnum,
482 wbem_services_CreateInstanceEnumAsync,
483 wbem_services_ExecQuery,
484 wbem_services_ExecQueryAsync,
485 wbem_services_ExecNotificationQuery,
486 wbem_services_ExecNotificationQueryAsync,
487 wbem_services_ExecMethod,
488 wbem_services_ExecMethodAsync
491 HRESULT WbemServices_create( IUnknown *pUnkOuter, WCHAR *namespace, LPVOID *ppObj )
493 struct wbem_services *ws;
495 TRACE("(%p,%p)\n", pUnkOuter, ppObj);
497 ws = heap_alloc( sizeof(*ws) );
498 if (!ws) return E_OUTOFMEMORY;
500 ws->IWbemServices_iface.lpVtbl = &wbem_services_vtbl;
502 ws->namespace = namespace;
504 *ppObj = &ws->IWbemServices_iface;
506 TRACE("returning iface %p\n", *ppObj);