msvcp90: Added _Stofx implementation.
[wine/multimedia.git] / dlls / wbemprox / services.c
blobc2aaa3aaa5135da4ad05932f0faffa872f5d29ef
1 /*
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
19 #define COBJMACROS
21 #include "config.h"
22 #include <stdarg.h>
24 #include "windef.h"
25 #include "winbase.h"
26 #include "initguid.h"
27 #include "objbase.h"
28 #include "wbemcli.h"
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,
48 REFIID riid,
49 void **ppvObject )
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 ) )
58 *ppvObject = cs;
60 else
62 FIXME("interface %s not implemented\n", debugstr_guid(riid));
63 return E_NOINTERFACE;
65 IClientSecurity_AddRef( iface );
66 return S_OK;
69 static ULONG WINAPI client_security_AddRef(
70 IClientSecurity *iface )
72 FIXME("%p\n", iface);
73 return 2;
76 static ULONG WINAPI client_security_Release(
77 IClientSecurity *iface )
79 FIXME("%p\n", iface);
80 return 1;
83 static HRESULT WINAPI client_security_QueryBlanket(
84 IClientSecurity *iface,
85 IUnknown *pProxy,
86 DWORD *pAuthnSvc,
87 DWORD *pAuthzSvc,
88 OLECHAR **pServerPrincName,
89 DWORD *pAuthnLevel,
90 DWORD *pImpLevel,
91 void **pAuthInfo,
92 DWORD *pCapabilities )
94 FIXME("\n");
95 return WBEM_E_FAILED;
98 static HRESULT WINAPI client_security_SetBlanket(
99 IClientSecurity *iface,
100 IUnknown *pProxy,
101 DWORD AuthnSvc,
102 DWORD AuthzSvc,
103 OLECHAR *pServerPrincName,
104 DWORD AuthnLevel,
105 DWORD ImpLevel,
106 void *pAuthInfo,
107 DWORD Capabilities )
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,
116 IUnknown *pProxy,
117 IUnknown **ppCopy )
119 FIXME("\n");
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 };
135 struct wbem_services
137 IWbemServices IWbemServices_iface;
138 LONG refs;
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 );
158 if (!refs)
160 TRACE("destroying %p\n", ws);
161 heap_free( ws );
163 return refs;
166 static HRESULT WINAPI wbem_services_QueryInterface(
167 IWbemServices *iface,
168 REFIID riid,
169 void **ppvObject )
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 ) )
178 *ppvObject = ws;
180 else if ( IsEqualGUID( riid, &IID_IClientSecurity ) )
182 *ppvObject = &client_security;
183 return S_OK;
185 else
187 FIXME("interface %s not implemented\n", debugstr_guid(riid));
188 return E_NOINTERFACE;
190 IWbemServices_AddRef( iface );
191 return S_OK;
194 static HRESULT WINAPI wbem_services_OpenNamespace(
195 IWbemServices *iface,
196 const BSTR strNamespace,
197 LONG lFlags,
198 IWbemContext *pCtx,
199 IWbemServices **ppWorkingNamespace,
200 IWbemCallResult **ppResult )
202 FIXME("\n");
203 return WBEM_E_FAILED;
206 static HRESULT WINAPI wbem_services_CancelAsyncCall(
207 IWbemServices *iface,
208 IWbemObjectSink *pSink )
210 FIXME("\n");
211 return WBEM_E_FAILED;
214 static HRESULT WINAPI wbem_services_QueryObjectSink(
215 IWbemServices *iface,
216 LONG lFlags,
217 IWbemObjectSink **ppResponseHandler )
219 FIXME("\n");
220 return WBEM_E_FAILED;
223 static HRESULT WINAPI wbem_services_GetObject(
224 IWbemServices *iface,
225 const BSTR strObjectPath,
226 LONG lFlags,
227 IWbemContext *pCtx,
228 IWbemClassObject **ppObject,
229 IWbemCallResult **ppCallResult )
231 FIXME("\n");
232 return WBEM_E_FAILED;
235 static HRESULT WINAPI wbem_services_GetObjectAsync(
236 IWbemServices *iface,
237 const BSTR strObjectPath,
238 LONG lFlags,
239 IWbemContext *pCtx,
240 IWbemObjectSink *pResponseHandler )
242 FIXME("\n");
243 return WBEM_E_FAILED;
246 static HRESULT WINAPI wbem_services_PutClass(
247 IWbemServices *iface,
248 IWbemClassObject *pObject,
249 LONG lFlags,
250 IWbemContext *pCtx,
251 IWbemCallResult **ppCallResult )
253 FIXME("\n");
254 return WBEM_E_FAILED;
257 static HRESULT WINAPI wbem_services_PutClassAsync(
258 IWbemServices *iface,
259 IWbemClassObject *pObject,
260 LONG lFlags,
261 IWbemContext *pCtx,
262 IWbemObjectSink *pResponseHandler )
264 FIXME("\n");
265 return WBEM_E_FAILED;
268 static HRESULT WINAPI wbem_services_DeleteClass(
269 IWbemServices *iface,
270 const BSTR strClass,
271 LONG lFlags,
272 IWbemContext *pCtx,
273 IWbemCallResult **ppCallResult )
275 FIXME("\n");
276 return WBEM_E_FAILED;
279 static HRESULT WINAPI wbem_services_DeleteClassAsync(
280 IWbemServices *iface,
281 const BSTR strClass,
282 LONG lFlags,
283 IWbemContext *pCtx,
284 IWbemObjectSink *pResponseHandler )
286 FIXME("\n");
287 return WBEM_E_FAILED;
290 static HRESULT WINAPI wbem_services_CreateClassEnum(
291 IWbemServices *iface,
292 const BSTR strSuperclass,
293 LONG lFlags,
294 IWbemContext *pCtx,
295 IEnumWbemClassObject **ppEnum )
297 FIXME("\n");
298 return WBEM_E_FAILED;
301 static HRESULT WINAPI wbem_services_CreateClassEnumAsync(
302 IWbemServices *iface,
303 const BSTR strSuperclass,
304 LONG lFlags,
305 IWbemContext *pCtx,
306 IWbemObjectSink *pResponseHandler )
308 FIXME("\n");
309 return WBEM_E_FAILED;
312 static HRESULT WINAPI wbem_services_PutInstance(
313 IWbemServices *iface,
314 IWbemClassObject *pInst,
315 LONG lFlags,
316 IWbemContext *pCtx,
317 IWbemCallResult **ppCallResult )
319 FIXME("\n");
320 return WBEM_E_FAILED;
323 static HRESULT WINAPI wbem_services_PutInstanceAsync(
324 IWbemServices *iface,
325 IWbemClassObject *pInst,
326 LONG lFlags,
327 IWbemContext *pCtx,
328 IWbemObjectSink *pResponseHandler )
330 FIXME("\n");
331 return WBEM_E_FAILED;
334 static HRESULT WINAPI wbem_services_DeleteInstance(
335 IWbemServices *iface,
336 const BSTR strObjectPath,
337 LONG lFlags,
338 IWbemContext *pCtx,
339 IWbemCallResult **ppCallResult )
341 FIXME("\n");
342 return WBEM_E_FAILED;
345 static HRESULT WINAPI wbem_services_DeleteInstanceAsync(
346 IWbemServices *iface,
347 const BSTR strObjectPath,
348 LONG lFlags,
349 IWbemContext *pCtx,
350 IWbemObjectSink *pResponseHandler )
352 FIXME("\n");
353 return WBEM_E_FAILED;
356 static HRESULT WINAPI wbem_services_CreateInstanceEnum(
357 IWbemServices *iface,
358 const BSTR strFilter,
359 LONG lFlags,
360 IWbemContext *pCtx,
361 IEnumWbemClassObject **ppEnum )
363 FIXME("\n");
364 return WBEM_E_FAILED;
367 static HRESULT WINAPI wbem_services_CreateInstanceEnumAsync(
368 IWbemServices *iface,
369 const BSTR strFilter,
370 LONG lFlags,
371 IWbemContext *pCtx,
372 IWbemObjectSink *pResponseHandler )
374 FIXME("\n");
375 return WBEM_E_FAILED;
378 static HRESULT WINAPI wbem_services_ExecQuery(
379 IWbemServices *iface,
380 const BSTR strQueryLanguage,
381 const BSTR strQuery,
382 LONG lFlags,
383 IWbemContext *pCtx,
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,
399 const BSTR strQuery,
400 LONG lFlags,
401 IWbemContext *pCtx,
402 IWbemObjectSink *pResponseHandler )
404 FIXME("\n");
405 return WBEM_E_FAILED;
408 static HRESULT WINAPI wbem_services_ExecNotificationQuery(
409 IWbemServices *iface,
410 const BSTR strQueryLanguage,
411 const BSTR strQuery,
412 LONG lFlags,
413 IWbemContext *pCtx,
414 IEnumWbemClassObject **ppEnum )
416 FIXME("\n");
417 return WBEM_E_FAILED;
420 static HRESULT WINAPI wbem_services_ExecNotificationQueryAsync(
421 IWbemServices *iface,
422 const BSTR strQueryLanguage,
423 const BSTR strQuery,
424 LONG lFlags,
425 IWbemContext *pCtx,
426 IWbemObjectSink *pResponseHandler )
428 FIXME("\n");
429 return WBEM_E_FAILED;
432 static HRESULT WINAPI wbem_services_ExecMethod(
433 IWbemServices *iface,
434 const BSTR strObjectPath,
435 const BSTR strMethodName,
436 LONG lFlags,
437 IWbemContext *pCtx,
438 IWbemClassObject *pInParams,
439 IWbemClassObject **ppOutParams,
440 IWbemCallResult **ppCallResult )
442 FIXME("\n");
443 return WBEM_E_FAILED;
446 static HRESULT WINAPI wbem_services_ExecMethodAsync(
447 IWbemServices *iface,
448 const BSTR strObjectPath,
449 const BSTR strMethodName,
450 LONG lFlags,
451 IWbemContext *pCtx,
452 IWbemClassObject *pInParams,
453 IWbemObjectSink *pResponseHandler )
455 FIXME("\n");
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;
499 ws->refs = 1;
501 *ppObj = &ws->IWbemServices_iface;
503 TRACE("returning iface %p\n", *ppObj);
504 return S_OK;