ReactOS  0.4.14-dev-337-gf981a68
class.c File Reference
#include "config.h"
#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 805 of file class.c.

806 {
807  static const WCHAR fmtW[] = {'_','_','%','s','_','%','s','_','%','s',0};
808  static const WCHAR outW[] = {'O','U','T',0};
809  static const WCHAR inW[] = {'I','N',0};
810  UINT len = ARRAY_SIZE(fmtW) + ARRAY_SIZE(outW) + strlenW( class ) + strlenW( method );
811  WCHAR *ret;
812 
813  if (!(ret = heap_alloc( len * sizeof(WCHAR) ))) return NULL;
814  sprintfW( ret, fmtW, class, method, dir == PARAM_IN ? inW : outW );
815  return struprW( ret );
816 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
unsigned int dir
Definition: maze.c:112
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR inW[]
Definition: lex.c:59
method
Definition: dragdrop.c:53
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define ARRAY_SIZE(a)
Definition: main.h:24
#define sprintfW
Definition: unicode.h:58
unsigned int UINT
Definition: ndis.h:50
GLuint GLenum GLenum GLenum GLenum outW
Definition: glext.h:9616
WINE_UNICODE_INLINE WCHAR * struprW(WCHAR *str)
Definition: unicode.h:288

Referenced by create_signature().

◆ class_object_AddRef()

static ULONG WINAPI class_object_AddRef ( IWbemClassObject iface)
static

Definition at line 286 of file class.c.

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

◆ class_object_BeginEnumeration()

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

Definition at line 494 of file class.c.

497 {
498  struct class_object *co = impl_from_IWbemClassObject( iface );
499 
500  TRACE("%p, %08x\n", iface, lEnumFlags);
501 
502  if (lEnumFlags) FIXME("flags 0x%08x not supported\n", lEnumFlags);
503 
504  co->index_property = 0;
505  return S_OK;
506 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:280
#define FIXME(fmt,...)
Definition: debug.h:110
UINT index_property
Definition: class.c:276
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ class_object_BeginMethodEnumeration()

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

Definition at line 910 of file class.c.

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

◆ class_object_Clone()

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

Definition at line 568 of file class.c.

571 {
572  FIXME("%p, %p\n", iface, ppCopy);
573  return E_NOTIMPL;
574 }
#define FIXME(fmt,...)
Definition: debug.h:110
#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 670 of file class.c.

674 {
675  FIXME("%p, %08x, %p\n", iface, lFlags, pCompareTo);
676  return E_NOTIMPL;
677 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ class_object_Delete()

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

Definition at line 460 of file class.c.

463 {
464  FIXME("%p, %s\n", iface, debugstr_w(wszName));
465  return E_NOTIMPL;
466 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ class_object_DeleteMethod()

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

Definition at line 902 of file class.c.

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

◆ class_object_EndEnumeration()

static HRESULT WINAPI class_object_EndEnumeration ( IWbemClassObject iface)
static

Definition at line 545 of file class.c.

547 {
548  struct class_object *co = impl_from_IWbemClassObject( iface );
549 
550  TRACE("%p\n", iface);
551 
552  co->index_property = 0;
553  return S_OK;
554 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:280
UINT index_property
Definition: class.c:276
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ class_object_EndMethodEnumeration()

static HRESULT WINAPI class_object_EndMethodEnumeration ( IWbemClassObject iface)
static

Definition at line 960 of file class.c.

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

◆ 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 380 of file class.c.

387 {
388  struct class_object *co = impl_from_IWbemClassObject( iface );
390 
391  TRACE("%p, %s, %08x, %p, %p, %p\n", iface, debugstr_w(wszName), lFlags, pVal, pType, plFlavor);
392 
393  if (co->record)
394  {
395  UINT index;
396  HRESULT hr;
397 
398  if ((hr = get_column_index( co->record->table, wszName, &index )) != S_OK) return hr;
399  return record_get_value( co->record, index, pVal, pType );
400  }
401  return get_propval( ec->query->view, co->index, wszName, pVal, pType, plFlavor );
402 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:280
HRESULT get_column_index(const struct table *table, const WCHAR *name, UINT *column)
Definition: table.c:33
HRESULT hr
Definition: shlfolder.c:183
struct query * query
Definition: class.c:38
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:42
HRESULT get_propval(const struct view *view, UINT index, const WCHAR *name, VARIANT *ret, CIMTYPE *type, LONG *flavor)
Definition: query.c:840
#define debugstr_w
Definition: kernel32.h:32
IEnumWbemClassObject * iter
Definition: class.c:273
GLuint index
Definition: glext.h:6031
static HRESULT record_get_value(const struct record *record, UINT index, VARIANT *var, CIMTYPE *type)
Definition: class.c:345
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define index(s, c)
Definition: various.h:29
struct record * record
Definition: class.c:277
#define S_OK
Definition: intsafe.h:59
unsigned int UINT
Definition: ndis.h:50
UINT index
Definition: class.c:274

◆ class_object_GetMethod()

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

Definition at line 863 of file class.c.

869 {
870  struct class_object *co = impl_from_IWbemClassObject( iface );
872  HRESULT hr;
873 
874  TRACE("%p, %s, %08x, %p, %p\n", iface, debugstr_w(wszName), lFlags, ppInSignature, ppOutSignature);
875 
876  hr = create_signature( co->name, wszName, PARAM_IN, &in );
877  if (hr != S_OK) return hr;
878 
879  hr = create_signature( co->name, wszName, PARAM_OUT, &out );
880  if (hr == S_OK)
881  {
882  if (ppInSignature) *ppInSignature = in;
883  else if (in) IWbemClassObject_Release( in );
884  if (ppOutSignature) *ppOutSignature = out;
885  else if (out) IWbemClassObject_Release( out );
886  }
887  else IWbemClassObject_Release( in );
888  return hr;
889 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:280
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:77
static FILE * out
Definition: regtests2xml.c:44
WCHAR * name
Definition: class.c:272
#define S_OK
Definition: intsafe.h:59
GLuint in
Definition: glext.h:9616
HRESULT create_signature(const WCHAR *class, const WCHAR *method, enum param_direction dir, IWbemClassObject **sig)
Definition: class.c:818

◆ class_object_GetMethodOrigin()

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

Definition at line 980 of file class.c.

984 {
985  FIXME("%p, %s, %p\n", iface, debugstr_w(wszMethodName), pstrClassName);
986  return E_NOTIMPL;
987 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#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 971 of file class.c.

975 {
976  FIXME("%p, %s, %p\n", iface, debugstr_w(wszMethod), ppQualSet);
977  return E_NOTIMPL;
978 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#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 468 of file class.c.

474 {
475  struct class_object *co = impl_from_IWbemClassObject( iface );
477 
478  TRACE("%p, %s, %08x, %s, %p\n", iface, debugstr_w(wszQualifierName), lFlags,
479  debugstr_variant(pQualifierVal), pNames);
480 
481  if (lFlags != WBEM_FLAG_ALWAYS &&
482  lFlags != WBEM_FLAG_NONSYSTEM_ONLY &&
483  lFlags != WBEM_FLAG_SYSTEM_ONLY)
484  {
485  FIXME("flags %08x not supported\n", lFlags);
486  return E_NOTIMPL;
487  }
488  if (wszQualifierName || pQualifierVal)
489  FIXME("qualifier not supported\n");
490 
491  return get_properties( ec->query->view, lFlags, pNames );
492 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:280
struct query * query
Definition: class.c:38
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:42
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
HRESULT get_properties(const struct view *view, LONG flags, SAFEARRAY **props)
Definition: query.c:1067
IEnumWbemClassObject * iter
Definition: class.c:273
#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

◆ class_object_GetObjectText()

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

Definition at line 625 of file class.c.

629 {
630  struct class_object *co = impl_from_IWbemClassObject( iface );
632  struct view *view = ec->query->view;
633  BSTR text;
634 
635  TRACE("%p, %08x, %p\n", iface, lFlags, pstrObjectText);
636 
637  if (lFlags) FIXME("flags %08x not implemented\n", lFlags);
638 
639  if (!(text = get_object_text( view, co->index ))) return E_OUTOFMEMORY;
640  *pstrObjectText = text;
641  return S_OK;
642 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:280
struct query * query
Definition: class.c:38
const WCHAR * text
Definition: package.c:1827
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:42
OLECHAR * BSTR
Definition: compat.h:1942
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define FIXME(fmt,...)
Definition: debug.h:110
IEnumWbemClassObject * iter
Definition: class.c:273
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static BSTR get_object_text(const struct view *view, UINT index)
Definition: class.c:607
UINT index
Definition: class.c:274

◆ class_object_GetPropertyOrigin()

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

Definition at line 679 of file class.c.

683 {
684  FIXME("%p, %s, %p\n", iface, debugstr_w(wszName), pstrClassName);
685  return E_NOTIMPL;
686 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#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 556 of file class.c.

560 {
561  struct class_object *co = impl_from_IWbemClassObject( iface );
562 
563  TRACE("%p, %s, %p\n", iface, debugstr_w(wszProperty), ppQualSet);
564 
565  return WbemQualifierSet_create( co->name, wszProperty, (void **)ppQualSet );
566 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:280
HRESULT WbemQualifierSet_create(const WCHAR *class, const WCHAR *member, LPVOID *ppObj)
Definition: qualifier.c:250
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
WCHAR * name
Definition: class.c:272

◆ class_object_GetQualifierSet()

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

Definition at line 337 of file class.c.

340 {
341  FIXME("%p, %p\n", iface, ppQualSet);
342  return E_NOTIMPL;
343 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ class_object_InheritsFrom()

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

Definition at line 688 of file class.c.

691 {
692  FIXME("%p, %s\n", iface, debugstr_w(strAncestor));
693  return E_NOTIMPL;
694 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#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 508 of file class.c.

515 {
516  struct class_object *obj = impl_from_IWbemClassObject( iface );
517  struct enum_class_object *iter = impl_from_IEnumWbemClassObject( obj->iter );
518  struct view *view = iter->query->view;
519  BSTR prop;
520  HRESULT hr;
521  UINT i;
522 
523  TRACE("%p, %08x, %p, %p, %p, %p\n", iface, lFlags, strName, pVal, pType, plFlavor);
524 
525  for (i = obj->index_property; i < view->table->num_cols; i++)
526  {
527  if (is_method( view->table, i )) continue;
528  if (!is_selected_prop( view, view->table->columns[i].name )) continue;
529  if (!(prop = SysAllocString( view->table->columns[i].name ))) return E_OUTOFMEMORY;
530  if ((hr = get_propval( view, obj->index, prop, pVal, pType, plFlavor )) != S_OK)
531  {
532  SysFreeString( prop );
533  return hr;
534  }
535 
536  obj->index_property = i + 1;
537  if (strName) *strName = prop;
538  else SysFreeString( prop );
539 
540  return S_OK;
541  }
542  return WBEM_S_NO_MORE_DATA;
543 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:280
UINT num_cols
HRESULT hr
Definition: shlfolder.c:183
struct query * query
Definition: class.c:38
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:42
HRESULT get_propval(const struct view *view, UINT index, const WCHAR *name, VARIANT *ret, CIMTYPE *type, LONG *flavor)
Definition: query.c:840
OLECHAR * BSTR
Definition: compat.h:1942
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:241
struct table * table
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
BOOL is_selected_prop(const struct view *view, const WCHAR *name)
Definition: query.c:489
#define S_OK
Definition: intsafe.h:59
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
unsigned int UINT
Definition: ndis.h:50
BOOL is_method(const struct table *table, UINT column)
Definition: query.c:628

◆ class_object_NextMethod()

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

Definition at line 924 of file class.c.

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

◆ class_object_Put()

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

Definition at line 437 of file class.c.

443 {
444  struct class_object *co = impl_from_IWbemClassObject( iface );
446 
447  TRACE("%p, %s, %08x, %p, %u\n", iface, debugstr_w(wszName), lFlags, pVal, Type);
448 
449  if (co->record)
450  {
451  UINT index;
452  HRESULT hr;
453 
454  if ((hr = get_column_index( co->record->table, wszName, &index )) != S_OK) return hr;
455  return record_set_value( co->record, index, pVal );
456  }
457  return put_propval( ec->query->view, co->index, wszName, pVal, Type );
458 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:280
HRESULT put_propval(const struct view *view, UINT index, const WCHAR *name, VARIANT *var, CIMTYPE type)
Definition: query.c:1046
HRESULT get_column_index(const struct table *table, const WCHAR *name, UINT *column)
Definition: table.c:33
Type
Definition: Type.h:6
HRESULT hr
Definition: shlfolder.c:183
struct query * query
Definition: class.c:38
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:42
#define debugstr_w
Definition: kernel32.h:32
IEnumWbemClassObject * iter
Definition: class.c:273
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
#define index(s, c)
Definition: various.h:29
struct record * record
Definition: class.c:277
#define S_OK
Definition: intsafe.h:59
unsigned int UINT
Definition: ndis.h:50
static HRESULT record_set_value(struct record *record, UINT index, VARIANT *var)
Definition: class.c:404
UINT index
Definition: class.c:274

◆ class_object_PutMethod()

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

Definition at line 891 of file class.c.

897 {
898  FIXME("%p, %s, %08x, %p, %p\n", iface, debugstr_w(wszName), lFlags, pInSignature, pOutSignature);
899  return E_NOTIMPL;
900 }
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#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 309 of file class.c.

313 {
314  struct class_object *co = impl_from_IWbemClassObject( iface );
315 
316  TRACE("%p, %s, %p\n", co, debugstr_guid( riid ), ppvObject );
317 
318  if ( IsEqualGUID( riid, &IID_IWbemClassObject ) ||
320  {
321  *ppvObject = co;
322  }
323  else if (IsEqualGUID( riid, &IID_IClientSecurity ))
324  {
326  return S_OK;
327  }
328  else
329  {
330  FIXME("interface %s not implemented\n", debugstr_guid(riid));
331  return E_NOINTERFACE;
332  }
333  IWbemClassObject_AddRef( iface );
334  return S_OK;
335 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:280
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
IClientSecurity client_security
Definition: services.c:136
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:59
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 293 of file class.c.

295 {
296  struct class_object *co = impl_from_IWbemClassObject( iface );
298  if (!refs)
299  {
300  TRACE("destroying %p\n", co);
301  if (co->iter) IEnumWbemClassObject_Release( co->iter );
302  destroy_record( co->record );
303  heap_free( co->name );
304  heap_free( co );
305  }
306  return refs;
307 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:280
static void destroy_record(struct record *record)
Definition: class.c:251
LONG refs
Definition: class.c:271
long LONG
Definition: pedump.c:60
IEnumWbemClassObject * iter
Definition: class.c:273
#define TRACE(s)
Definition: solgame.cpp:4
WCHAR * name
Definition: class.c:272
#define InterlockedDecrement
Definition: armddk.h:52
struct record * record
Definition: class.c:277
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 644 of file class.c.

648 {
649  FIXME("%p, %08x, %p\n", iface, lFlags, ppNewClass);
650  return E_NOTIMPL;
651 }
#define FIXME(fmt,...)
Definition: debug.h:110
#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 653 of file class.c.

657 {
658  struct class_object *co = impl_from_IWbemClassObject( iface );
660  struct view *view = ec->query->view;
661  struct record *record;
662 
663  TRACE("%p, %08x, %p\n", iface, lFlags, ppNewInstance);
664 
665  if (!(record = create_record( view->table ))) return E_OUTOFMEMORY;
666 
667  return create_class_object( co->name, NULL, 0, record, ppNewInstance );
668 }
static struct class_object * impl_from_IWbemClassObject(IWbemClassObject *iface)
Definition: class.c:280
struct query * query
Definition: class.c:38
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:42
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
IEnumWbemClassObject * iter
Definition: class.c:273
struct table * table
#define TRACE(s)
Definition: solgame.cpp:4
static struct record * create_record(struct table *table)
Definition: class.c:215
WCHAR * name
Definition: class.c:272
HRESULT create_class_object(const WCHAR *name, IEnumWbemClassObject *iter, UINT index, struct record *record, IWbemClassObject **obj)
Definition: class.c:1020

◆ count_instances()

static UINT count_instances ( IEnumWbemClassObject iter)
static

Definition at line 696 of file class.c.

697 {
698  UINT count = 0;
699  while (!IEnumWbemClassObject_Skip( iter, WBEM_INFINITE, 1 )) count++;
700  IEnumWbemClassObject_Reset( iter );
701  return count;
702 }
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 1020 of file class.c.

1022 {
1023  struct class_object *co;
1024 
1025  TRACE("%s, %p\n", debugstr_w(name), obj);
1026 
1027  co = heap_alloc( sizeof(*co) );
1028  if (!co) return E_OUTOFMEMORY;
1029 
1031  co->refs = 1;
1032  if (!name) co->name = NULL;
1033  else if (!(co->name = heap_strdupW( name )))
1034  {
1035  heap_free( co );
1036  return E_OUTOFMEMORY;
1037  }
1038  co->iter = iter;
1039  co->index = index;
1040  co->index_method = 0;
1041  co->index_property = 0;
1042  co->record = record;
1043  if (iter) IEnumWbemClassObject_AddRef( iter );
1044 
1045  *obj = &co->IWbemClassObject_iface;
1046 
1047  TRACE("returning iface %p\n", *obj);
1048  return S_OK;
1049 }
IWbemClassObject IWbemClassObject_iface
Definition: class.c:270
static const IWbemClassObjectVtbl class_object_vtbl
Definition: class.c:989
LONG refs
Definition: class.c:271
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:273
UINT index_property
Definition: class.c:276
#define TRACE(s)
Definition: solgame.cpp:4
WCHAR * name
Definition: class.c:272
#define index(s, c)
Definition: various.h:29
struct record * record
Definition: class.c:277
UINT index_method
Definition: class.c:275
#define S_OK
Definition: intsafe.h:59
Definition: name.c:36
UINT index
Definition: class.c:274
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

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

◆ create_record()

static struct record* create_record ( struct table table)
static

Definition at line 215 of file class.c.

216 {
217  UINT i;
218  struct record *record;
219 
220  if (!(record = heap_alloc( sizeof(struct record) ))) return NULL;
221  if (!(record->fields = heap_alloc( table->num_cols * sizeof(struct field) )))
222  {
223  heap_free( record );
224  return NULL;
225  }
226  for (i = 0; i < table->num_cols; i++)
227  {
228  record->fields[i].type = table->columns[i].type;
229  record->fields[i].vartype = table->columns[i].vartype;
230  record->fields[i].u.ival = 0;
231  }
234  return record;
235 }
UINT num_cols
const struct column * columns
struct field * fields
struct table * addref_table(struct table *table)
Definition: table.c:348
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 818 of file class.c.

820 {
821  static const WCHAR selectW[] =
822  {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
823  '_','_','P','A','R','A','M','E','T','E','R','S',' ','W','H','E','R','E',' ',
824  'C','l','a','s','s','=','\'','%','s','\'',' ','A','N','D',' ',
825  'M','e','t','h','o','d','=','\'','%','s','\'',' ','A','N','D',' ',
826  'D','i','r','e','c','t','i','o','n','%','s',0};
827  static const WCHAR geW[] = {'>','=','0',0};
828  static const WCHAR leW[] = {'<','=','0',0};
830  IEnumWbemClassObject *iter;
831  WCHAR *query, *name;
832  HRESULT hr;
833 
834  len += strlenW( class ) + strlenW( method );
835  if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return E_OUTOFMEMORY;
836  sprintfW( query, selectW, class, method, dir >= 0 ? geW : leW );
837 
838  hr = exec_query( query, &iter );
839  heap_free( query );
840  if (hr != S_OK) return hr;
841 
842  if (!count_instances( iter ))
843  {
844  *sig = NULL;
845  IEnumWbemClassObject_Release( iter );
846  return S_OK;
847  }
848 
849  if (!(name = build_signature_table_name( class, method, dir )))
850  {
851  IEnumWbemClassObject_Release( iter );
852  return E_OUTOFMEMORY;
853  }
854  hr = create_signature_table( iter, name );
855  IEnumWbemClassObject_Release( iter );
856  if (hr == S_OK)
857  hr = get_object( name, sig );
858 
859  heap_free( name );
860  return hr;
861 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
HRESULT hr
Definition: shlfolder.c:183
static IDispatch * get_object(jsval_t v)
Definition: jsval.h:219
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static HRESULT create_signature_table(IEnumWbemClassObject *iter, WCHAR *name)
Definition: class.c:784
static UINT count_instances(IEnumWbemClassObject *iter)
Definition: class.c:696
#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:929
static const WCHAR selectW[]
Definition: htmlelem.c:38
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
method
Definition: dragdrop.c:53
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59
static WCHAR * build_signature_table_name(const WCHAR *class, const WCHAR *method, enum param_direction dir)
Definition: class.c:805
#define ARRAY_SIZE(a)
Definition: main.h:24
#define sprintfW
Definition: unicode.h:58
HRESULT exec_query(const WCHAR *str, IEnumWbemClassObject **result)
Definition: query.c:471
unsigned int UINT
Definition: ndis.h:50
Definition: name.c:36
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 726 of file class.c.

728 {
729  static const WCHAR parameterW[] = {'P','a','r','a','m','e','t','e','r',0};
730  static const WCHAR typeW[] = {'T','y','p','e',0};
731  static const WCHAR varianttypeW[] = {'V','a','r','i','a','n','t','T','y','p','e',0};
732  static const WCHAR defaultvalueW[] = {'D','e','f','a','u','l','t','V','a','l','u','e',0};
733  struct column *columns;
734  BYTE *row;
736  VARIANT val;
738  UINT offset = 0;
739  ULONG count;
740  int i = 0;
741 
742  count = count_instances( iter );
743  if (!(columns = heap_alloc( count * sizeof(struct column) ))) return E_OUTOFMEMORY;
744  if (!(row = heap_alloc_zero( count * sizeof(LONGLONG) ))) goto error;
745 
746  for (;;)
747  {
748  IEnumWbemClassObject_Next( iter, WBEM_INFINITE, 1, &param, &count );
749  if (!count) break;
750 
751  hr = IWbemClassObject_Get( param, parameterW, 0, &val, NULL, NULL );
752  if (hr != S_OK) goto error;
753  columns[i].name = heap_strdupW( V_BSTR( &val ) );
754  VariantClear( &val );
755 
756  hr = IWbemClassObject_Get( param, typeW, 0, &val, NULL, NULL );
757  if (hr != S_OK) goto error;
758  columns[i].type = V_UI4( &val );
759 
760  hr = IWbemClassObject_Get( param, varianttypeW, 0, &val, NULL, NULL );
761  if (hr != S_OK) goto error;
762  columns[i].vartype = V_UI4( &val );
763 
764  hr = IWbemClassObject_Get( param, defaultvalueW, 0, &val, NULL, NULL );
765  if (hr != S_OK) goto error;
766  if (V_UI4( &val )) set_default_value( columns[i].type, V_UI4( &val ), row + offset );
767  offset += get_type_size( columns[i].type );
768 
769  IWbemClassObject_Release( param );
770  i++;
771  }
772  *num_cols = i;
773  *cols = columns;
774  *data = row;
775  return S_OK;
776 
777 error:
778  for (; i >= 0; i--) heap_free( (WCHAR *)columns[i].name );
779  heap_free( columns );
780  heap_free( row );
781  return hr;
782 }
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
VARTYPE vartype
static const WCHAR typeW[]
Definition: name.c:49
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static void set_default_value(CIMTYPE type, UINT val, BYTE *ptr)
Definition: class.c:704
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:696
#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:66
__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:77
GLfloat param
Definition: glext.h:5796
int JSAMPARRAY int int JDIMENSION num_cols
Definition: jpegint.h:412
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:651
unsigned char BYTE
Definition: mem.h:68
#define V_BSTR(A)
Definition: oleauto.h:226
#define S_OK
Definition: intsafe.h:59
const WCHAR * name
unsigned int UINT
Definition: ndis.h:50
Definition: name.c:36
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 784 of file class.c.

785 {
786  HRESULT hr;
787  struct table *table;
788  struct column *columns;
789  UINT num_cols;
790  BYTE *row;
791 
792  hr = create_signature_columns_and_data( iter, &num_cols, &columns, &row );
793  if (hr != S_OK) return hr;
794 
795  if (!(table = create_table( name, num_cols, columns, 1, 1, row, NULL )))
796  {
797  free_columns( columns, num_cols );
798  heap_free( row );
799  return E_OUTOFMEMORY;
800  }
801  if (!add_table( table )) free_table( table ); /* already exists */
802  return S_OK;
803 }
void free_columns(struct column *columns, UINT num_cols)
Definition: table.c:319
HRESULT hr
Definition: shlfolder.c:183
BOOL add_table(struct table *table)
Definition: table.c:389
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:726
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
int JSAMPARRAY int int JDIMENSION num_cols
Definition: jpegint.h:412
unsigned char BYTE
Definition: mem.h:68
static void free_table(MSITABLE *table)
Definition: table.c:372
#define S_OK
Definition: intsafe.h:59
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:369
Definition: name.c:36
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 237 of file class.c.

238 {
239  UINT i, size;
240 
241  if (!array) return;
242  if (type == CIM_STRING || type == CIM_DATETIME)
243  {
244  size = get_type_size( type );
245  for (i = 0; i < array->count; i++) heap_free( *(WCHAR **)((char *)array->ptr + i * size) );
246  }
247  heap_free( array->ptr );
248  heap_free( array );
249 }
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
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned int get_type_size(ULONG *pFlags, VARTYPE vt)
Definition: usrmarshal.c:209
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 251 of file class.c.

252 {
253  UINT i;
254 
255  if (!record) return;
257  for (i = 0; i < record->count; i++)
258  {
259  if (record->fields[i].type == CIM_STRING || record->fields[i].type == CIM_DATETIME)
260  heap_free( record->fields[i].u.sval );
261  else if (record->fields[i].type & CIM_FLAG_ARRAY)
262  destroy_array( record->fields[i].u.aval, record->fields[i].type & CIM_TYPE_MASK );
263  }
264  heap_free( record->fields );
265  heap_free( record );
266 }
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:237
void release_table(struct table *table)
Definition: table.c:343
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 48 of file class.c.

50 {
52  return InterlockedIncrement( &ec->refs );
53 }
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:42
#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 148 of file class.c.

151 {
153 
154  TRACE("%p, %p\n", iface, ppEnum);
155 
156  return EnumWbemClassObject_create( ec->query, (void **)ppEnum );
157 }
struct query * query
Definition: class.c:38
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:42
HRESULT EnumWbemClassObject_create(struct query *query, LPVOID *ppObj)
Definition: class.c:195
#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 108 of file class.c.

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

◆ enum_class_object_NextAsync()

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

Definition at line 139 of file class.c.

143 {
144  FIXME("%p, %u, %p\n", iface, uCount, pSink);
145  return E_NOTIMPL;
146 }
#define FIXME(fmt,...)
Definition: debug.h:110
#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 69 of file class.c.

73 {
75 
76  TRACE("%p, %s, %p\n", ec, debugstr_guid( riid ), ppvObject );
77 
78  if ( IsEqualGUID( riid, &IID_IEnumWbemClassObject ) ||
80  {
81  *ppvObject = ec;
82  }
83  else if ( IsEqualGUID( riid, &IID_IClientSecurity ) )
84  {
86  return S_OK;
87  }
88  else
89  {
90  FIXME("interface %s not implemented\n", debugstr_guid(riid));
91  return E_NOINTERFACE;
92  }
93  IEnumWbemClassObject_AddRef( iface );
94  return S_OK;
95 }
#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:42
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
IClientSecurity client_security
Definition: services.c:136
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:59
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 55 of file class.c.

57 {
60  if (!refs)
61  {
62  TRACE("destroying %p\n", ec);
63  release_query( ec->query );
64  heap_free( ec );
65  }
66  return refs;
67 }
struct query * query
Definition: class.c:38
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:42
long LONG
Definition: pedump.c:60
void release_query(struct query *query)
Definition: query.c:466
#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 97 of file class.c.

99 {
101 
102  TRACE("%p\n", iface);
103 
104  ec->index = 0;
105  return WBEM_S_NO_ERROR;
106 }
static struct enum_class_object * impl_from_IEnumWbemClassObject(IEnumWbemClassObject *iface)
Definition: class.c:42
#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 159 of file class.c.

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

◆ EnumWbemClassObject_create()

HRESULT EnumWbemClassObject_create ( struct query query,
LPVOID ppObj 
)

Definition at line 195 of file class.c.

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

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 576 of file class.c.

577 {
578  static const WCHAR fmtW[] = {'\n','\t','%','s',' ','=',' ','%','s',';',0};
579  BSTR value, ret;
580  WCHAR *p;
581  UINT i;
582 
583  *len = 0;
584  for (i = 0; i < table->num_cols; i++)
585  {
586  if ((value = get_value_bstr( table, row, i )))
587  {
588  *len += ARRAY_SIZE( fmtW );
589  *len += strlenW( table->columns[i].name );
590  *len += SysStringLen( value );
591  SysFreeString( value );
592  }
593  }
594  if (!(ret = SysAllocStringLen( NULL, *len ))) return NULL;
595  p = ret;
596  for (i = 0; i < table->num_cols; i++)
597  {
598  if ((value = get_value_bstr( table, row, i )))
599  {
600  p += sprintfW( p, fmtW, table->columns[i].name, value );
601  SysFreeString( value );
602  }
603  }
604  return ret;
605 }
UINT num_cols
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:342
const struct column * columns
OLECHAR * BSTR
Definition: compat.h:1942
BSTR get_value_bstr(const struct table *table, UINT row, UINT column)
Definition: table.c:149
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
int ret
GLenum GLsizei len
Definition: glext.h:6722
UINT WINAPI SysStringLen(BSTR str)
Definition: oleaut.c:199
int value
Definition: class.c:930
#define ARRAY_SIZE(a)
Definition: main.h:24
#define sprintfW
Definition: unicode.h:58
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
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 607 of file class.c.

608 {
609  static const WCHAR fmtW[] =
610  {'\n','i','n','s','t','a','n','c','e',' ','o','f',' ','%','s','\n','{','%','s','\n','}',';',0};
611  UINT len, len_body, row = view->result[index];
612  BSTR ret, body;
613 
614  len = ARRAY_SIZE( fmtW );
615  len += strlenW( view->table->name );
616  if (!(body = get_body_text( view->table, row, &len_body ))) return NULL;
617  len += len_body;
618 
619  if (!(ret = SysAllocStringLen( NULL, len ))) return NULL;
620  sprintfW( ret, fmtW, view->table->name, body );
621  SysFreeString( body );
622  return ret;
623 }
static BSTR get_body_text(const struct table *table, UINT row, UINT *len)
Definition: class.c:576
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:342
OLECHAR * BSTR
Definition: compat.h:1942
UINT * result
smooth NULL
Definition: ftsmooth.c:416
struct table * table
__wchar_t WCHAR
Definition: xmlstorage.h:180
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
#define sprintfW
Definition: unicode.h:58
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:274
unsigned int UINT
Definition: ndis.h:50
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 42 of file class.c.

44 {
46 }
IEnumWbemClassObject IEnumWbemClassObject_iface
Definition: class.c:36
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 280 of file class.c.

282 {
283  return CONTAINING_RECORD(iface, struct class_object, IWbemClassObject_iface);
284 }
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_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 345 of file class.c.

346 {
347  VARTYPE vartype = record->fields[index].vartype;
348 
349  if (type) *type = record->fields[index].type;
350 
351  if (record->fields[index].type & CIM_FLAG_ARRAY)
352  {
354  V_ARRAY( var ) = to_safearray( record->fields[index].u.aval, record->fields[index].type & CIM_TYPE_MASK );
355  return S_OK;
356  }
357  switch (record->fields[index].type)
358  {
359  case CIM_STRING:
360  case CIM_DATETIME:
361  if (!vartype) vartype = VT_BSTR;
362  V_BSTR( var ) = SysAllocString( record->fields[index].u.sval );
363  break;
364  case CIM_SINT32:
365  if (!vartype) vartype = VT_I4;
366  V_I4( var ) = record->fields[index].u.ival;
367  break;
368  case CIM_UINT32:
369  if (!vartype) vartype = VT_UI4;
370  V_UI4( var ) = record->fields[index].u.ival;
371  break;
372  default:
373  FIXME("unhandled type %u\n", record->fields[index].type);
375  }
376  V_VT( var ) = vartype;
377  return S_OK;
378 }
Definition: compat.h:1947
#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:743
#define V_I4(A)
Definition: oleauto.h:247
#define CIM_TYPE_MASK
#define FIXME(fmt,...)
Definition: debug.h:110
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
GLuint index
Definition: glext.h:6031
#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
SAFEARRAY * to_safearray(const struct array *array, CIMTYPE type)
Definition: query.c:765
#define S_OK
Definition: intsafe.h:59
unsigned short VARTYPE
Definition: compat.h:1903

Referenced by class_object_Get().

◆ record_set_value()

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

Definition at line 404 of file class.c.

405 {
406  LONGLONG val;
407  CIMTYPE type;
408  HRESULT hr;
409 
410  if ((hr = to_longlong( var, &val, &type )) != S_OK) return hr;
411  if (type != record->fields[index].type) return WBEM_E_TYPE_MISMATCH;
412 
413  if (type & CIM_FLAG_ARRAY)
414  {
415  record->fields[index].u.aval = (struct array *)(INT_PTR)val;
416  return S_OK;
417  }
418  switch (type)
419  {
420  case CIM_STRING:
421  case CIM_DATETIME:
422  record->fields[index].u.sval = (WCHAR *)(INT_PTR)val;
423  return S_OK;
424  case CIM_SINT16:
425  case CIM_UINT16:
426  case CIM_SINT32:
427  case CIM_UINT32:
428  record->fields[index].u.ival = val;
429  return S_OK;
430  default:
431  FIXME("unhandled type %u\n", type);
432  break;
433  }
435 }
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:62
#define FIXME(fmt,...)
Definition: debug.h:110
GLuint index
Definition: glext.h:6031
GLuint GLfloat * val
Definition: glext.h:7180
int64_t LONGLONG
Definition: typedefs.h:66
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define index(s, c)
Definition: various.h:29
long CIMTYPE
Definition: wbemcli.idl:258
#define S_OK
Definition: intsafe.h:59
HRESULT to_longlong(VARIANT *var, LONGLONG *val, CIMTYPE *type)
Definition: query.c:996

Referenced by class_object_Put().

◆ set_default_value()

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

Definition at line 704 of file class.c.

705 {
706  switch (type)
707  {
708  case CIM_SINT16:
709  *(INT16 *)ptr = val;
710  break;
711  case CIM_UINT16:
712  *(UINT16 *)ptr = val;
713  break;
714  case CIM_SINT32:
715  *(INT32 *)ptr = val;
716  break;
717  case CIM_UINT32:
718  *(UINT32 *)ptr = val;
719  break;
720  default:
721  FIXME("unhandled type %u\n", type);
722  break;
723  }
724 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
unsigned int UINT32
#define FIXME(fmt,...)
Definition: debug.h:110
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:545
static HRESULT WINAPI class_object_Next(IWbemClassObject *iface, LONG lFlags, BSTR *strName, VARIANT *pVal, CIMTYPE *pType, LONG *plFlavor)
Definition: class.c:508
static HRESULT WINAPI class_object_GetMethodQualifierSet(IWbemClassObject *iface, LPCWSTR wszMethod, IWbemQualifierSet **ppQualSet)
Definition: class.c:971
static HRESULT WINAPI class_object_NextMethod(IWbemClassObject *iface, LONG lFlags, BSTR *pstrName, IWbemClassObject **ppInSignature, IWbemClassObject **ppOutSignature)
Definition: class.c:924
static HRESULT WINAPI class_object_Get(IWbemClassObject *iface, LPCWSTR wszName, LONG lFlags, VARIANT *pVal, CIMTYPE *pType, LONG *plFlavor)
Definition: class.c:380
static HRESULT WINAPI class_object_GetPropertyQualifierSet(IWbemClassObject *iface, LPCWSTR wszProperty, IWbemQualifierSet **ppQualSet)
Definition: class.c:556
static HRESULT WINAPI class_object_GetObjectText(IWbemClassObject *iface, LONG lFlags, BSTR *pstrObjectText)
Definition: class.c:625
static HRESULT WINAPI class_object_CompareTo(IWbemClassObject *iface, LONG lFlags, IWbemClassObject *pCompareTo)
Definition: class.c:670
static HRESULT WINAPI class_object_BeginEnumeration(IWbemClassObject *iface, LONG lEnumFlags)
Definition: class.c:494
static HRESULT WINAPI class_object_GetPropertyOrigin(IWbemClassObject *iface, LPCWSTR wszName, BSTR *pstrClassName)
Definition: class.c:679
static HRESULT WINAPI class_object_SpawnDerivedClass(IWbemClassObject *iface, LONG lFlags, IWbemClassObject **ppNewClass)
Definition: class.c:644
static HRESULT WINAPI class_object_Clone(IWbemClassObject *iface, IWbemClassObject **ppCopy)
Definition: class.c:568
static HRESULT WINAPI class_object_GetMethodOrigin(IWbemClassObject *iface, LPCWSTR wszMethodName, BSTR *pstrClassName)
Definition: class.c:980
static HRESULT WINAPI class_object_BeginMethodEnumeration(IWbemClassObject *iface, LONG lEnumFlags)
Definition: class.c:910
static HRESULT WINAPI class_object_SpawnInstance(IWbemClassObject *iface, LONG lFlags, IWbemClassObject **ppNewInstance)
Definition: class.c:653
static ULONG WINAPI class_object_AddRef(IWbemClassObject *iface)
Definition: class.c:286
static HRESULT WINAPI class_object_InheritsFrom(IWbemClassObject *iface, LPCWSTR strAncestor)
Definition: class.c:688
static HRESULT WINAPI class_object_GetNames(IWbemClassObject *iface, LPCWSTR wszQualifierName, LONG lFlags, VARIANT *pQualifierVal, SAFEARRAY **pNames)
Definition: class.c:468
static HRESULT WINAPI class_object_DeleteMethod(IWbemClassObject *iface, LPCWSTR wszName)
Definition: class.c:902
static ULONG WINAPI class_object_Release(IWbemClassObject *iface)
Definition: class.c:293
static HRESULT WINAPI class_object_PutMethod(IWbemClassObject *iface, LPCWSTR wszName, LONG lFlags, IWbemClassObject *pInSignature, IWbemClassObject *pOutSignature)
Definition: class.c:891
static HRESULT WINAPI class_object_GetQualifierSet(IWbemClassObject *iface, IWbemQualifierSet **ppQualSet)
Definition: class.c:337
static HRESULT WINAPI class_object_Put(IWbemClassObject *iface, LPCWSTR wszName, LONG lFlags, VARIANT *pVal, CIMTYPE Type)
Definition: class.c:437
static HRESULT WINAPI class_object_GetMethod(IWbemClassObject *iface, LPCWSTR wszName, LONG lFlags, IWbemClassObject **ppInSignature, IWbemClassObject **ppOutSignature)
Definition: class.c:863
static HRESULT WINAPI class_object_Delete(IWbemClassObject *iface, LPCWSTR wszName)
Definition: class.c:460
static HRESULT WINAPI class_object_EndMethodEnumeration(IWbemClassObject *iface)
Definition: class.c:960
static HRESULT WINAPI class_object_QueryInterface(IWbemClassObject *iface, REFIID riid, void **ppvObject)
Definition: class.c:309

Definition at line 989 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:69
static HRESULT WINAPI enum_class_object_Clone(IEnumWbemClassObject *iface, IEnumWbemClassObject **ppEnum)
Definition: class.c:148
static HRESULT WINAPI enum_class_object_Skip(IEnumWbemClassObject *iface, LONG lTimeout, ULONG nCount)
Definition: class.c:159
static ULONG WINAPI enum_class_object_Release(IEnumWbemClassObject *iface)
Definition: class.c:55
static HRESULT WINAPI enum_class_object_NextAsync(IEnumWbemClassObject *iface, ULONG uCount, IWbemObjectSink *pSink)
Definition: class.c:139
static HRESULT WINAPI enum_class_object_Next(IEnumWbemClassObject *iface, LONG lTimeout, ULONG uCount, IWbemClassObject **apObjects, ULONG *puReturned)
Definition: class.c:108
static ULONG WINAPI enum_class_object_AddRef(IEnumWbemClassObject *iface)
Definition: class.c:48
static HRESULT WINAPI enum_class_object_Reset(IEnumWbemClassObject *iface)
Definition: class.c:97

Definition at line 183 of file class.c.

Referenced by EnumWbemClassObject_create().