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
;
141 static inline struct wbem_services
*impl_from_IWbemServices( IWbemServices
*iface
)
143 return CONTAINING_RECORD( iface
, struct wbem_services
, IWbemServices_iface
);
146 static ULONG WINAPI
wbem_services_AddRef(
147 IWbemServices
*iface
)
149 struct wbem_services
*ws
= impl_from_IWbemServices( iface
);
150 return InterlockedIncrement( &ws
->refs
);
153 static ULONG WINAPI
wbem_services_Release(
154 IWbemServices
*iface
)
156 struct wbem_services
*ws
= impl_from_IWbemServices( iface
);
157 LONG refs
= InterlockedDecrement( &ws
->refs
);
160 TRACE("destroying %p\n", ws
);
166 static HRESULT WINAPI
wbem_services_QueryInterface(
167 IWbemServices
*iface
,
171 struct wbem_services
*ws
= impl_from_IWbemServices( iface
);
173 TRACE("%p %s %p\n", ws
, debugstr_guid( riid
), ppvObject
);
175 if ( IsEqualGUID( riid
, &IID_IWbemServices
) ||
176 IsEqualGUID( riid
, &IID_IUnknown
) )
180 else if ( IsEqualGUID( riid
, &IID_IClientSecurity
) )
182 *ppvObject
= &client_security
;
187 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
188 return E_NOINTERFACE
;
190 IWbemServices_AddRef( iface
);
194 static HRESULT WINAPI
wbem_services_OpenNamespace(
195 IWbemServices
*iface
,
196 const BSTR strNamespace
,
199 IWbemServices
**ppWorkingNamespace
,
200 IWbemCallResult
**ppResult
)
203 return WBEM_E_FAILED
;
206 static HRESULT WINAPI
wbem_services_CancelAsyncCall(
207 IWbemServices
*iface
,
208 IWbemObjectSink
*pSink
)
211 return WBEM_E_FAILED
;
214 static HRESULT WINAPI
wbem_services_QueryObjectSink(
215 IWbemServices
*iface
,
217 IWbemObjectSink
**ppResponseHandler
)
220 return WBEM_E_FAILED
;
223 static HRESULT WINAPI
wbem_services_GetObject(
224 IWbemServices
*iface
,
225 const BSTR strObjectPath
,
228 IWbemClassObject
**ppObject
,
229 IWbemCallResult
**ppCallResult
)
232 return WBEM_E_FAILED
;
235 static HRESULT WINAPI
wbem_services_GetObjectAsync(
236 IWbemServices
*iface
,
237 const BSTR strObjectPath
,
240 IWbemObjectSink
*pResponseHandler
)
243 return WBEM_E_FAILED
;
246 static HRESULT WINAPI
wbem_services_PutClass(
247 IWbemServices
*iface
,
248 IWbemClassObject
*pObject
,
251 IWbemCallResult
**ppCallResult
)
254 return WBEM_E_FAILED
;
257 static HRESULT WINAPI
wbem_services_PutClassAsync(
258 IWbemServices
*iface
,
259 IWbemClassObject
*pObject
,
262 IWbemObjectSink
*pResponseHandler
)
265 return WBEM_E_FAILED
;
268 static HRESULT WINAPI
wbem_services_DeleteClass(
269 IWbemServices
*iface
,
273 IWbemCallResult
**ppCallResult
)
276 return WBEM_E_FAILED
;
279 static HRESULT WINAPI
wbem_services_DeleteClassAsync(
280 IWbemServices
*iface
,
284 IWbemObjectSink
*pResponseHandler
)
287 return WBEM_E_FAILED
;
290 static HRESULT WINAPI
wbem_services_CreateClassEnum(
291 IWbemServices
*iface
,
292 const BSTR strSuperclass
,
295 IEnumWbemClassObject
**ppEnum
)
298 return WBEM_E_FAILED
;
301 static HRESULT WINAPI
wbem_services_CreateClassEnumAsync(
302 IWbemServices
*iface
,
303 const BSTR strSuperclass
,
306 IWbemObjectSink
*pResponseHandler
)
309 return WBEM_E_FAILED
;
312 static HRESULT WINAPI
wbem_services_PutInstance(
313 IWbemServices
*iface
,
314 IWbemClassObject
*pInst
,
317 IWbemCallResult
**ppCallResult
)
320 return WBEM_E_FAILED
;
323 static HRESULT WINAPI
wbem_services_PutInstanceAsync(
324 IWbemServices
*iface
,
325 IWbemClassObject
*pInst
,
328 IWbemObjectSink
*pResponseHandler
)
331 return WBEM_E_FAILED
;
334 static HRESULT WINAPI
wbem_services_DeleteInstance(
335 IWbemServices
*iface
,
336 const BSTR strObjectPath
,
339 IWbemCallResult
**ppCallResult
)
342 return WBEM_E_FAILED
;
345 static HRESULT WINAPI
wbem_services_DeleteInstanceAsync(
346 IWbemServices
*iface
,
347 const BSTR strObjectPath
,
350 IWbemObjectSink
*pResponseHandler
)
353 return WBEM_E_FAILED
;
356 static HRESULT WINAPI
wbem_services_CreateInstanceEnum(
357 IWbemServices
*iface
,
358 const BSTR strFilter
,
361 IEnumWbemClassObject
**ppEnum
)
364 return WBEM_E_FAILED
;
367 static HRESULT WINAPI
wbem_services_CreateInstanceEnumAsync(
368 IWbemServices
*iface
,
369 const BSTR strFilter
,
372 IWbemObjectSink
*pResponseHandler
)
375 return WBEM_E_FAILED
;
378 static HRESULT WINAPI
wbem_services_ExecQuery(
379 IWbemServices
*iface
,
380 const BSTR strQueryLanguage
,
384 IEnumWbemClassObject
**ppEnum
)
386 static const WCHAR wqlW
[] = {'W','Q','L',0};
388 TRACE("%p, %s, %s, 0x%08x, %p, %p\n", iface
, debugstr_w(strQueryLanguage
),
389 debugstr_w(strQuery
), lFlags
, pCtx
, ppEnum
);
391 if (!strQueryLanguage
|| !strQuery
) return WBEM_E_INVALID_PARAMETER
;
392 if (strcmpiW( strQueryLanguage
, wqlW
)) return WBEM_E_INVALID_QUERY_TYPE
;
393 return exec_query( strQuery
, ppEnum
);
396 static HRESULT WINAPI
wbem_services_ExecQueryAsync(
397 IWbemServices
*iface
,
398 const BSTR strQueryLanguage
,
402 IWbemObjectSink
*pResponseHandler
)
405 return WBEM_E_FAILED
;
408 static HRESULT WINAPI
wbem_services_ExecNotificationQuery(
409 IWbemServices
*iface
,
410 const BSTR strQueryLanguage
,
414 IEnumWbemClassObject
**ppEnum
)
417 return WBEM_E_FAILED
;
420 static HRESULT WINAPI
wbem_services_ExecNotificationQueryAsync(
421 IWbemServices
*iface
,
422 const BSTR strQueryLanguage
,
426 IWbemObjectSink
*pResponseHandler
)
429 return WBEM_E_FAILED
;
432 static HRESULT WINAPI
wbem_services_ExecMethod(
433 IWbemServices
*iface
,
434 const BSTR strObjectPath
,
435 const BSTR strMethodName
,
438 IWbemClassObject
*pInParams
,
439 IWbemClassObject
**ppOutParams
,
440 IWbemCallResult
**ppCallResult
)
443 return WBEM_E_FAILED
;
446 static HRESULT WINAPI
wbem_services_ExecMethodAsync(
447 IWbemServices
*iface
,
448 const BSTR strObjectPath
,
449 const BSTR strMethodName
,
452 IWbemClassObject
*pInParams
,
453 IWbemObjectSink
*pResponseHandler
)
456 return WBEM_E_FAILED
;
459 static const IWbemServicesVtbl wbem_services_vtbl
=
461 wbem_services_QueryInterface
,
462 wbem_services_AddRef
,
463 wbem_services_Release
,
464 wbem_services_OpenNamespace
,
465 wbem_services_CancelAsyncCall
,
466 wbem_services_QueryObjectSink
,
467 wbem_services_GetObject
,
468 wbem_services_GetObjectAsync
,
469 wbem_services_PutClass
,
470 wbem_services_PutClassAsync
,
471 wbem_services_DeleteClass
,
472 wbem_services_DeleteClassAsync
,
473 wbem_services_CreateClassEnum
,
474 wbem_services_CreateClassEnumAsync
,
475 wbem_services_PutInstance
,
476 wbem_services_PutInstanceAsync
,
477 wbem_services_DeleteInstance
,
478 wbem_services_DeleteInstanceAsync
,
479 wbem_services_CreateInstanceEnum
,
480 wbem_services_CreateInstanceEnumAsync
,
481 wbem_services_ExecQuery
,
482 wbem_services_ExecQueryAsync
,
483 wbem_services_ExecNotificationQuery
,
484 wbem_services_ExecNotificationQueryAsync
,
485 wbem_services_ExecMethod
,
486 wbem_services_ExecMethodAsync
489 HRESULT
WbemServices_create( IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
491 struct wbem_services
*ws
;
493 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
495 ws
= heap_alloc( sizeof(*ws
) );
496 if (!ws
) return E_OUTOFMEMORY
;
498 ws
->IWbemServices_iface
.lpVtbl
= &wbem_services_vtbl
;
501 *ppObj
= &ws
->IWbemServices_iface
;
503 TRACE("returning iface %p\n", *ppObj
);