ReactOS  0.4.12-dev-375-g61fed54
services.c
Go to the documentation of this file.
1 /*
2  * Copyright 2012 Hans Leidekker for CodeWeavers
3  *
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.
8  *
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.
13  *
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
17  */
18 
19 #define COBJMACROS
20 
21 #include "config.h"
22 #include <stdarg.h>
23 
24 #include "windef.h"
25 #include "winbase.h"
26 #include "objbase.h"
27 #include "wbemcli.h"
28 
29 #include "wine/debug.h"
30 #include "wine/unicode.h"
31 #include "wbemprox_private.h"
32 
34 
36 {
38 };
39 
41 {
43 }
44 
46  IClientSecurity *iface,
47  REFIID riid,
48  void **ppvObject )
49 {
50  struct client_security *cs = impl_from_IClientSecurity( iface );
51 
52  TRACE("%p %s %p\n", cs, debugstr_guid( riid ), ppvObject );
53 
54  if ( IsEqualGUID( riid, &IID_IClientSecurity ) ||
56  {
57  *ppvObject = cs;
58  }
59  else
60  {
61  FIXME("interface %s not implemented\n", debugstr_guid(riid));
62  return E_NOINTERFACE;
63  }
64  IClientSecurity_AddRef( iface );
65  return S_OK;
66 }
67 
69  IClientSecurity *iface )
70 {
71  FIXME("%p\n", iface);
72  return 2;
73 }
74 
76  IClientSecurity *iface )
77 {
78  FIXME("%p\n", iface);
79  return 1;
80 }
81 
83  IClientSecurity *iface,
84  IUnknown *pProxy,
85  DWORD *pAuthnSvc,
86  DWORD *pAuthzSvc,
87  OLECHAR **pServerPrincName,
88  DWORD *pAuthnLevel,
89  DWORD *pImpLevel,
90  void **pAuthInfo,
91  DWORD *pCapabilities )
92 {
93  FIXME("\n");
94  return WBEM_E_FAILED;
95 }
96 
98  IClientSecurity *iface,
99  IUnknown *pProxy,
100  DWORD AuthnSvc,
101  DWORD AuthzSvc,
102  OLECHAR *pServerPrincName,
103  DWORD AuthnLevel,
104  DWORD ImpLevel,
105  void *pAuthInfo,
107 {
108  static const OLECHAR defaultW[] =
109  {'<','C','O','L','E','_','D','E','F','A','U','L','T','_','P','R','I','N','C','I','P','A','L','>',0};
110  const OLECHAR *princname = (pServerPrincName == COLE_DEFAULT_PRINCIPAL) ? defaultW : pServerPrincName;
111 
112  FIXME("%p, %p, %u, %u, %s, %u, %u, %p, 0x%08x\n", iface, pProxy, AuthnSvc, AuthzSvc,
113  debugstr_w(princname), AuthnLevel, ImpLevel, pAuthInfo, Capabilities);
114  return WBEM_NO_ERROR;
115 }
116 
118  IClientSecurity *iface,
119  IUnknown *pProxy,
120  IUnknown **ppCopy )
121 {
122  FIXME("\n");
123  return WBEM_E_FAILED;
124 }
125 
126 static const IClientSecurityVtbl client_security_vtbl =
127 {
134 };
135 
137 
139 {
141  void (*proc)( struct async_header * );
144 };
145 
147 {
150 };
151 
152 static void free_async( struct async_header *async )
153 {
154  if (async->sink) IWbemObjectSink_Release( async->sink );
155  CloseHandle( async->cancel );
156  CloseHandle( async->wait );
157  heap_free( async );
158 }
159 
161  void (*proc)(struct async_header *) )
162 {
163  if (!(async->wait = CreateEventW( NULL, FALSE, FALSE, NULL ))) return FALSE;
164  if (!(async->cancel = CreateEventW( NULL, FALSE, FALSE, NULL )))
165  {
166  CloseHandle( async->wait );
167  return FALSE;
168  }
169  async->proc = proc;
170  async->sink = sink;
171  IWbemObjectSink_AddRef( sink );
172  return TRUE;
173 }
174 
176 {
177  struct async_header *async = param;
178  HANDLE wait = async->wait;
179 
180  async->proc( async );
181 
183  SetEvent( wait );
184  return ERROR_SUCCESS;
185 }
186 
187 static HRESULT queue_async( struct async_header *async )
188 {
190  return HRESULT_FROM_WIN32( GetLastError() );
191 }
192 
194 {
198  WCHAR *namespace;
200 };
201 
202 static inline struct wbem_services *impl_from_IWbemServices( IWbemServices *iface )
203 {
204  return CONTAINING_RECORD( iface, struct wbem_services, IWbemServices_iface );
205 }
206 
208  IWbemServices *iface )
209 {
210  struct wbem_services *ws = impl_from_IWbemServices( iface );
211  return InterlockedIncrement( &ws->refs );
212 }
213 
215  IWbemServices *iface )
216 {
217  struct wbem_services *ws = impl_from_IWbemServices( iface );
218  LONG refs = InterlockedDecrement( &ws->refs );
219  if (!refs)
220  {
221  TRACE("destroying %p\n", ws);
222 
223  EnterCriticalSection( &ws->cs );
224  if (ws->async) SetEvent( ws->async->cancel );
225  LeaveCriticalSection( &ws->cs );
226  if (ws->async)
227  {
228  WaitForSingleObject( ws->async->wait, INFINITE );
229  free_async( ws->async );
230  }
231  ws->cs.DebugInfo->Spare[0] = 0;
232  DeleteCriticalSection( &ws->cs );
233  heap_free( ws->namespace );
234  heap_free( ws );
235  }
236  return refs;
237 }
238 
240  IWbemServices *iface,
241  REFIID riid,
242  void **ppvObject )
243 {
244  struct wbem_services *ws = impl_from_IWbemServices( iface );
245 
246  TRACE("%p %s %p\n", ws, debugstr_guid( riid ), ppvObject );
247 
248  if ( IsEqualGUID( riid, &IID_IWbemServices ) ||
250  {
251  *ppvObject = ws;
252  }
253  else if ( IsEqualGUID( riid, &IID_IClientSecurity ) )
254  {
256  return S_OK;
257  }
258  else
259  {
260  FIXME("interface %s not implemented\n", debugstr_guid(riid));
261  return E_NOINTERFACE;
262  }
263  IWbemServices_AddRef( iface );
264  return S_OK;
265 }
266 
268  IWbemServices *iface,
269  const BSTR strNamespace,
270  LONG lFlags,
271  IWbemContext *pCtx,
272  IWbemServices **ppWorkingNamespace,
273  IWbemCallResult **ppResult )
274 {
275  static const WCHAR cimv2W[] = {'c','i','m','v','2',0};
276  static const WCHAR defaultW[] = {'d','e','f','a','u','l','t',0};
277  struct wbem_services *ws = impl_from_IWbemServices( iface );
278 
279  TRACE("%p, %s, 0x%08x, %p, %p, %p\n", iface, debugstr_w(strNamespace), lFlags,
280  pCtx, ppWorkingNamespace, ppResult);
281 
282  if ((strcmpiW( strNamespace, cimv2W ) && strcmpiW( strNamespace, defaultW )) || ws->namespace)
284 
285  return WbemServices_create( cimv2W, (void **)ppWorkingNamespace );
286 }
287 
289  IWbemServices *iface,
290  IWbemObjectSink *pSink )
291 {
293  struct async_header *async;
294 
295  TRACE("%p, %p\n", iface, pSink);
296 
297  if (!pSink) return WBEM_E_INVALID_PARAMETER;
298 
300 
301  if (!(async = services->async))
302  {
305  }
306  services->async = NULL;
307  SetEvent( async->cancel );
308 
310 
311  WaitForSingleObject( async->wait, INFINITE );
312  free_async( async );
313  return S_OK;
314 }
315 
317  IWbemServices *iface,
318  LONG lFlags,
319  IWbemObjectSink **ppResponseHandler )
320 {
321  FIXME("\n");
322  return WBEM_E_FAILED;
323 }
324 
325 struct path
326 {
327  WCHAR *class;
331 };
332 
333 static HRESULT parse_path( const WCHAR *str, struct path **ret )
334 {
335  struct path *path;
336  const WCHAR *p = str, *q;
337  UINT len;
338 
339  if (!(path = heap_alloc_zero( sizeof(*path) ))) return E_OUTOFMEMORY;
340 
341  while (*p && *p != '.') p++;
342 
343  len = p - str;
344  if (!(path->class = heap_alloc( (len + 1) * sizeof(WCHAR) )))
345  {
346  heap_free( path );
347  return E_OUTOFMEMORY;
348  }
349  memcpy( path->class, str, len * sizeof(WCHAR) );
350  path->class[len] = 0;
351  path->class_len = len;
352 
353  if (p[0] == '.' && p[1])
354  {
355  q = ++p;
356  while (*q) q++;
357 
358  len = q - p;
359  if (!(path->filter = heap_alloc( (len + 1) * sizeof(WCHAR) )))
360  {
361  heap_free( path->class );
362  heap_free( path );
363  return E_OUTOFMEMORY;
364  }
365  memcpy( path->filter, p, len * sizeof(WCHAR) );
366  path->filter[len] = 0;
367  path->filter_len = len;
368  }
369  *ret = path;
370  return S_OK;
371 }
372 
373 static void free_path( struct path *path )
374 {
375  heap_free( path->class );
376  heap_free( path->filter );
377  heap_free( path );
378 }
379 
380 static WCHAR *query_from_path( const struct path *path )
381 {
382  static const WCHAR selectW[] =
383  {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','%','s',' ',
384  'W','H','E','R','E',' ','%','s',0};
385  static const WCHAR select_allW[] =
386  {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',0};
387  WCHAR *query;
388  UINT len;
389 
390  if (path->filter)
391  {
393  if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return NULL;
395  }
396  else
397  {
398  len = path->class_len + SIZEOF(select_allW);
399  if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return NULL;
400  strcpyW( query, select_allW );
401  strcatW( query, path->class );
402  }
403  return query;
404 }
405 
407 {
408  WCHAR *query;
409  HRESULT hr;
410 
411  if (!(query = query_from_path( path ))) return E_OUTOFMEMORY;
412  hr = exec_query( query, iter );
413  heap_free( query );
414  return hr;
415 }
416 
417 HRESULT get_object( const WCHAR *object_path, IWbemClassObject **obj )
418 {
419  IEnumWbemClassObject *iter;
420  struct path *path;
421  HRESULT hr;
422 
423  hr = parse_path( object_path, &path );
424  if (hr != S_OK) return hr;
425 
426  hr = create_instance_enum( path, &iter );
427  if (hr != S_OK)
428  {
429  free_path( path );
430  return hr;
431  }
432  hr = create_class_object( path->class, iter, 0, NULL, obj );
433  IEnumWbemClassObject_Release( iter );
434  free_path( path );
435  return hr;
436 }
437 
439  IWbemServices *iface,
440  const BSTR strObjectPath,
441  LONG lFlags,
442  IWbemContext *pCtx,
443  IWbemClassObject **ppObject,
444  IWbemCallResult **ppCallResult )
445 {
446  TRACE("%p, %s, 0x%08x, %p, %p, %p\n", iface, debugstr_w(strObjectPath), lFlags,
447  pCtx, ppObject, ppCallResult);
448 
449  if (lFlags) FIXME("unsupported flags 0x%08x\n", lFlags);
450 
451  if (!strObjectPath || !strObjectPath[0])
452  return create_class_object( NULL, NULL, 0, NULL, ppObject );
453 
454  return get_object( strObjectPath, ppObject );
455 }
456 
458  IWbemServices *iface,
459  const BSTR strObjectPath,
460  LONG lFlags,
461  IWbemContext *pCtx,
462  IWbemObjectSink *pResponseHandler )
463 {
464  FIXME("\n");
465  return WBEM_E_FAILED;
466 }
467 
469  IWbemServices *iface,
470  IWbemClassObject *pObject,
471  LONG lFlags,
472  IWbemContext *pCtx,
473  IWbemCallResult **ppCallResult )
474 {
475  FIXME("\n");
476  return WBEM_E_FAILED;
477 }
478 
480  IWbemServices *iface,
481  IWbemClassObject *pObject,
482  LONG lFlags,
483  IWbemContext *pCtx,
484  IWbemObjectSink *pResponseHandler )
485 {
486  FIXME("\n");
487  return WBEM_E_FAILED;
488 }
489 
491  IWbemServices *iface,
492  const BSTR strClass,
493  LONG lFlags,
494  IWbemContext *pCtx,
495  IWbemCallResult **ppCallResult )
496 {
497  FIXME("\n");
498  return WBEM_E_FAILED;
499 }
500 
502  IWbemServices *iface,
503  const BSTR strClass,
504  LONG lFlags,
505  IWbemContext *pCtx,
506  IWbemObjectSink *pResponseHandler )
507 {
508  FIXME("\n");
509  return WBEM_E_FAILED;
510 }
511 
513  IWbemServices *iface,
514  const BSTR strSuperclass,
515  LONG lFlags,
516  IWbemContext *pCtx,
517  IEnumWbemClassObject **ppEnum )
518 {
519  FIXME("\n");
520  return WBEM_E_FAILED;
521 }
522 
524  IWbemServices *iface,
525  const BSTR strSuperclass,
526  LONG lFlags,
527  IWbemContext *pCtx,
528  IWbemObjectSink *pResponseHandler )
529 {
530  FIXME("\n");
531  return WBEM_E_FAILED;
532 }
533 
535  IWbemServices *iface,
536  IWbemClassObject *pInst,
537  LONG lFlags,
538  IWbemContext *pCtx,
539  IWbemCallResult **ppCallResult )
540 {
541  FIXME("\n");
542  return WBEM_E_FAILED;
543 }
544 
546  IWbemServices *iface,
547  IWbemClassObject *pInst,
548  LONG lFlags,
549  IWbemContext *pCtx,
550  IWbemObjectSink *pResponseHandler )
551 {
552  FIXME("\n");
553  return WBEM_E_FAILED;
554 }
555 
557  IWbemServices *iface,
558  const BSTR strObjectPath,
559  LONG lFlags,
560  IWbemContext *pCtx,
561  IWbemCallResult **ppCallResult )
562 {
563  FIXME("\n");
564  return WBEM_E_FAILED;
565 }
566 
568  IWbemServices *iface,
569  const BSTR strObjectPath,
570  LONG lFlags,
571  IWbemContext *pCtx,
572  IWbemObjectSink *pResponseHandler )
573 {
574  FIXME("\n");
575  return WBEM_E_FAILED;
576 }
577 
579  IWbemServices *iface,
580  const BSTR strClass,
581  LONG lFlags,
582  IWbemContext *pCtx,
583  IEnumWbemClassObject **ppEnum )
584 {
585  struct path *path;
586  HRESULT hr;
587 
588  TRACE("%p, %s, 0%08x, %p, %p\n", iface, debugstr_w(strClass), lFlags, pCtx, ppEnum);
589 
590  if (lFlags) FIXME("unsupported flags 0x%08x\n", lFlags);
591 
592  hr = parse_path( strClass, &path );
593  if (hr != S_OK) return hr;
594 
595  hr = create_instance_enum( path, ppEnum );
596  free_path( path );
597  return hr;
598 }
599 
601  IWbemServices *iface,
602  const BSTR strFilter,
603  LONG lFlags,
604  IWbemContext *pCtx,
605  IWbemObjectSink *pResponseHandler )
606 {
607  FIXME("\n");
608  return WBEM_E_FAILED;
609 }
610 
612  IWbemServices *iface,
613  const BSTR strQueryLanguage,
614  const BSTR strQuery,
615  LONG lFlags,
616  IWbemContext *pCtx,
617  IEnumWbemClassObject **ppEnum )
618 {
619  static const WCHAR wqlW[] = {'W','Q','L',0};
620 
621  TRACE("%p, %s, %s, 0x%08x, %p, %p\n", iface, debugstr_w(strQueryLanguage),
622  debugstr_w(strQuery), lFlags, pCtx, ppEnum);
623 
624  if (!strQueryLanguage || !strQuery || !strQuery[0]) return WBEM_E_INVALID_PARAMETER;
625  if (strcmpiW( strQueryLanguage, wqlW )) return WBEM_E_INVALID_QUERY_TYPE;
626  return exec_query( strQuery, ppEnum );
627 }
628 
629 static void async_exec_query( struct async_header *hdr )
630 {
631  struct async_query *query = (struct async_query *)hdr;
634  ULONG count;
635  HRESULT hr;
636 
637  hr = exec_query( query->str, &result );
638  if (hr == S_OK)
639  {
640  for (;;)
641  {
642  IEnumWbemClassObject_Next( result, WBEM_INFINITE, 1, &obj, &count );
643  if (!count) break;
644  IWbemObjectSink_Indicate( query->hdr.sink, 1, &obj );
645  IWbemClassObject_Release( obj );
646  }
647  IEnumWbemClassObject_Release( result );
648  }
649  IWbemObjectSink_SetStatus( query->hdr.sink, WBEM_STATUS_COMPLETE, hr, NULL, NULL );
650  heap_free( query->str );
651 }
652 
654  IWbemServices *iface,
655  const BSTR strQueryLanguage,
656  const BSTR strQuery,
657  LONG lFlags,
658  IWbemContext *pCtx,
659  IWbemObjectSink *pResponseHandler )
660 {
663  HRESULT hr = E_OUTOFMEMORY;
664  struct async_header *async;
665  struct async_query *query;
666 
667  TRACE("%p, %s, %s, 0x%08x, %p, %p\n", iface, debugstr_w(strQueryLanguage), debugstr_w(strQuery),
668  lFlags, pCtx, pResponseHandler);
669 
670  if (!pResponseHandler) return WBEM_E_INVALID_PARAMETER;
671 
672  hr = IWbemObjectSink_QueryInterface( pResponseHandler, &IID_IWbemObjectSink, (void **)&sink );
673  if (FAILED(hr)) return hr;
674 
676 
677  if (services->async)
678  {
679  FIXME("handle more than one pending async\n");
680  hr = WBEM_E_FAILED;
681  goto done;
682  }
683  if (!(query = heap_alloc_zero( sizeof(*query) ))) goto done;
684  async = (struct async_header *)query;
685 
686  if (!(init_async( async, sink, async_exec_query )))
687  {
688  free_async( async );
689  goto done;
690  }
691  if (!(query->str = heap_strdupW( strQuery )))
692  {
693  free_async( async );
694  goto done;
695  }
696  hr = queue_async( async );
697  if (hr == S_OK) services->async = async;
698  else
699  {
700  heap_free( query->str );
701  free_async( async );
702  }
703 
704 done:
706  IWbemObjectSink_Release( sink );
707  return hr;
708 }
709 
711  IWbemServices *iface,
712  const BSTR strQueryLanguage,
713  const BSTR strQuery,
714  LONG lFlags,
715  IWbemContext *pCtx,
716  IEnumWbemClassObject **ppEnum )
717 {
718  FIXME("\n");
719  return WBEM_E_FAILED;
720 }
721 
723  IWbemServices *iface,
724  const BSTR strQueryLanguage,
725  const BSTR strQuery,
726  LONG lFlags,
727  IWbemContext *pCtx,
728  IWbemObjectSink *pResponseHandler )
729 {
732  HRESULT hr = E_OUTOFMEMORY;
733  struct async_header *async;
734  struct async_query *query;
735 
736  TRACE("%p, %s, %s, 0x%08x, %p, %p\n", iface, debugstr_w(strQueryLanguage), debugstr_w(strQuery),
737  lFlags, pCtx, pResponseHandler);
738 
739  if (!pResponseHandler) return WBEM_E_INVALID_PARAMETER;
740 
741  hr = IWbemObjectSink_QueryInterface( pResponseHandler, &IID_IWbemObjectSink, (void **)&sink );
742  if (FAILED(hr)) return hr;
743 
745 
746  if (services->async)
747  {
748  FIXME("handle more than one pending async\n");
749  hr = WBEM_E_FAILED;
750  goto done;
751  }
752  if (!(query = heap_alloc_zero( sizeof(*query) ))) goto done;
753  async = (struct async_header *)query;
754 
755  if (!(init_async( async, sink, async_exec_query )))
756  {
757  free_async( async );
758  goto done;
759  }
760  if (!(query->str = heap_strdupW( strQuery )))
761  {
762  free_async( async );
763  goto done;
764  }
765  hr = queue_async( async );
766  if (hr == S_OK) services->async = async;
767  else
768  {
769  heap_free( query->str );
770  free_async( async );
771  }
772 
773 done:
775  IWbemObjectSink_Release( sink );
776  return hr;
777 }
778 
780  IWbemServices *iface,
781  const BSTR strObjectPath,
782  const BSTR strMethodName,
783  LONG lFlags,
784  IWbemContext *pCtx,
785  IWbemClassObject *pInParams,
786  IWbemClassObject **ppOutParams,
787  IWbemCallResult **ppCallResult )
788 {
791  struct query *query = NULL;
792  struct path *path;
793  WCHAR *str;
795  HRESULT hr;
796 
797  TRACE("%p, %s, %s, %08x, %p, %p, %p, %p\n", iface, debugstr_w(strObjectPath),
798  debugstr_w(strMethodName), lFlags, pCtx, pInParams, ppOutParams, ppCallResult);
799 
800  if (lFlags) FIXME("flags %08x not supported\n", lFlags);
801 
802  if ((hr = parse_path( strObjectPath, &path )) != S_OK) return hr;
803  if (!(str = query_from_path( path )))
804  {
805  hr = E_OUTOFMEMORY;
806  goto done;
807  }
808  if (!(query = create_query()))
809  {
810  hr = E_OUTOFMEMORY;
811  goto done;
812  }
813  hr = parse_query( str, &query->view, &query->mem );
814  if (hr != S_OK) goto done;
815 
816  hr = execute_view( query->view );
817  if (hr != S_OK) goto done;
818 
819  hr = EnumWbemClassObject_create( query, (void **)&result );
820  if (hr != S_OK) goto done;
821 
822  hr = create_class_object( query->view->table->name, result, 0, NULL, &obj );
823  if (hr != S_OK) goto done;
824 
825  hr = get_method( query->view->table, strMethodName, &func );
826  if (hr != S_OK) goto done;
827 
828  hr = func( obj, pInParams, ppOutParams );
829 
830 done:
831  if (result) IEnumWbemClassObject_Release( result );
832  if (obj) IWbemClassObject_Release( obj );
833  free_query( query );
834  free_path( path );
835  heap_free( str );
836  return hr;
837 }
838 
840  IWbemServices *iface,
841  const BSTR strObjectPath,
842  const BSTR strMethodName,
843  LONG lFlags,
844  IWbemContext *pCtx,
845  IWbemClassObject *pInParams,
846  IWbemObjectSink *pResponseHandler )
847 {
848  FIXME("\n");
849  return WBEM_E_FAILED;
850 }
851 
852 static const IWbemServicesVtbl wbem_services_vtbl =
853 {
880 };
881 
882 HRESULT WbemServices_create( const WCHAR *namespace, LPVOID *ppObj )
883 {
884  struct wbem_services *ws;
885 
886  TRACE("(%p)\n", ppObj);
887 
888  ws = heap_alloc( sizeof(*ws) );
889  if (!ws) return E_OUTOFMEMORY;
890 
891  ws->IWbemServices_iface.lpVtbl = &wbem_services_vtbl;
892  ws->refs = 1;
893  ws->namespace = heap_strdupW( namespace );
894  ws->async = NULL;
896  ws->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": wbemprox_services.cs");
897 
898  *ppObj = &ws->IWbemServices_iface;
899 
900  TRACE("returning iface %p\n", *ppObj);
901  return S_OK;
902 }
GLenum func
Definition: glext.h:6028
WCHAR OLECHAR
Definition: compat.h:1926
static HRESULT WINAPI wbem_services_DeleteClassAsync(IWbemServices *iface, const BSTR strClass, LONG lFlags, IWbemContext *pCtx, IWbemObjectSink *pResponseHandler)
Definition: services.c:501
WCHAR * filter
Definition: services.c:329
void free_query(struct query *query)
Definition: query.c:450
static HRESULT WINAPI wbem_services_ExecNotificationQueryAsync(IWbemServices *iface, const BSTR strQueryLanguage, const BSTR strQuery, LONG lFlags, IWbemContext *pCtx, IWbemObjectSink *pResponseHandler)
Definition: services.c:722
#define REFIID
Definition: guiddef.h:113
#define TRUE
Definition: types.h:120
const char * ws
Definition: skip_ws.cpp:7
#define CloseHandle
Definition: compat.h:398
char hdr[14]
Definition: iptest.cpp:33
#define E_NOINTERFACE
Definition: winerror.h:2364
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
#define ERROR_SUCCESS
Definition: deptool.c:10
#define DWORD_PTR
Definition: treelist.c:76
static HRESULT WINAPI wbem_services_GetObjectAsync(IWbemServices *iface, const BSTR strObjectPath, LONG lFlags, IWbemContext *pCtx, IWbemObjectSink *pResponseHandler)
Definition: services.c:457
static HRESULT WINAPI wbem_services_DeleteClass(IWbemServices *iface, const BSTR strClass, LONG lFlags, IWbemContext *pCtx, IWbemCallResult **ppCallResult)
Definition: services.c:490
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLsizei const GLchar ** path
Definition: glext.h:7234
REFIID riid
Definition: precomp.h:44
static ULONG WINAPI client_security_AddRef(IClientSecurity *iface)
Definition: services.c:68
GLuint GLuint GLsizei count
Definition: gl.h:1545
static const IClientSecurityVtbl client_security_vtbl
Definition: services.c:126
static const WCHAR defaultW[]
Definition: lex.c:41
static HRESULT WINAPI wbem_services_CancelAsyncCall(IWbemServices *iface, IWbemObjectSink *pSink)
Definition: services.c:288
static HRESULT WINAPI client_security_QueryBlanket(IClientSecurity *iface, IUnknown *pProxy, DWORD *pAuthnSvc, DWORD *pAuthzSvc, OLECHAR **pServerPrincName, DWORD *pAuthnLevel, DWORD *pImpLevel, void **pAuthInfo, DWORD *pCapabilities)
Definition: services.c:82
#define CALLBACK
Definition: compat.h:27
static HRESULT WINAPI wbem_services_QueryObjectSink(IWbemServices *iface, LONG lFlags, IWbemObjectSink **ppResponseHandler)
Definition: services.c:316
HRESULT EnumWbemClassObject_create(struct query *query, LPVOID *ppObj)
Definition: class.c:195
WCHAR * str
Definition: services.c:149
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:679
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static HRESULT WINAPI wbem_services_ExecMethod(IWbemServices *iface, const BSTR strObjectPath, const BSTR strMethodName, LONG lFlags, IWbemContext *pCtx, IWbemClassObject *pInParams, IWbemClassObject **ppOutParams, IWbemCallResult **ppCallResult)
Definition: services.c:779
IClientSecurity IClientSecurity_iface
Definition: services.c:37
static HANDLE proc()
Definition: pdb.c:31
OLECHAR * BSTR
Definition: compat.h:1927
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static HRESULT WINAPI wbem_services_ExecMethodAsync(IWbemServices *iface, const BSTR strObjectPath, const BSTR strMethodName, LONG lFlags, IWbemContext *pCtx, IWbemClassObject *pInParams, IWbemObjectSink *pResponseHandler)
Definition: services.c:839
GLsizei GLenum GLboolean sink
Definition: glext.h:5672
static ULONG WINAPI client_security_Release(IClientSecurity *iface)
Definition: services.c:75
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:597
UINT class_len
Definition: services.c:328
GLsizei GLsizei GLuint * obj
Definition: glext.h:6042
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
static ULONG WINAPI wbem_services_AddRef(IWbemServices *iface)
Definition: services.c:207
uint32_t cs
Definition: isohybrid.c:75
HRESULT get_object(const WCHAR *object_path, IWbemClassObject **obj)
Definition: services.c:417
#define SIZEOF(_ar)
Definition: calc.h:48
static HRESULT WINAPI wbem_services_CreateClassEnumAsync(IWbemServices *iface, const BSTR strSuperclass, LONG lFlags, IWbemContext *pCtx, IWbemObjectSink *pResponseHandler)
Definition: services.c:523
static HRESULT parse_path(const WCHAR *str, struct path **ret)
Definition: services.c:333
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
_Must_inspect_result_ typedef _Out_ PHIDP_CAPS Capabilities
Definition: hidclass.h:103
long LONG
Definition: pedump.c:60
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
#define debugstr_w
Definition: kernel32.h:32
static HRESULT WINAPI client_security_QueryInterface(IClientSecurity *iface, REFIID riid, void **ppvObject)
Definition: services.c:45
static BOOL parse_query(const WCHAR **ptr, parse_data *data, DWORD flags)
Definition: uri.c:2045
#define FIXME(fmt,...)
Definition: debug.h:110
static const WCHAR wqlW[]
Definition: query.c:30
const WCHAR * str
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:697
smooth NULL
Definition: ftsmooth.c:416
struct async_header hdr
Definition: services.c:148
WINE_DEFAULT_DEBUG_CHANNEL(wbemprox)
#define debugstr_guid
Definition: kernel32.h:35
static WCHAR * query_from_path(const struct path *path)
Definition: services.c:380
static HRESULT WINAPI client_security_CopyProxy(IClientSecurity *iface, IUnknown *pProxy, IUnknown **ppCopy)
Definition: services.c:117
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
HRESULT execute_view(struct view *view)
Definition: query.c:405
static HRESULT WINAPI wbem_services_PutClassAsync(IWbemServices *iface, IWbemClassObject *pObject, LONG lFlags, IWbemContext *pCtx, IWbemObjectSink *pResponseHandler)
Definition: services.c:479
static ULONG WINAPI wbem_services_Release(IWbemServices *iface)
Definition: services.c:214
static HRESULT create_instance_enum(const struct path *path, IEnumWbemClassObject **iter)
Definition: services.c:406
#define WT_EXECUTELONGFUNCTION
Definition: winnt_old.h:1076
#define TRACE(s)
Definition: solgame.cpp:4
unsigned int BOOL
Definition: ntddk_ex.h:94
UINT filter_len
Definition: services.c:330
WCHAR * class
Definition: services.c:327
static const WCHAR selectW[]
Definition: htmlelem.c:38
static void async_exec_query(struct async_header *hdr)
Definition: services.c:629
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
LONG HRESULT
Definition: typedefs.h:77
static HRESULT WINAPI wbem_services_CreateInstanceEnumAsync(IWbemServices *iface, const BSTR strFilter, LONG lFlags, IWbemContext *pCtx, IWbemObjectSink *pResponseHandler)
Definition: services.c:600
const GUID IID_IUnknown
static HRESULT WINAPI wbem_services_CreateInstanceEnum(IWbemServices *iface, const BSTR strClass, LONG lFlags, IWbemContext *pCtx, IEnumWbemClassObject **ppEnum)
Definition: services.c:578
GLfloat param
Definition: glext.h:5796
unsigned int UINT
Definition: ndis.h:50
void(* proc)(struct async_header *)
Definition: services.c:141
unsigned long DWORD
Definition: ntddk_ex.h:95
IWbemObjectSink * sink
Definition: services.c:140
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
HRESULT WbemServices_create(const WCHAR *namespace, LPVOID *ppObj)
Definition: services.c:882
static HRESULT WINAPI wbem_services_OpenNamespace(IWbemServices *iface, const BSTR strNamespace, LONG lFlags, IWbemContext *pCtx, IWbemServices **ppWorkingNamespace, IWbemCallResult **ppResult)
Definition: services.c:267
static const IWbemServicesVtbl wbem_services_vtbl
Definition: services.c:852
static HRESULT WINAPI wbem_services_DeleteInstance(IWbemServices *iface, const BSTR strObjectPath, LONG lFlags, IWbemContext *pCtx, IWbemCallResult **ppCallResult)
Definition: services.c:556
BOOL WINAPI QueueUserWorkItem(IN LPTHREAD_START_ROUTINE Function, IN PVOID Context, IN ULONG Flags)
Definition: thread.c:999
int ret
IClientSecurity client_security
Definition: services.c:136
static HRESULT WINAPI wbem_services_ExecNotificationQuery(IWbemServices *iface, const BSTR strQueryLanguage, const BSTR strQuery, LONG lFlags, IWbemContext *pCtx, IEnumWbemClassObject **ppEnum)
Definition: services.c:710
#define InterlockedDecrement
Definition: armddk.h:52
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
REFIID LPVOID * ppvObject
Definition: precomp.h:44
static HRESULT WINAPI wbem_services_CreateClassEnum(IWbemServices *iface, const BSTR strSuperclass, LONG lFlags, IWbemContext *pCtx, IEnumWbemClassObject **ppEnum)
Definition: services.c:512
struct async_header * async
Definition: services.c:199
#define WINAPI
Definition: msvc.h:20
HRESULT() class_method(IWbemClassObject *, IWbemClassObject *, IWbemClassObject **)
#define strcmpiW(s1, s2)
Definition: unicode.h:39
static BOOL init_async(struct async_header *async, IWbemObjectSink *sink, void(*proc)(struct async_header *))
Definition: services.c:160
struct list mem
static struct client_security * impl_from_IClientSecurity(IClientSecurity *iface)
Definition: services.c:40
IWbemServices IWbemServices_iface
Definition: services.c:195
#define S_OK
Definition: intsafe.h:59
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
#define InterlockedIncrement
Definition: armddk.h:53
HRESULT create_class_object(const WCHAR *name, IEnumWbemClassObject *iter, UINT index, struct record *record, IWbemClassObject **obj)
Definition: class.c:1014
Definition: services.c:325
#define sprintfW
Definition: unicode.h:58
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
static HRESULT WINAPI wbem_services_PutInstance(IWbemServices *iface, IWbemClassObject *pInst, LONG lFlags, IWbemContext *pCtx, IWbemCallResult **ppCallResult)
Definition: services.c:534
struct view * view
HRESULT exec_query(const WCHAR *str, IEnumWbemClassObject **result)
Definition: query.c:471
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4024
static void free_path(struct path *path)
Definition: services.c:373
static struct query * create_query(void)
Definition: pdh_main.c:149
static HRESULT WINAPI wbem_services_PutInstanceAsync(IWbemServices *iface, IWbemClassObject *pInst, LONG lFlags, IWbemContext *pCtx, IWbemObjectSink *pResponseHandler)
Definition: services.c:545
static HRESULT WINAPI wbem_services_GetObject(IWbemServices *iface, const BSTR strObjectPath, LONG lFlags, IWbemContext *pCtx, IWbemClassObject **ppObject, IWbemCallResult **ppCallResult)
Definition: services.c:438
static void free_async(struct async_header *async)
Definition: services.c:152
static HRESULT WINAPI wbem_services_ExecQuery(IWbemServices *iface, const BSTR strQueryLanguage, const BSTR strQuery, LONG lFlags, IWbemContext *pCtx, IEnumWbemClassObject **ppEnum)
Definition: services.c:611
HRESULT get_method(const struct table *table, const WCHAR *name, class_method **func)
Definition: table.c:258
static HRESULT WINAPI wbem_services_DeleteInstanceAsync(IWbemServices *iface, const BSTR strObjectPath, LONG lFlags, IWbemContext *pCtx, IWbemObjectSink *pResponseHandler)
Definition: services.c:567
unsigned int ULONG
Definition: retypes.h:1
static DWORD CALLBACK async_proc(LPVOID param)
Definition: services.c:175
HANDLE cancel
Definition: services.c:142
static struct wbem_services * impl_from_IWbemServices(IWbemServices *iface)
Definition: services.c:202
static HRESULT WINAPI wbem_services_QueryInterface(IWbemServices *iface, REFIID riid, void **ppvObject)
Definition: services.c:239
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
static HRESULT WINAPI wbem_services_PutClass(IWbemServices *iface, IWbemClassObject *pObject, LONG lFlags, IWbemContext *pCtx, IWbemCallResult **ppCallResult)
Definition: services.c:468
GLfloat GLfloat p
Definition: glext.h:8902
static HRESULT queue_async(struct async_header *async)
Definition: services.c:187
#define INFINITE
Definition: serial.h:102
GLuint64EXT * result
Definition: glext.h:11304
CRITICAL_SECTION cs
Definition: services.c:197
GLenum query
Definition: glext.h:7781
HANDLE wait
Definition: services.c:143
static HRESULT WINAPI client_security_SetBlanket(IClientSecurity *iface, IUnknown *pProxy, DWORD AuthnSvc, DWORD AuthzSvc, OLECHAR *pServerPrincName, DWORD AuthnLevel, DWORD ImpLevel, void *pAuthInfo, DWORD Capabilities)
Definition: services.c:97
static HRESULT WINAPI wbem_services_ExecQueryAsync(IWbemServices *iface, const BSTR strQueryLanguage, const BSTR strQuery, LONG lFlags, IWbemContext *pCtx, IWbemObjectSink *pResponseHandler)
Definition: services.c:653
static BOOL heap_free(void *mem)
Definition: appwiz.h:75