ReactOS  0.4.15-dev-1177-g6cb3b62
class.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "wbemcli.h"
#include "wine/debug.h"
#include "wbemprox_private.h"
Include dependency graph for class.c:

Go to the source code of this file.

Classes

struct  enum_class_object
 
struct  class_object
 

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wbemprox)
 
static struct enum_class_objectimpl_from_IEnumWbemClassObject (IEnumWbemClassObject *iface)
 
static ULONG WINAPI enum_class_object_AddRef (IEnumWbemClassObject *iface)
 
static ULONG WINAPI enum_class_object_Release (IEnumWbemClassObject *iface)
 
static HRESULT WINAPI enum_class_object_QueryInterface (IEnumWbemClassObject *iface, REFIID riid, void **ppvObject)
 
static HRESULT WINAPI enum_class_object_Reset (IEnumWbemClassObject *iface)
 
static HRESULT WINAPI enum_class_object_Next (IEnumWbemClassObject *iface, LONG lTimeout, ULONG uCount, IWbemClassObject **apObjects, ULONG *puReturned)
 
static HRESULT WINAPI enum_class_object_NextAsync (IEnumWbemClassObject *iface, ULONG uCount, IWbemObjectSink *pSink)
 
static HRESULT WINAPI enum_class_object_Clone (IEnumWbemClassObject *iface, IEnumWbemClassObject **ppEnum)
 
static HRESULT WINAPI enum_class_object_Skip (IEnumWbemClassObject *iface, LONG lTimeout, ULONG nCount)
 
HRESULT EnumWbemClassObject_create (struct query *query, LPVOID *ppObj)
 
static struct recordcreate_record (struct table *table)
 
void destroy_array (struct array *array, CIMTYPE type)
 
static void destroy_record (struct record *record)
 
static struct class_objectimpl_from_IWbemClassObject (IWbemClassObject *iface)
 
static ULONG WINAPI class_object_AddRef (IWbemClassObject *iface)
 
static ULONG WINAPI class_object_Release (IWbemClassObject *iface)
 
static HRESULT WINAPI class_object_QueryInterface (IWbemClassObject *iface, REFIID riid, void **ppvObject)
 
static HRESULT WINAPI class_object_GetQualifierSet (IWbemClassObject *iface, IWbemQualifierSet **ppQualSet)
 
static HRESULT record_get_value (const struct record *record, UINT index, VARIANT *var, CIMTYPE *type)
 
static HRESULT WINAPI class_object_Get (IWbemClassObject *iface, LPCWSTR wszName, LONG lFlags, VARIANT *pVal, CIMTYPE *pType, LONG *plFlavor)
 
static HRESULT record_set_value (struct record *record, UINT index, VARIANT *var)
 
static HRESULT WINAPI class_object_Put (IWbemClassObject *iface, LPCWSTR wszName, LONG lFlags, VARIANT *pVal, CIMTYPE Type)
 
static HRESULT WINAPI class_object_Delete (IWbemClassObject *iface, LPCWSTR wszName)
 
static HRESULT WINAPI class_object_GetNames (IWbemClassObject *iface, LPCWSTR wszQualifierName, LONG lFlags, VARIANT *pQualifierVal, SAFEARRAY **pNames)
 
static HRESULT WINAPI class_object_BeginEnumeration (IWbemClassObject *iface, LONG lEnumFlags)
 
static HRESULT WINAPI class_object_Next (IWbemClassObject *iface, LONG lFlags, BSTR *strName, VARIANT *pVal, CIMTYPE *pType, LONG *plFlavor)
 
static HRESULT WINAPI class_object_EndEnumeration (IWbemClassObject *iface)
 
static HRESULT WINAPI class_object_GetPropertyQualifierSet (IWbemClassObject *iface, LPCWSTR wszProperty, IWbemQualifierSet **ppQualSet)
 
static HRESULT WINAPI class_object_Clone (IWbemClassObject *iface, IWbemClassObject **ppCopy)
 
static BSTR get_body_text (const struct table *table, UINT row, UINT *len)
 
static BSTR get_object_text (const struct view *view, UINT index)
 
static HRESULT WINAPI class_object_GetObjectText (IWbemClassObject *iface, LONG lFlags, BSTR *pstrObjectText)
 
static HRESULT WINAPI class_object_SpawnDerivedClass (IWbemClassObject *iface, LONG lFlags, IWbemClassObject **ppNewClass)
 
static HRESULT WINAPI class_object_SpawnInstance (IWbemClassObject *iface, LONG lFlags, IWbemClassObject **ppNewInstance)
 
static HRESULT WINAPI class_object_CompareTo (IWbemClassObject *iface, LONG lFlags, IWbemClassObject *pCompareTo)
 
static HRESULT WINAPI class_object_GetPropertyOrigin (IWbemClassObject *iface, LPCWSTR wszName, BSTR *pstrClassName)
 
static HRESULT WINAPI class_object_InheritsFrom (IWbemClassObject *iface, LPCWSTR strAncestor)
 
static UINT count_instances (IEnumWbemClassObject *iter)
 
static void set_default_value (CIMTYPE type, UINT val, BYTE *ptr)
 
static HRESULT create_signature_columns_and_data (IEnumWbemClassObject *iter, UINT *num_cols, struct column **cols, BYTE **data)
 
static HRESULT create_signature_table (IEnumWbemClassObject *iter, WCHAR *name)
 
static WCHARbuild_signature_table_name (const WCHAR *class, const WCHAR *method, enum param_direction dir)
 
HRESULT create_signature (const WCHAR *class, const WCHAR *method, enum param_direction dir, IWbemClassObject **sig)
 
static HRESULT WINAPI class_object_GetMethod (IWbemClassObject *iface, LPCWSTR wszName, LONG lFlags, IWbemClassObject **ppInSignature, IWbemClassObject **ppOutSignature)
 
static HRESULT WINAPI class_object_PutMethod (IWbemClassObject *iface, LPCWSTR wszName, LONG lFlags, IWbemClassObject *pInSignature, IWbemClassObject *pOutSignature)
 
static HRESULT WINAPI class_object_DeleteMethod (IWbemClassObject *iface, LPCWSTR wszName)
 
static HRESULT WINAPI class_object_BeginMethodEnumeration (IWbemClassObject *iface, LONG lEnumFlags)
 
static HRESULT WINAPI class_object_NextMethod (IWbemClassObject *iface, LONG lFlags, BSTR *pstrName, IWbemClassObject **ppInSignature, IWbemClassObject **ppOutSignature)
 
static HRESULT WINAPI class_object_EndMethodEnumeration (IWbemClassObject *iface)
 
static HRESULT WINAPI class_object_GetMethodQualifierSet (IWbemClassObject *iface, LPCWSTR wszMethod, IWbemQualifierSet **ppQualSet)
 
static HRESULT WINAPI class_object_GetMethodOrigin (IWbemClassObject *iface, LPCWSTR wszMethodName, BSTR *pstrClassName)
 
HRESULT create_class_object (const WCHAR *name, IEnumWbemClassObject *iter, UINT index, struct record *record, IWbemClassObject **obj)
 

Variables

static const IEnumWbemClassObjectVtbl enum_class_object_vtbl
 
static const IWbemClassObjectVtbl class_object_vtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 19 of file class.c.

Function Documentation

◆ build_signature_table_name()

static WCHAR* build_signature_table_name ( const WCHAR class,
const WCHAR method,
enum param_direction  dir 
)
static

Definition at line 806 of file class.c.

807 {
808  static const WCHAR fmtW[] = {'_','_','%','s','_','%','s','_','%','s',0};
809  static const WCHAR outW[] = {'O','U','T',0};
810  static const WCHAR inW[] = {'I','N',0};
811  UINT len = ARRAY_SIZE(fmtW) + ARRAY_SIZE(outW) + lstrlenW( class ) + lstrlenW( method );
812  WCHAR *ret;
813 
814  if (!(ret = heap_alloc( len * sizeof(WCHAR) ))) return NULL;
815  swprintf( ret, fmtW, class, method, dir == PARAM_IN ? inW : outW );
816  return _wcsupr( ret );
817 }
#define lstrlenW
Definition: compat.h:498
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
unsigned int dir
Definition: maze.c:112
_CRTIMP wchar_t *__cdecl _wcsupr(_Inout_z_ wchar_t *_String)
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR inW[]
Definition: lex.c:61
#define swprintf(buf, format,...)
Definition: sprintf.c:56
method
Definition: dragdrop.c:53
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define ARRAY_SIZE(a)
Definition: main.h:24
unsigned int UINT
Definition: ndis.h:50
GLuint GLenum GLenum GLenum GLenum outW
Definition: glext.h:9616

Referenced by create_signature().

◆ class_object_AddRef()

static ULONG WINAPI class_object_AddRef ( IWbemClassObject iface)
static

Definition at line 288 of file class.c.

290 {
291  struct class_object *co = impl_from_IWbemClassObject( iface );
292  return InterlockedIncrement( &co->refs );
293 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:282
LONG refs
Definition: class.c:273
#define InterlockedIncrement
Definition: armddk.h:53

◆ class_object_BeginEnumeration()

static HRESULT WINAPI class_object_BeginEnumeration ( IWbemClassObject iface,
LONG  lEnumFlags 
)
static

Definition at line 498 of file class.c.

501 {
502  struct class_object *co = impl_from_IWbemClassObject( iface );
503 
504  TRACE("%p, %08x\n", iface, lEnumFlags);
505 
506  if (lEnumFlags) FIXME("flags 0x%08x not supported\n", lEnumFlags);
507 
508  co->index_property = 0;
509  return S_OK;
510 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:282
#define FIXME(fmt,...)
Definition: debug.h:111
UINT index_property
Definition: class.c:278
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:51

◆ class_object_BeginMethodEnumeration()

static HRESULT WINAPI class_object_BeginMethodEnumeration ( IWbemClassObject iface,
LONG  lEnumFlags 
)
static

Definition at line 911 of file class.c.

914 {
915  struct class_object *co = impl_from_IWbemClassObject( iface );
916 
917  TRACE("%p, %08x\n", iface, lEnumFlags);
918 
919  if (lEnumFlags) FIXME("flags 0x%08x not supported\n", lEnumFlags);
920 
921  co->index_method = 0;
922  return S_OK;
923 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:282
#define FIXME(fmt,...)
Definition: debug.h:111
#define TRACE(s)
Definition: solgame.cpp:4
UINT index_method
Definition: class.c:277
#define S_OK
Definition: intsafe.h:51

◆ class_object_Clone()

static HRESULT WINAPI class_object_Clone ( IWbemClassObject iface,
IWbemClassObject **  ppCopy 
)
static

Definition at line 573 of file class.c.

576 {
577  FIXME("%p, %p\n", iface, ppCopy);
578  return E_NOTIMPL;
579 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ class_object_CompareTo()

static HRESULT WINAPI class_object_CompareTo ( IWbemClassObject iface,
LONG  lFlags,
IWbemClassObject pCompareTo 
)
static

Definition at line 676 of file class.c.

680 {
681  FIXME("%p, %08x, %p\n", iface, lFlags, pCompareTo);
682  return E_NOTIMPL;
683 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ class_object_Delete()

static HRESULT WINAPI class_object_Delete ( IWbemClassObject iface,
LPCWSTR  wszName 
)
static

Definition at line 464 of file class.c.

467 {
468  FIXME("%p, %s\n", iface, debugstr_w(wszName));
469  return E_NOTIMPL;
470 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ class_object_DeleteMethod()

static HRESULT WINAPI class_object_DeleteMethod ( IWbemClassObject iface,
LPCWSTR  wszName 
)
static

Definition at line 903 of file class.c.

906 {
907  FIXME("%p, %s\n", iface, debugstr_w(wszName));
908  return E_NOTIMPL;
909 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ class_object_EndEnumeration()

static HRESULT WINAPI class_object_EndEnumeration ( IWbemClassObject iface)
static

Definition at line 550 of file class.c.

552 {
553  struct class_object *co = impl_from_IWbemClassObject( iface );
554 
555  TRACE("%p\n", iface);
556 
557  co->index_property = 0;
558  return S_OK;
559 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:282
UINT index_property
Definition: class.c:278
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:51

◆ class_object_EndMethodEnumeration()

static HRESULT WINAPI class_object_EndMethodEnumeration ( IWbemClassObject iface)
static

Definition at line 961 of file class.c.

963 {
964  struct class_object *co = impl_from_IWbemClassObject( iface );
965 
966  TRACE("%p\n", iface);
967 
968  co->index_method = 0;
969  return S_OK;
970 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:282
#define TRACE(s)
Definition: solgame.cpp:4
UINT index_method
Definition: class.c:277
#define S_OK
Definition: intsafe.h:51

◆ class_object_Get()

static HRESULT WINAPI class_object_Get ( IWbemClassObject iface,
LPCWSTR  wszName,
LONG  lFlags,
VARIANT pVal,
CIMTYPE pType,
LONG plFlavor 
)
static

Definition at line 383 of file class.c.

390 {
391  struct class_object *co = impl_from_IWbemClassObject( iface );
393 
394  TRACE("%p, %s, %08x, %p, %p, %p\n", iface, debugstr_w(wszName), lFlags, pVal, pType, plFlavor);
395 
396  if (co->record)
397  {
398  UINT index;
399  HRESULT hr;
400 
401  if ((hr = get_column_index( co->record->table, wszName, &index )) != S_OK) return hr;
402  return record_get_value( co->record, index, pVal, pType );
403  }
404  return get_propval( ec->query->view, co->index, wszName, pVal, pType, plFlavor );
405 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:282
HRESULT get_column_index(const struct table *table, const WCHAR *name, UINT *column)
Definition: table.c:35
HRESULT hr
Definition: shlfolder.c:183
struct query * query
Definition: class.c:40
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:44
HRESULT get_propval(const struct view *view, UINT index, const WCHAR *name, VARIANT *ret, CIMTYPE *type, LONG *flavor)
Definition: query.c:1177
#define debugstr_w
Definition: kernel32.h:32
IEnumWbemClassObject * iter
Definition: class.c:275
GLuint index
Definition: glext.h:6031
static HRESULT record_get_value(const struct record *record, UINT index, VARIANT *var, CIMTYPE *type)
Definition: class.c:350
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
#define index(s, c)
Definition: various.h:29
struct record * record
Definition: class.c:279
#define S_OK
Definition: intsafe.h:51
unsigned int UINT
Definition: ndis.h:50
UINT index
Definition: class.c:276

◆ class_object_GetMethod()

static HRESULT WINAPI class_object_GetMethod ( IWbemClassObject iface,
LPCWSTR  wszName,
LONG  lFlags,
IWbemClassObject **  ppInSignature,
IWbemClassObject **  ppOutSignature 
)
static

Definition at line 864 of file class.c.

870 {
871  struct class_object *co = impl_from_IWbemClassObject( iface );
873  HRESULT hr;
874 
875  TRACE("%p, %s, %08x, %p, %p\n", iface, debugstr_w(wszName), lFlags, ppInSignature, ppOutSignature);
876 
877  hr = create_signature( co->name, wszName, PARAM_IN, &in );
878  if (hr != S_OK) return hr;
879 
880  hr = create_signature( co->name, wszName, PARAM_OUT, &out );
881  if (hr == S_OK)
882  {
883  if (ppInSignature) *ppInSignature = in;
884  else if (in) IWbemClassObject_Release( in );
885  if (ppOutSignature) *ppOutSignature = out;
886  else if (out) IWbemClassObject_Release( out );
887  }
888  else IWbemClassObject_Release( in );
889  return hr;
890 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:282
HRESULT hr
Definition: shlfolder.c:183
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
static FILE * out
Definition: regtests2xml.c:44
WCHAR * name
Definition: class.c:274
#define S_OK
Definition: intsafe.h:51
GLuint in
Definition: glext.h:9616
HRESULT create_signature(const WCHAR *class, const WCHAR *method, enum param_direction dir, IWbemClassObject **sig)
Definition: class.c:819

◆ class_object_GetMethodOrigin()

static HRESULT WINAPI class_object_GetMethodOrigin ( IWbemClassObject iface,
LPCWSTR  wszMethodName,
BSTR pstrClassName 
)
static

Definition at line 981 of file class.c.

985 {
986  FIXME("%p, %s, %p\n", iface, debugstr_w(wszMethodName), pstrClassName);
987  return E_NOTIMPL;
988 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ class_object_GetMethodQualifierSet()

static HRESULT WINAPI class_object_GetMethodQualifierSet ( IWbemClassObject iface,
LPCWSTR  wszMethod,
IWbemQualifierSet **  ppQualSet 
)
static

Definition at line 972 of file class.c.

976 {
977  FIXME("%p, %s, %p\n", iface, debugstr_w(wszMethod), ppQualSet);
978  return E_NOTIMPL;
979 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ class_object_GetNames()

static HRESULT WINAPI class_object_GetNames ( IWbemClassObject iface,
LPCWSTR  wszQualifierName,
LONG  lFlags,
VARIANT pQualifierVal,
SAFEARRAY **  pNames 
)
static

Definition at line 472 of file class.c.

478 {
479  struct class_object *co = impl_from_IWbemClassObject( iface );
481 
482  TRACE("%p, %s, %08x, %s, %p\n", iface, debugstr_w(wszQualifierName), lFlags,
483  debugstr_variant(pQualifierVal), pNames);
484 
485  if (lFlags != WBEM_FLAG_ALWAYS &&
486  lFlags != WBEM_FLAG_NONSYSTEM_ONLY &&
487  lFlags != WBEM_FLAG_SYSTEM_ONLY)
488  {
489  FIXME("flags %08x not supported\n", lFlags);
490  return E_NOTIMPL;
491  }
492  if (wszQualifierName || pQualifierVal)
493  FIXME("qualifier not supported\n");
494 
495  return get_properties( ec->query->view, co->index, lFlags, pNames );
496 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:282
struct query * query
Definition: class.c:40
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:44
HRESULT get_properties(const struct view *view, UINT index, LONG flags, SAFEARRAY **props)
Definition: query.c:1401
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
IEnumWbemClassObject * iter
Definition: class.c:275
#define TRACE(s)
Definition: solgame.cpp:4
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
#define E_NOTIMPL
Definition: ddrawi.h:99
UINT index
Definition: class.c:276

◆ class_object_GetObjectText()

static HRESULT WINAPI class_object_GetObjectText ( IWbemClassObject iface,
LONG  lFlags,
BSTR pstrObjectText 
)
static

Definition at line 631 of file class.c.

635 {
636  struct class_object *co = impl_from_IWbemClassObject( iface );
638  struct view *view = ec->query->view;
639  BSTR text;
640 
641  TRACE("%p, %08x, %p\n", iface, lFlags, pstrObjectText);
642 
643  if (lFlags) FIXME("flags %08x not implemented\n", lFlags);
644 
645  if (!(text = get_object_text( view, co->index ))) return E_OUTOFMEMORY;
646  *pstrObjectText = text;
647  return S_OK;
648 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:282
struct query * query
Definition: class.c:40
const WCHAR * text
Definition: package.c:1827
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:44
OLECHAR * BSTR
Definition: compat.h:2041
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define FIXME(fmt,...)
Definition: debug.h:111
IEnumWbemClassObject * iter
Definition: class.c:275
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:51
static BSTR get_object_text(const struct view *view, UINT index)
Definition: class.c:612
UINT index
Definition: class.c:276

◆ class_object_GetPropertyOrigin()

static HRESULT WINAPI class_object_GetPropertyOrigin ( IWbemClassObject iface,
LPCWSTR  wszName,
BSTR pstrClassName 
)
static

Definition at line 685 of file class.c.

689 {
690  FIXME("%p, %s, %p\n", iface, debugstr_w(wszName), pstrClassName);
691  return E_NOTIMPL;
692 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ class_object_GetPropertyQualifierSet()

static HRESULT WINAPI class_object_GetPropertyQualifierSet ( IWbemClassObject iface,
LPCWSTR  wszProperty,
IWbemQualifierSet **  ppQualSet 
)
static

Definition at line 561 of file class.c.

565 {
566  struct class_object *co = impl_from_IWbemClassObject( iface );
567 
568  TRACE("%p, %s, %p\n", iface, debugstr_w(wszProperty), ppQualSet);
569 
570  return WbemQualifierSet_create( co->name, wszProperty, (void **)ppQualSet );
571 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:282
HRESULT WbemQualifierSet_create(const WCHAR *class, const WCHAR *member, LPVOID *ppObj)
Definition: qualifier.c:293
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
WCHAR * name
Definition: class.c:274

◆ class_object_GetQualifierSet()

static HRESULT WINAPI class_object_GetQualifierSet ( IWbemClassObject iface,
IWbemQualifierSet **  ppQualSet 
)
static

Definition at line 339 of file class.c.

342 {
343  struct class_object *co = impl_from_IWbemClassObject( iface );
344 
345  TRACE("%p, %p\n", iface, ppQualSet);
346 
347  return WbemQualifierSet_create( co->name, NULL, (void **)ppQualSet );
348 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:282
HRESULT WbemQualifierSet_create(const WCHAR *class, const WCHAR *member, LPVOID *ppObj)
Definition: qualifier.c:293
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
WCHAR * name
Definition: class.c:274

◆ class_object_InheritsFrom()

static HRESULT WINAPI class_object_InheritsFrom ( IWbemClassObject iface,
LPCWSTR  strAncestor 
)
static

Definition at line 694 of file class.c.

697 {
698  FIXME("%p, %s\n", iface, debugstr_w(strAncestor));
699  return E_NOTIMPL;
700 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ class_object_Next()

static HRESULT WINAPI class_object_Next ( IWbemClassObject iface,
LONG  lFlags,
BSTR strName,
VARIANT pVal,
CIMTYPE pType,
LONG plFlavor 
)
static

Definition at line 512 of file class.c.

519 {
520  struct class_object *obj = impl_from_IWbemClassObject( iface );
521  struct enum_class_object *iter = impl_from_IEnumWbemClassObject( obj->iter );
522  struct view *view = iter->query->view;
523  struct table *table = get_view_table( view, obj->index );
524  BSTR prop;
525  HRESULT hr;
526  UINT i;
527 
528  TRACE("%p, %08x, %p, %p, %p, %p\n", iface, lFlags, strName, pVal, pType, plFlavor);
529 
530  for (i = obj->index_property; i < table->num_cols; i++)
531  {
532  if (is_method( table, i )) continue;
533  if (!is_result_prop( view, table->columns[i].name )) continue;
534  if (!(prop = SysAllocString( table->columns[i].name ))) return E_OUTOFMEMORY;
535  if ((hr = get_propval( view, obj->index, prop, pVal, pType, plFlavor )) != S_OK)
536  {
537  SysFreeString( prop );
538  return hr;
539  }
540 
541  obj->index_property = i + 1;
542  if (strName) *strName = prop;
543  else SysFreeString( prop );
544 
545  return S_OK;
546  }
547  return WBEM_S_NO_MORE_DATA;
548 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:282
HRESULT hr
Definition: shlfolder.c:183
struct query * query
Definition: class.c:40
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:44
const struct column * columns
HRESULT get_propval(const struct view *view, UINT index, const WCHAR *name, VARIANT *ret, CIMTYPE *type, LONG *flavor)
Definition: query.c:1177
OLECHAR * BSTR
Definition: compat.h:2041
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
int JSAMPARRAY int int JDIMENSION num_cols
Definition: jpegint.h:419
BOOL is_result_prop(const struct view *view, const WCHAR *name)
Definition: query.c:804
#define S_OK
Definition: intsafe.h:51
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
unsigned int UINT
Definition: ndis.h:50
struct table * get_view_table(const struct view *view, UINT index)
Definition: query.c:1161
BOOL is_method(const struct table *table, UINT column)
Definition: query.c:917

◆ class_object_NextMethod()

static HRESULT WINAPI class_object_NextMethod ( IWbemClassObject iface,
LONG  lFlags,
BSTR pstrName,
IWbemClassObject **  ppInSignature,
IWbemClassObject **  ppOutSignature 
)
static

Definition at line 925 of file class.c.

931 {
932  struct class_object *co = impl_from_IWbemClassObject( iface );
933  BSTR method;
934  HRESULT hr;
935 
936  TRACE("%p, %08x, %p, %p, %p\n", iface, lFlags, pstrName, ppInSignature, ppOutSignature);
937 
938  if (!(method = get_method_name( co->name, co->index_method ))) return WBEM_S_NO_MORE_DATA;
939 
940  hr = create_signature( co->name, method, PARAM_IN, ppInSignature );
941  if (hr != S_OK)
942  {
944  return hr;
945  }
946  hr = create_signature( co->name, method, PARAM_OUT, ppOutSignature );
947  if (hr != S_OK)
948  {
950  if (*ppInSignature)
951  IWbemClassObject_Release( *ppInSignature );
952  }
953  else
954  {
955  *pstrName = method;
956  co->index_method++;
957  }
958  return hr;
959 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:282
HRESULT hr
Definition: shlfolder.c:183
OLECHAR * BSTR
Definition: compat.h:2041
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
WCHAR * name
Definition: class.c:274
method
Definition: dragdrop.c:53
BSTR get_method_name(const WCHAR *class, UINT index)
Definition: table.c:417
UINT index_method
Definition: class.c:277
#define S_OK
Definition: intsafe.h:51
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
HRESULT create_signature(const WCHAR *class, const WCHAR *method, enum param_direction dir, IWbemClassObject **sig)
Definition: class.c:819

◆ class_object_Put()

static HRESULT WINAPI class_object_Put ( IWbemClassObject iface,
LPCWSTR  wszName,
LONG  lFlags,
VARIANT pVal,
CIMTYPE  Type 
)
static

Definition at line 441 of file class.c.

447 {
448  struct class_object *co = impl_from_IWbemClassObject( iface );
450 
451  TRACE("%p, %s, %08x, %p, %u\n", iface, debugstr_w(wszName), lFlags, pVal, Type);
452 
453  if (co->record)
454  {
455  UINT index;
456  HRESULT hr;
457 
458  if ((hr = get_column_index( co->record->table, wszName, &index )) != S_OK) return hr;
459  return record_set_value( co->record, index, pVal );
460  }
461  return put_propval( ec->query->view, co->index, wszName, pVal, Type );
462 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:282
HRESULT put_propval(const struct view *view, UINT index, const WCHAR *name, VARIANT *var, CIMTYPE type)
Definition: query.c:1375
HRESULT get_column_index(const struct table *table, const WCHAR *name, UINT *column)
Definition: table.c:35
Type
Definition: Type.h:6
HRESULT hr
Definition: shlfolder.c:183
struct query * query
Definition: class.c:40
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:44
#define debugstr_w
Definition: kernel32.h:32
IEnumWbemClassObject * iter
Definition: class.c:275
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
#define index(s, c)
Definition: various.h:29
struct record * record
Definition: class.c:279
#define S_OK
Definition: intsafe.h:51
unsigned int UINT
Definition: ndis.h:50
static HRESULT record_set_value(struct record *record, UINT index, VARIANT *var)
Definition: class.c:407
UINT index
Definition: class.c:276

◆ class_object_PutMethod()

static HRESULT WINAPI class_object_PutMethod ( IWbemClassObject iface,
LPCWSTR  wszName,
LONG  lFlags,
IWbemClassObject pInSignature,
IWbemClassObject pOutSignature 
)
static

Definition at line 892 of file class.c.

898 {
899  FIXME("%p, %s, %08x, %p, %p\n", iface, debugstr_w(wszName), lFlags, pInSignature, pOutSignature);
900  return E_NOTIMPL;
901 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ class_object_QueryInterface()

static HRESULT WINAPI class_object_QueryInterface ( IWbemClassObject iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 311 of file class.c.

315 {
316  struct class_object *co = impl_from_IWbemClassObject( iface );
317 
318  TRACE("%p, %s, %p\n", co, debugstr_guid( riid ), ppvObject );
319 
320  if ( IsEqualGUID( riid, &IID_IWbemClassObject ) ||
322  {
323  *ppvObject = co;
324  }
325  else if (IsEqualGUID( riid, &IID_IClientSecurity ))
326  {
328  return S_OK;
329  }
330  else
331  {
332  FIXME("interface %s not implemented\n", debugstr_guid(riid));
333  return E_NOINTERFACE;
334  }
335  IWbemClassObject_AddRef( iface );
336  return S_OK;
337 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:282
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
IClientSecurity client_security
Definition: services.c:137
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:51
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ class_object_Release()

static ULONG WINAPI class_object_Release ( IWbemClassObject iface)
static

Definition at line 295 of file class.c.

297 {
298  struct class_object *co = impl_from_IWbemClassObject( iface );
300  if (!refs)
301  {
302  TRACE("destroying %p\n", co);
303  if (co->iter) IEnumWbemClassObject_Release( co->iter );
304  destroy_record( co->record );
305  heap_free( co->name );
306  heap_free( co );
307  }
308  return refs;
309 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:282
static void destroy_record(struct record *record)
Definition: class.c:252
LONG refs
Definition: class.c:273
long LONG
Definition: pedump.c:60
IEnumWbemClassObject * iter
Definition: class.c:275
#define TRACE(s)
Definition: solgame.cpp:4
WCHAR * name
Definition: class.c:274
#define InterlockedDecrement
Definition: armddk.h:52
struct record * record
Definition: class.c:279
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ class_object_SpawnDerivedClass()

static HRESULT WINAPI class_object_SpawnDerivedClass ( IWbemClassObject iface,
LONG  lFlags,
IWbemClassObject **  ppNewClass 
)
static

Definition at line 650 of file class.c.

654 {
655  FIXME("%p, %08x, %p\n", iface, lFlags, ppNewClass);
656  return E_NOTIMPL;
657 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ class_object_SpawnInstance()

static HRESULT WINAPI class_object_SpawnInstance ( IWbemClassObject iface,
LONG  lFlags,
IWbemClassObject **  ppNewInstance 
)
static

Definition at line 659 of file class.c.

663 {
664  struct class_object *co = impl_from_IWbemClassObject( iface );
666  struct table *table = get_view_table( ec->query->view, co->index );
667  struct record *record;
668 
669  TRACE("%p, %08x, %p\n", iface, lFlags, ppNewInstance);
670 
671  if (!(record = create_record( table ))) return E_OUTOFMEMORY;
672 
673  return create_class_object( co->name, NULL, 0, record, ppNewInstance );
674 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:282
struct query * query
Definition: class.c:40
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:44
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
IEnumWbemClassObject * iter
Definition: class.c:275
#define TRACE(s)
Definition: solgame.cpp:4
static struct record * create_record(struct table *table)
Definition: class.c:219
WCHAR * name
Definition: class.c:274
HRESULT create_class_object(const WCHAR *name, IEnumWbemClassObject *iter, UINT index, struct record *record, IWbemClassObject **obj)
Definition: class.c:1021
struct table * get_view_table(const struct view *view, UINT index)
Definition: query.c:1161
UINT index
Definition: class.c:276

◆ count_instances()

static UINT count_instances ( IEnumWbemClassObject iter)
static

Definition at line 702 of file class.c.

703 {
704  UINT count = 0;
705  while (!IEnumWbemClassObject_Skip( iter, WBEM_INFINITE, 1 )) count++;
706  IEnumWbemClassObject_Reset( iter );
707  return count;
708 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
unsigned int UINT
Definition: ndis.h:50

Referenced by create_signature(), and create_signature_columns_and_data().

◆ create_class_object()

HRESULT create_class_object ( const WCHAR name,
IEnumWbemClassObject iter,
UINT  index,
struct record record,
IWbemClassObject **  obj 
)

Definition at line 1021 of file class.c.

1023 {
1024  struct class_object *co;
1025 
1026  TRACE("%s, %p\n", debugstr_w(name), obj);
1027 
1028  co = heap_alloc( sizeof(*co) );
1029  if (!co) return E_OUTOFMEMORY;
1030 
1032  co->refs = 1;
1033  if (!name) co->name = NULL;
1034  else if (!(co->name = heap_strdupW( name )))
1035  {
1036  heap_free( co );
1037  return E_OUTOFMEMORY;
1038  }
1039  co->iter = iter;
1040  co->index = index;
1041  co->index_method = 0;
1042  co->index_property = 0;
1043  co->record = record;
1044  if (iter) IEnumWbemClassObject_AddRef( iter );
1045 
1046  *obj = &co->IWbemClassObject_iface;
1047 
1048  TRACE("returning iface %p\n", *obj);
1049  return S_OK;
1050 }
IWbemClassObject IWbemClassObject_iface
Definition: class.c:272
static const IWbemClassObjectVtbl class_object_vtbl
Definition: class.c:990
LONG refs
Definition: class.c:273
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
IEnumWbemClassObject * iter
Definition: class.c:275
UINT index_property
Definition: class.c:278
#define TRACE(s)
Definition: solgame.cpp:4
WCHAR * name
Definition: class.c:274
#define index(s, c)
Definition: various.h:29
struct record * record
Definition: class.c:279
UINT index_method
Definition: class.c:277
#define S_OK
Definition: intsafe.h:51
Definition: name.c:38
UINT index
Definition: class.c:276
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by class_object_SpawnInstance(), enum_class_object_Next(), get_object(), get_qualifier_value(), qualifier_set_GetNames(), wbem_services_ExecMethod(), and wbem_services_GetObject().

◆ create_record()

static struct record* create_record ( struct table table)
static

Definition at line 219 of file class.c.

220 {
221  UINT i;
222  struct record *record;
223 
224  if (!(record = heap_alloc( sizeof(struct record) ))) return NULL;
225  if (!(record->fields = heap_alloc( table->num_cols * sizeof(struct field) )))
226  {
227  heap_free( record );
228  return NULL;
229  }
230  for (i = 0; i < table->num_cols; i++)
231  {
232  record->fields[i].type = table->columns[i].type;
233  record->fields[i].u.ival = 0;
234  }
237  return record;
238 }
UINT num_cols
const struct column * columns
struct field * fields
struct table * addref_table(struct table *table)
Definition: table.c:359
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
struct table * table
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:43
unsigned int UINT
Definition: ndis.h:50
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by class_object_SpawnInstance().

◆ create_signature()

HRESULT create_signature ( const WCHAR class,
const WCHAR method,
enum param_direction  dir,
IWbemClassObject **  sig 
)

Definition at line 819 of file class.c.

821 {
822  static const WCHAR selectW[] =
823  {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
824  '_','_','P','A','R','A','M','E','T','E','R','S',' ','W','H','E','R','E',' ',
825  'C','l','a','s','s','=','\'','%','s','\'',' ','A','N','D',' ',
826  'M','e','t','h','o','d','=','\'','%','s','\'',' ','A','N','D',' ',
827  'D','i','r','e','c','t','i','o','n','%','s',0};
828  static const WCHAR geW[] = {'>','=','0',0};
829  static const WCHAR leW[] = {'<','=','0',0};
831  IEnumWbemClassObject *iter;
832  WCHAR *query, *name;
833  HRESULT hr;
834 
835  len += lstrlenW( class ) + lstrlenW( method );
836  if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return E_OUTOFMEMORY;
837  swprintf( query, selectW, class, method, dir >= 0 ? geW : leW );
838 
839  hr = exec_query( query, &iter );
840  heap_free( query );
841  if (hr != S_OK) return hr;
842 
843  if (!count_instances( iter ))
844  {
845  *sig = NULL;
846  IEnumWbemClassObject_Release( iter );
847  return S_OK;
848  }
849 
850  if (!(name = build_signature_table_name( class, method, dir )))
851  {
852  IEnumWbemClassObject_Release( iter );
853  return E_OUTOFMEMORY;
854  }
855  hr = create_signature_table( iter, name );
856  IEnumWbemClassObject_Release( iter );
857  if (hr == S_OK)
858  hr = get_object( name, sig );
859 
860  heap_free( name );
861  return hr;
862 }
HRESULT hr
Definition: shlfolder.c:183
static IDispatch * get_object(jsval_t v)
Definition: jsval.h:219
#define lstrlenW
Definition: compat.h:498
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static HRESULT create_signature_table(IEnumWbemClassObject *iter, WCHAR *name)
Definition: class.c:785
static UINT count_instances(IEnumWbemClassObject *iter)
Definition: class.c:702
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
unsigned int dir
Definition: maze.c:112
const char name[9]
Definition: class.c:927
static const WCHAR selectW[]
Definition: htmlelem.c:38
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
#define swprintf(buf, format,...)
Definition: sprintf.c:56
method
Definition: dragdrop.c:53
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:51
static WCHAR * build_signature_table_name(const WCHAR *class, const WCHAR *method, enum param_direction dir)
Definition: class.c:806
#define ARRAY_SIZE(a)
Definition: main.h:24
HRESULT exec_query(const WCHAR *str, IEnumWbemClassObject **result)
Definition: query.c:786
unsigned int UINT
Definition: ndis.h:50
Definition: name.c:38
GLenum query
Definition: glext.h:7781
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by class_object_GetMethod(), class_object_NextMethod(), process_get_owner(), reg_create_key(), reg_enum_key(), reg_enum_values(), reg_get_stringvalue(), security_get_sd(), security_set_sd(), service_pause_service(), service_resume_service(), service_start_service(), and service_stop_service().

◆ create_signature_columns_and_data()

static HRESULT create_signature_columns_and_data ( IEnumWbemClassObject iter,
UINT num_cols,
struct column **  cols,
BYTE **  data 
)
static

Definition at line 732 of file class.c.

734 {
735  static const WCHAR parameterW[] = {'P','a','r','a','m','e','t','e','r',0};
736  static const WCHAR typeW[] = {'T','y','p','e',0};
737  static const WCHAR defaultvalueW[] = {'D','e','f','a','u','l','t','V','a','l','u','e',0};
738  struct column *columns;
739  BYTE *row;
741  VARIANT val;
743  UINT offset = 0;
744  ULONG count;
745  int i = 0;
746 
747  count = count_instances( iter );
748  if (!(columns = heap_alloc( count * sizeof(struct column) ))) return E_OUTOFMEMORY;
749  if (!(row = heap_alloc_zero( count * sizeof(LONGLONG) ))) goto error;
750 
751  for (;;)
752  {
753  IEnumWbemClassObject_Next( iter, WBEM_INFINITE, 1, &param, &count );
754  if (!count) break;
755 
756  hr = IWbemClassObject_Get( param, parameterW, 0, &val, NULL, NULL );
757  if (hr != S_OK) goto error;
758  columns[i].name = heap_strdupW( V_BSTR( &val ) );
759  VariantClear( &val );
760 
761  hr = IWbemClassObject_Get( param, typeW, 0, &val, NULL, NULL );
762  if (hr != S_OK) goto error;
763  columns[i].type = V_UI4( &val );
764 
765  hr = IWbemClassObject_Get( param, defaultvalueW, 0, &val, NULL, NULL );
766  if (hr != S_OK) goto error;
767  if (V_UI4( &val )) set_default_value( columns[i].type, V_UI4( &val ), row + offset );
768  offset += get_type_size( columns[i].type );
769 
770  IWbemClassObject_Release( param );
771  i++;
772  }
773  *num_cols = i;
774  *cols = columns;
775  *data = row;
776  return S_OK;
777 
778 error:
779  for (; i >= 0; i--) heap_free( (WCHAR *)columns[i].name );
780  heap_free( columns );
781  heap_free( row );
782  return hr;
783 }
HRESULT hr
Definition: shlfolder.c:183
#define error(str)
Definition: mkdosfs.c:1605
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLintptr offset
Definition: glext.h:5920
static const WCHAR typeW[]
Definition: name.c:51
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static void set_default_value(CIMTYPE type, UINT val, BYTE *ptr)
Definition: class.c:710
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static UINT count_instances(IEnumWbemClassObject *iter)
Definition: class.c:702
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
smooth NULL
Definition: ftsmooth.c:416
GLuint GLfloat * val
Definition: glext.h:7180
int64_t LONGLONG
Definition: typedefs.h:68
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned int get_type_size(ULONG *pFlags, VARTYPE vt)
Definition: usrmarshal.c:209
LONG HRESULT
Definition: typedefs.h:79
GLfloat param
Definition: glext.h:5796
int JSAMPARRAY int int JDIMENSION num_cols
Definition: jpegint.h:419
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define V_UI4(A)
Definition: oleauto.h:270
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
unsigned char BYTE
Definition: xxhash.c:193
#define V_BSTR(A)
Definition: oleauto.h:226
#define S_OK
Definition: intsafe.h:51
const WCHAR * name
unsigned int UINT
Definition: ndis.h:50
Definition: name.c:38
unsigned int ULONG
Definition: retypes.h:1
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by create_signature_table().

◆ create_signature_table()

static HRESULT create_signature_table ( IEnumWbemClassObject iter,
WCHAR name 
)
static

Definition at line 785 of file class.c.

786 {
787  HRESULT hr;
788  struct table *table;
789  struct column *columns;
790  UINT num_cols;
791  BYTE *row;
792 
793  hr = create_signature_columns_and_data( iter, &num_cols, &columns, &row );
794  if (hr != S_OK) return hr;
795 
796  if (!(table = create_table( name, num_cols, columns, 1, 1, row, NULL )))
797  {
798  free_columns( columns, num_cols );
799  heap_free( row );
800  return E_OUTOFMEMORY;
801  }
802  if (!add_table( table )) free_table( table ); /* already exists */
803  return S_OK;
804 }
void free_columns(struct column *columns, UINT num_cols)
Definition: table.c:330
HRESULT hr
Definition: shlfolder.c:183
BOOL add_table(struct table *table)
Definition: table.c:400
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static HRESULT create_signature_columns_and_data(IEnumWbemClassObject *iter, UINT *num_cols, struct column **cols, BYTE **data)
Definition: class.c:732
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:79
int JSAMPARRAY int int JDIMENSION num_cols
Definition: jpegint.h:419
unsigned char BYTE
Definition: xxhash.c:193
static void free_table(MSITABLE *table)
Definition: table.c:372
#define S_OK
Definition: intsafe.h:51
unsigned int UINT
Definition: ndis.h:50
struct table * create_table(const WCHAR *name, UINT num_cols, const struct column *columns, UINT num_rows, UINT num_allocated, BYTE *data, enum fill_status(*fill)(struct table *, const struct expr *cond))
Definition: table.c:380
Definition: name.c:38
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by create_signature().

◆ destroy_array()

void destroy_array ( struct array array,
CIMTYPE  type 
)

Definition at line 240 of file class.c.

241 {
242  UINT i;
243  if (!array) return;
244  if (type == CIM_STRING || type == CIM_DATETIME || type == CIM_REFERENCE)
245  {
246  for (i = 0; i < array->count; i++) heap_free( *(WCHAR **)((char *)array->ptr + i * array->elem_size) );
247  }
248  heap_free( array->ptr );
249  heap_free( array );
250 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
__wchar_t WCHAR
Definition: xmlstorage.h:180
UINT elem_size
void * ptr
unsigned int UINT
Definition: ndis.h:50
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by destroy_record(), free_row_values(), and to_array().

◆ destroy_record()

static void destroy_record ( struct record record)
static

Definition at line 252 of file class.c.

253 {
254  UINT i;
255 
256  if (!record) return;
258  for (i = 0; i < record->count; i++)
259  {
260  if (record->fields[i].type == CIM_STRING ||
261  record->fields[i].type == CIM_DATETIME ||
262  record->fields[i].type == CIM_REFERENCE) heap_free( record->fields[i].u.sval );
263  else if (record->fields[i].type & CIM_FLAG_ARRAY)
264  destroy_array( record->fields[i].u.aval, record->fields[i].type & CIM_TYPE_MASK );
265  }
266  heap_free( record->fields );
267  heap_free( record );
268 }
struct field * fields
struct table * table
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define CIM_TYPE_MASK
void destroy_array(struct array *array, CIMTYPE type)
Definition: class.c:240
void release_table(struct table *table)
Definition: table.c:354
unsigned int UINT
Definition: ndis.h:50
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by class_object_Release().

◆ enum_class_object_AddRef()

static ULONG WINAPI enum_class_object_AddRef ( IEnumWbemClassObject iface)
static

Definition at line 50 of file class.c.

52 {
54  return InterlockedIncrement( &ec->refs );
55 }
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:44
#define InterlockedIncrement
Definition: armddk.h:53

◆ enum_class_object_Clone()

static HRESULT WINAPI enum_class_object_Clone ( IEnumWbemClassObject iface,
IEnumWbemClassObject **  ppEnum 
)
static

Definition at line 152 of file class.c.

155 {
157 
158  TRACE("%p, %p\n", iface, ppEnum);
159 
160  return EnumWbemClassObject_create( ec->query, (void **)ppEnum );
161 }
struct query * query
Definition: class.c:40
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:44
HRESULT EnumWbemClassObject_create(struct query *query, LPVOID *ppObj)
Definition: class.c:199
#define TRACE(s)
Definition: solgame.cpp:4

◆ enum_class_object_Next()

static HRESULT WINAPI enum_class_object_Next ( IEnumWbemClassObject iface,
LONG  lTimeout,
ULONG  uCount,
IWbemClassObject **  apObjects,
ULONG puReturned 
)
static

Definition at line 110 of file class.c.

116 {
118  struct view *view = ec->query->view;
119  struct table *table;
120  static int once = 0;
121  HRESULT hr;
122 
123  TRACE("%p, %d, %u, %p, %p\n", iface, lTimeout, uCount, apObjects, puReturned);
124 
125  if (!uCount) return WBEM_S_FALSE;
126  if (!apObjects || !puReturned) return WBEM_E_INVALID_PARAMETER;
127  if (lTimeout != WBEM_INFINITE && !once++) FIXME("timeout not supported\n");
128 
129  *puReturned = 0;
130  if (ec->index >= view->result_count) return WBEM_S_FALSE;
131 
132  table = get_view_table( view, ec->index );
133  hr = create_class_object( table->name, iface, ec->index, NULL, apObjects );
134  if (hr != S_OK) return hr;
135 
136  ec->index++;
137  *puReturned = 1;
138  if (ec->index == view->result_count && uCount > 1) return WBEM_S_FALSE;
139  if (uCount > 1) return WBEM_S_TIMEDOUT;
140  return WBEM_S_NO_ERROR;
141 }
const WCHAR * name
HRESULT hr
Definition: shlfolder.c:183
struct query * query
Definition: class.c:40
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:44
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
UINT result_count
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
#define S_OK
Definition: intsafe.h:51
HRESULT create_class_object(const WCHAR *name, IEnumWbemClassObject *iter, UINT index, struct record *record, IWbemClassObject **obj)
Definition: class.c:1021
struct table * get_view_table(const struct view *view, UINT index)
Definition: query.c:1161

◆ enum_class_object_NextAsync()

static HRESULT WINAPI enum_class_object_NextAsync ( IEnumWbemClassObject iface,
ULONG  uCount,
IWbemObjectSink pSink 
)
static

Definition at line 143 of file class.c.

147 {
148  FIXME("%p, %u, %p\n", iface, uCount, pSink);
149  return E_NOTIMPL;
150 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ enum_class_object_QueryInterface()

static HRESULT WINAPI enum_class_object_QueryInterface ( IEnumWbemClassObject iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 71 of file class.c.

75 {
77 
78  TRACE("%p, %s, %p\n", ec, debugstr_guid( riid ), ppvObject );
79 
80  if ( IsEqualGUID( riid, &IID_IEnumWbemClassObject ) ||
82  {
83  *ppvObject = ec;
84  }
85  else if ( IsEqualGUID( riid, &IID_IClientSecurity ) )
86  {
88  return S_OK;
89  }
90  else
91  {
92  FIXME("interface %s not implemented\n", debugstr_guid(riid));
93  return E_NOINTERFACE;
94  }
95  IEnumWbemClassObject_AddRef( iface );
96  return S_OK;
97 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:44
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
IClientSecurity client_security
Definition: services.c:137
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:51
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ enum_class_object_Release()

static ULONG WINAPI enum_class_object_Release ( IEnumWbemClassObject iface)
static

Definition at line 57 of file class.c.

59 {
62  if (!refs)
63  {
64  TRACE("destroying %p\n", ec);
65  release_query( ec->query );
66  heap_free( ec );
67  }
68  return refs;
69 }
struct query * query
Definition: class.c:40
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:44
long LONG
Definition: pedump.c:60
void release_query(struct query *query)
Definition: query.c:781
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ enum_class_object_Reset()

static HRESULT WINAPI enum_class_object_Reset ( IEnumWbemClassObject iface)
static

Definition at line 99 of file class.c.

101 {
103 
104  TRACE("%p\n", iface);
105 
106  ec->index = 0;
107  return WBEM_S_NO_ERROR;
108 }
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:44
#define TRACE(s)
Definition: solgame.cpp:4

◆ enum_class_object_Skip()

static HRESULT WINAPI enum_class_object_Skip ( IEnumWbemClassObject iface,
LONG  lTimeout,
ULONG  nCount 
)
static

Definition at line 163 of file class.c.

167 {
169  struct view *view = ec->query->view;
170  static int once = 0;
171 
172  TRACE("%p, %d, %u\n", iface, lTimeout, nCount);
173 
174  if (lTimeout != WBEM_INFINITE && !once++) FIXME("timeout not supported\n");
175 
176  if (!view->result_count) return WBEM_S_FALSE;
177 
178  if (nCount > view->result_count - ec->index)
179  {
180  ec->index = view->result_count - 1;
181  return WBEM_S_FALSE;
182  }
183  ec->index += nCount;
184  return WBEM_S_NO_ERROR;
185 }
struct query * query
Definition: class.c:40
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:44
UINT result_count
#define FIXME(fmt,...)
Definition: debug.h:111
#define TRACE(s)
Definition: solgame.cpp:4

◆ EnumWbemClassObject_create()

HRESULT EnumWbemClassObject_create ( struct query query,
LPVOID ppObj 
)

Definition at line 199 of file class.c.

200 {
201  struct enum_class_object *ec;
202 
203  TRACE("%p\n", ppObj);
204 
205  ec = heap_alloc( sizeof(*ec) );
206  if (!ec) return E_OUTOFMEMORY;
207 
209  ec->refs = 1;
210  ec->query = addref_query( query );
211  ec->index = 0;
212 
213  *ppObj = &ec->IEnumWbemClassObject_iface;
214 
215  TRACE("returning iface %p\n", *ppObj);
216  return S_OK;
217 }
struct query * query
Definition: class.c:40
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
IEnumWbemClassObject IEnumWbemClassObject_iface
Definition: class.c:38
#define TRACE(s)
Definition: solgame.cpp:4
static const IEnumWbemClassObjectVtbl enum_class_object_vtbl
Definition: class.c:187
struct query * addref_query(struct query *query)
Definition: query.c:775
#define S_OK
Definition: intsafe.h:51

Referenced by enum_class_object_Clone(), exec_query(), and wbem_services_ExecMethod().

◆ get_body_text()

static BSTR get_body_text ( const struct table table,
UINT  row,
UINT len 
)
static

Definition at line 581 of file class.c.

582 {
583  static const WCHAR fmtW[] = {'\n','\t','%','s',' ','=',' ','%','s',';',0};
584  BSTR value, ret;
585  WCHAR *p;
586  UINT i;
587 
588  *len = 0;
589  for (i = 0; i < table->num_cols; i++)
590  {
591  if ((value = get_value_bstr( table, row, i )))
592  {
593  *len += ARRAY_SIZE( fmtW );
594  *len += lstrlenW( table->columns[i].name );
595  *len += SysStringLen( value );
596  SysFreeString( value );
597  }
598  }
599  if (!(ret = SysAllocStringLen( NULL, *len ))) return NULL;
600  p = ret;
601  for (i = 0; i < table->num_cols; i++)
602  {
603  if ((value = get_value_bstr( table, row, i )))
604  {
605  p += swprintf( p, fmtW, table->columns[i].name, value );
606  SysFreeString( value );
607  }
608  }
609  return ret;
610 }
UINT num_cols
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
const struct column * columns
OLECHAR * BSTR
Definition: compat.h:2041
#define lstrlenW
Definition: compat.h:498
BSTR get_value_bstr(const struct table *table, UINT row, UINT column)
Definition: table.c:158
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define swprintf(buf, format,...)
Definition: sprintf.c:56
int ret
GLenum GLsizei len
Definition: glext.h:6722
UINT WINAPI SysStringLen(BSTR str)
Definition: oleaut.c:196
int value
Definition: class.c:928
#define ARRAY_SIZE(a)
Definition: main.h:24
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
unsigned int UINT
Definition: ndis.h:50
GLfloat GLfloat p
Definition: glext.h:8902
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78

Referenced by get_object_text().

◆ get_object_text()

static BSTR get_object_text ( const struct view view,
UINT  index 
)
static

Definition at line 612 of file class.c.

613 {
614  static const WCHAR fmtW[] =
615  {'\n','i','n','s','t','a','n','c','e',' ','o','f',' ','%','s','\n','{','%','s','\n','}',';',0};
616  UINT len, len_body, row = view->result[index];
617  struct table *table = get_view_table( view, index );
618  BSTR ret, body;
619 
620  len = ARRAY_SIZE( fmtW );
621  len += lstrlenW( table->name );
622  if (!(body = get_body_text( table, row, &len_body ))) return NULL;
623  len += len_body;
624 
625  if (!(ret = SysAllocStringLen( NULL, len ))) return NULL;
626  swprintf( ret, fmtW, table->name, body );
627  SysFreeString( body );
628  return ret;
629 }
static BSTR get_body_text(const struct table *table, UINT row, UINT *len)
Definition: class.c:581
const WCHAR * name
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
OLECHAR * BSTR
Definition: compat.h:2041
#define lstrlenW
Definition: compat.h:498
UINT * result
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define swprintf(buf, format,...)
Definition: sprintf.c:56
int ret
#define index(s, c)
Definition: various.h:29
GLenum GLsizei len
Definition: glext.h:6722
#define ARRAY_SIZE(a)
Definition: main.h:24
static const void * body(MD5_CTX *ctx, const void *data, unsigned long size)
Definition: md5.c:100
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
unsigned int UINT
Definition: ndis.h:50
struct table * get_view_table(const struct view *view, UINT index)
Definition: query.c:1161
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78

Referenced by class_object_GetObjectText().

◆ impl_from_IEnumWbemClassObject()

static struct enum_class_object* impl_from_IEnumWbemClassObject ( IEnumWbemClassObject iface)
inlinestatic

Definition at line 44 of file class.c.

46 {
47  return CONTAINING_RECORD(iface, struct enum_class_object, IEnumWbemClassObject_iface);
48 }
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

Referenced by class_object_Get(), class_object_GetNames(), class_object_GetObjectText(), class_object_Next(), class_object_Put(), class_object_SpawnInstance(), enum_class_object_AddRef(), enum_class_object_Clone(), enum_class_object_Next(), enum_class_object_QueryInterface(), enum_class_object_Release(), enum_class_object_Reset(), and enum_class_object_Skip().

◆ impl_from_IWbemClassObject()

static struct class_object* impl_from_IWbemClassObject ( IWbemClassObject iface)
inlinestatic

Definition at line 282 of file class.c.

284 {
285  return CONTAINING_RECORD(iface, struct class_object, IWbemClassObject_iface);
286 }
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

Referenced by class_object_AddRef(), class_object_BeginEnumeration(), class_object_BeginMethodEnumeration(), class_object_EndEnumeration(), class_object_EndMethodEnumeration(), class_object_Get(), class_object_GetMethod(), class_object_GetNames(), class_object_GetObjectText(), class_object_GetPropertyQualifierSet(), class_object_GetQualifierSet(), class_object_Next(), class_object_NextMethod(), class_object_Put(), class_object_QueryInterface(), class_object_Release(), and class_object_SpawnInstance().

◆ record_get_value()

static HRESULT record_get_value ( const struct record record,
UINT  index,
VARIANT var,
CIMTYPE type 
)
static

Definition at line 350 of file class.c.

351 {
353 
354  if (type) *type = record->fields[index].type;
355 
356  if (record->fields[index].type & CIM_FLAG_ARRAY)
357  {
358  V_VT( var ) = vartype | VT_ARRAY;
360  return S_OK;
361  }
362  switch (record->fields[index].type)
363  {
364  case CIM_STRING:
365  case CIM_DATETIME:
366  case CIM_REFERENCE:
367  V_BSTR( var ) = SysAllocString( record->fields[index].u.sval );
368  break;
369  case CIM_SINT32:
370  V_I4( var ) = record->fields[index].u.ival;
371  break;
372  case CIM_UINT32:
373  V_UI4( var ) = record->fields[index].u.ival;
374  break;
375  default:
376  FIXME("unhandled type %u\n", record->fields[index].type);
378  }
379  V_VT( var ) = vartype;
380  return S_OK;
381 }
const char * var
Definition: shader.c:5666
#define V_ARRAY(A)
Definition: oleauto.h:222
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
struct field * fields
VARTYPE to_vartype(CIMTYPE type)
Definition: query.c:1032
#define V_I4(A)
Definition: oleauto.h:247
#define CIM_TYPE_MASK
#define FIXME(fmt,...)
Definition: debug.h:111
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
GLuint index
Definition: glext.h:6031
SAFEARRAY * to_safearray(const struct array *array, CIMTYPE basetype)
Definition: query.c:1062
#define V_UI4(A)
Definition: oleauto.h:270
#define index(s, c)
Definition: various.h:29
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define S_OK
Definition: intsafe.h:51
unsigned short VARTYPE
Definition: compat.h:2002

Referenced by class_object_Get().

◆ record_set_value()

static HRESULT record_set_value ( struct record record,
UINT  index,
VARIANT var 
)
static

Definition at line 407 of file class.c.

408 {
409  LONGLONG val;
410  CIMTYPE type;
411  HRESULT hr;
412 
413  if ((hr = to_longlong( var, &val, &type )) != S_OK) return hr;
414  if (type != record->fields[index].type) return WBEM_E_TYPE_MISMATCH;
415 
416  if (type & CIM_FLAG_ARRAY)
417  {
418  record->fields[index].u.aval = (struct array *)(INT_PTR)val;
419  return S_OK;
420  }
421  switch (type)
422  {
423  case CIM_STRING:
424  case CIM_DATETIME:
425  case CIM_REFERENCE:
426  record->fields[index].u.sval = (WCHAR *)(INT_PTR)val;
427  return S_OK;
428  case CIM_SINT16:
429  case CIM_UINT16:
430  case CIM_SINT32:
431  case CIM_UINT32:
432  record->fields[index].u.ival = val;
433  return S_OK;
434  default:
435  FIXME("unhandled type %u\n", type);
436  break;
437  }
439 }
const char * var
Definition: shader.c:5666
HRESULT hr
Definition: shlfolder.c:183
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
struct field * fields
int32_t INT_PTR
Definition: typedefs.h:64
#define FIXME(fmt,...)
Definition: debug.h:111
GLuint index
Definition: glext.h:6031
GLuint GLfloat * val
Definition: glext.h:7180
int64_t LONGLONG
Definition: typedefs.h:68
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:79
#define index(s, c)
Definition: various.h:29
long CIMTYPE
Definition: wbemcli.idl:258
#define S_OK
Definition: intsafe.h:51
HRESULT to_longlong(VARIANT *var, LONGLONG *val, CIMTYPE *type)
Definition: query.c:1325

Referenced by class_object_Put().

◆ set_default_value()

static void set_default_value ( CIMTYPE  type,
UINT  val,
BYTE ptr 
)
static

Definition at line 710 of file class.c.

711 {
712  switch (type)
713  {
714  case CIM_SINT16:
715  *(INT16 *)ptr = val;
716  break;
717  case CIM_UINT16:
718  *(UINT16 *)ptr = val;
719  break;
720  case CIM_SINT32:
721  *(INT32 *)ptr = val;
722  break;
723  case CIM_UINT32:
724  *(UINT32 *)ptr = val;
725  break;
726  default:
727  FIXME("unhandled type %u\n", type);
728  break;
729  }
730 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
unsigned int UINT32
#define FIXME(fmt,...)
Definition: debug.h:111
static PVOID ptr
Definition: dispmode.c:27
GLuint GLfloat * val
Definition: glext.h:7180
unsigned short UINT16
signed int INT32
signed short INT16

Referenced by create_signature_columns_and_data().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wbemprox  )

Variable Documentation

◆ class_object_vtbl

const IWbemClassObjectVtbl class_object_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI class_object_EndEnumeration(IWbemClassObject *iface)
Definition: class.c:550
static HRESULT WINAPI class_object_Next(IWbemClassObject *iface, LONG lFlags, BSTR *strName, VARIANT *pVal, CIMTYPE *pType, LONG *plFlavor)
Definition: class.c:512
static HRESULT WINAPI class_object_GetMethodQualifierSet(IWbemClassObject *iface, LPCWSTR wszMethod, IWbemQualifierSet **ppQualSet)
Definition: class.c:972
static HRESULT WINAPI class_object_NextMethod(IWbemClassObject *iface, LONG lFlags, BSTR *pstrName, IWbemClassObject **ppInSignature, IWbemClassObject **ppOutSignature)
Definition: class.c:925
static HRESULT WINAPI class_object_Get(IWbemClassObject *iface, LPCWSTR wszName, LONG lFlags, VARIANT *pVal, CIMTYPE *pType, LONG *plFlavor)
Definition: class.c:383
static HRESULT WINAPI class_object_GetPropertyQualifierSet(IWbemClassObject *iface, LPCWSTR wszProperty, IWbemQualifierSet **ppQualSet)
Definition: class.c:561
static HRESULT WINAPI class_object_GetObjectText(IWbemClassObject *iface, LONG lFlags, BSTR *pstrObjectText)
Definition: class.c:631
static HRESULT WINAPI class_object_CompareTo(IWbemClassObject *iface, LONG lFlags, IWbemClassObject *pCompareTo)
Definition: class.c:676
static HRESULT WINAPI class_object_BeginEnumeration(IWbemClassObject *iface, LONG lEnumFlags)
Definition: class.c:498
static HRESULT WINAPI class_object_GetPropertyOrigin(IWbemClassObject *iface, LPCWSTR wszName, BSTR *pstrClassName)
Definition: class.c:685
static HRESULT WINAPI class_object_SpawnDerivedClass(IWbemClassObject *iface, LONG lFlags, IWbemClassObject **ppNewClass)
Definition: class.c:650
static HRESULT WINAPI class_object_Clone(IWbemClassObject *iface, IWbemClassObject **ppCopy)
Definition: class.c:573
static HRESULT WINAPI class_object_GetMethodOrigin(IWbemClassObject *iface, LPCWSTR wszMethodName, BSTR *pstrClassName)
Definition: class.c:981
static HRESULT WINAPI class_object_BeginMethodEnumeration(IWbemClassObject *iface, LONG lEnumFlags)
Definition: class.c:911
static HRESULT WINAPI class_object_SpawnInstance(IWbemClassObject *iface, LONG lFlags, IWbemClassObject **ppNewInstance)
Definition: class.c:659
static ULONG WINAPI class_object_AddRef(IWbemClassObject *iface)
Definition: class.c:288
static HRESULT WINAPI class_object_InheritsFrom(IWbemClassObject *iface, LPCWSTR strAncestor)
Definition: class.c:694
static HRESULT WINAPI class_object_GetNames(IWbemClassObject *iface, LPCWSTR wszQualifierName, LONG lFlags, VARIANT *pQualifierVal, SAFEARRAY **pNames)
Definition: class.c:472
static HRESULT WINAPI class_object_DeleteMethod(IWbemClassObject *iface, LPCWSTR wszName)
Definition: class.c:903
static ULONG WINAPI class_object_Release(IWbemClassObject *iface)
Definition: class.c:295
static HRESULT WINAPI class_object_PutMethod(IWbemClassObject *iface, LPCWSTR wszName, LONG lFlags, IWbemClassObject *pInSignature, IWbemClassObject *pOutSignature)
Definition: class.c:892
static HRESULT WINAPI class_object_GetQualifierSet(IWbemClassObject *iface, IWbemQualifierSet **ppQualSet)
Definition: class.c:339
static HRESULT WINAPI class_object_Put(IWbemClassObject *iface, LPCWSTR wszName, LONG lFlags, VARIANT *pVal, CIMTYPE Type)
Definition: class.c:441
static HRESULT WINAPI class_object_GetMethod(IWbemClassObject *iface, LPCWSTR wszName, LONG lFlags, IWbemClassObject **ppInSignature, IWbemClassObject **ppOutSignature)
Definition: class.c:864
static HRESULT WINAPI class_object_Delete(IWbemClassObject *iface, LPCWSTR wszName)
Definition: class.c:464
static HRESULT WINAPI class_object_EndMethodEnumeration(IWbemClassObject *iface)
Definition: class.c:961
static HRESULT WINAPI class_object_QueryInterface(IWbemClassObject *iface, REFIID riid, void **ppvObject)
Definition: class.c:311

Definition at line 990 of file class.c.

Referenced by create_class_object().

◆ enum_class_object_vtbl

const IEnumWbemClassObjectVtbl enum_class_object_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI enum_class_object_QueryInterface(IEnumWbemClassObject *iface, REFIID riid, void **ppvObject)
Definition: class.c:71
static HRESULT WINAPI enum_class_object_Clone(IEnumWbemClassObject *iface, IEnumWbemClassObject **ppEnum)
Definition: class.c:152
static HRESULT WINAPI enum_class_object_Skip(IEnumWbemClassObject *iface, LONG lTimeout, ULONG nCount)
Definition: class.c:163
static ULONG WINAPI enum_class_object_Release(IEnumWbemClassObject *iface)
Definition: class.c:57
static HRESULT WINAPI enum_class_object_NextAsync(IEnumWbemClassObject *iface, ULONG uCount, IWbemObjectSink *pSink)
Definition: class.c:143
static HRESULT WINAPI enum_class_object_Next(IEnumWbemClassObject *iface, LONG lTimeout, ULONG uCount, IWbemClassObject **apObjects, ULONG *puReturned)
Definition: class.c:110
static ULONG WINAPI enum_class_object_AddRef(IEnumWbemClassObject *iface)
Definition: class.c:50
static HRESULT WINAPI enum_class_object_Reset(IEnumWbemClassObject *iface)
Definition: class.c:99

Definition at line 187 of file class.c.

Referenced by EnumWbemClassObject_create().