ReactOS  0.4.14-dev-606-g14ebc0b
wbemprox_private.h File Reference
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
Include dependency graph for wbemprox_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  complex_expr
 
struct  expr
 
struct  column
 
struct  table
 
struct  property
 
struct  array
 
struct  field
 
struct  record
 
struct  keyword
 
struct  view
 
struct  query
 
struct  path
 

Macros

#define CIM_TYPE_MASK   0x00000fff
 
#define COL_TYPE_MASK   0x0000ffff
 
#define COL_FLAG_DYNAMIC   0x00010000
 
#define COL_FLAG_KEY   0x00020000
 
#define COL_FLAG_METHOD   0x00040000
 
#define TABLE_FLAG_DYNAMIC   0x00000001
 

Typedefs

typedef HRESULT() class_method(IWbemClassObject *, IWbemClassObject *, IWbemClassObject **)
 

Enumerations

enum  param_direction { PARAM_OUT = -1, PARAM_INOUT = 0, PARAM_IN = 1 }
 
enum  operator {
  OP_EQ = 1, OP_AND = 2, OP_OR = 3, OP_GT = 4,
  OP_LT = 5, OP_LE = 6, OP_GE = 7, OP_NE = 8,
  OP_ISNULL = 9, OP_NOTNULL = 10, OP_LIKE = 11, OP_NOT = 12
}
 
enum  expr_type {
  EXPR_COMPLEX = 1, EXPR_UNARY = 2, EXPR_PROPVAL = 3, EXPR_SVAL = 4,
  EXPR_IVAL = 5, EXPR_BVAL = 6, EXPR_VOID, EXPR_NUM,
  EXPR_HEXNUM, EXPR_DOUBLE, EXPR_IDENTIFIER, EXPR_NEG,
  EXPR_NOT, EXPR_PPTR, EXPR_CAST, EXPR_SIZEOF,
  EXPR_SHL, EXPR_SHR, EXPR_MUL, EXPR_DIV,
  EXPR_ADD, EXPR_SUB, EXPR_AND, EXPR_OR,
  EXPR_COND, EXPR_TRUEFALSE, EXPR_ADDRESSOF, EXPR_MEMBER,
  EXPR_ARRAY, EXPR_MOD, EXPR_LOGOR, EXPR_LOGAND,
  EXPR_XOR, EXPR_EQUALITY, EXPR_INEQUALITY, EXPR_GTR,
  EXPR_LESS, EXPR_GTREQL, EXPR_LESSEQL, EXPR_LOGNOT,
  EXPR_POS, EXPR_STRLIT, EXPR_WSTRLIT, EXPR_CHARCONST
}
 
enum  fill_status { FILL_STATUS_FAILED = -1, FILL_STATUS_UNFILTERED, FILL_STATUS_FILTERED }
 
enum  view_type { VIEW_TYPE_SELECT, VIEW_TYPE_ASSOCIATORS }
 

Functions

HRESULT parse_path (const WCHAR *, struct path **) DECLSPEC_HIDDEN
 
void free_path (struct path *) DECLSPEC_HIDDEN
 
WCHARquery_from_path (const struct path *) DECLSPEC_HIDDEN
 
struct querycreate_query (void) DECLSPEC_HIDDEN
 
void free_query (struct query *) DECLSPEC_HIDDEN
 
struct queryaddref_query (struct query *) DECLSPEC_HIDDEN
 
void release_query (struct query *query) DECLSPEC_HIDDEN
 
HRESULT exec_query (const WCHAR *, IEnumWbemClassObject **) DECLSPEC_HIDDEN
 
HRESULT parse_query (const WCHAR *, struct view **, struct list *) DECLSPEC_HIDDEN
 
HRESULT create_view (enum view_type, const WCHAR *, const struct keyword *, const WCHAR *, const struct property *, const struct expr *, struct view **) DECLSPEC_HIDDEN
 
void destroy_view (struct view *) DECLSPEC_HIDDEN
 
HRESULT execute_view (struct view *) DECLSPEC_HIDDEN
 
struct tableget_view_table (const struct view *, UINT) DECLSPEC_HIDDEN
 
void init_table_list (void) DECLSPEC_HIDDEN
 
struct tablegrab_table (const WCHAR *) DECLSPEC_HIDDEN
 
struct tableaddref_table (struct table *) DECLSPEC_HIDDEN
 
void release_table (struct table *) DECLSPEC_HIDDEN
 
struct tablecreate_table (const WCHAR *, UINT, const struct column *, UINT, UINT, BYTE *, enum fill_status(*)(struct table *, const struct expr *)) DECLSPEC_HIDDEN
 
BOOL add_table (struct table *) DECLSPEC_HIDDEN
 
void free_columns (struct column *, UINT) DECLSPEC_HIDDEN
 
void free_row_values (const struct table *, UINT) DECLSPEC_HIDDEN
 
void clear_table (struct table *) DECLSPEC_HIDDEN
 
void free_table (struct table *) DECLSPEC_HIDDEN
 
UINT get_type_size (CIMTYPE) DECLSPEC_HIDDEN
 
HRESULT eval_cond (const struct table *, UINT, const struct expr *, LONGLONG *, UINT *) DECLSPEC_HIDDEN
 
HRESULT get_column_index (const struct table *, const WCHAR *, UINT *) DECLSPEC_HIDDEN
 
HRESULT get_value (const struct table *, UINT, UINT, LONGLONG *) DECLSPEC_HIDDEN
 
BSTR get_value_bstr (const struct table *, UINT, UINT) DECLSPEC_HIDDEN
 
HRESULT set_value (const struct table *, UINT, UINT, LONGLONG, CIMTYPE) DECLSPEC_HIDDEN
 
BOOL is_method (const struct table *, UINT) DECLSPEC_HIDDEN
 
HRESULT get_method (const struct table *, const WCHAR *, class_method **) DECLSPEC_HIDDEN
 
HRESULT get_propval (const struct view *, UINT, const WCHAR *, VARIANT *, CIMTYPE *, LONG *) DECLSPEC_HIDDEN
 
HRESULT put_propval (const struct view *, UINT, const WCHAR *, VARIANT *, CIMTYPE) DECLSPEC_HIDDEN
 
HRESULT to_longlong (VARIANT *, LONGLONG *, CIMTYPE *) DECLSPEC_HIDDEN
 
SAFEARRAYto_safearray (const struct array *, CIMTYPE) DECLSPEC_HIDDEN
 
VARTYPE to_vartype (CIMTYPE) DECLSPEC_HIDDEN
 
void destroy_array (struct array *, CIMTYPE) DECLSPEC_HIDDEN
 
BOOL is_result_prop (const struct view *, const WCHAR *) DECLSPEC_HIDDEN
 
HRESULT get_properties (const struct view *, UINT, LONG, SAFEARRAY **) DECLSPEC_HIDDEN
 
HRESULT get_object (const WCHAR *, IWbemClassObject **) DECLSPEC_HIDDEN
 
BSTR get_method_name (const WCHAR *, UINT) DECLSPEC_HIDDEN
 
void set_variant (VARTYPE, LONGLONG, void *, VARIANT *) DECLSPEC_HIDDEN
 
HRESULT create_signature (const WCHAR *, const WCHAR *, enum param_direction, IWbemClassObject **) DECLSPEC_HIDDEN
 
HRESULT WbemLocator_create (LPVOID *) DECLSPEC_HIDDEN
 
HRESULT WbemServices_create (const WCHAR *, LPVOID *) DECLSPEC_HIDDEN
 
HRESULT create_class_object (const WCHAR *, IEnumWbemClassObject *, UINT, struct record *, IWbemClassObject **) DECLSPEC_HIDDEN
 
HRESULT EnumWbemClassObject_create (struct query *, LPVOID *) DECLSPEC_HIDDEN
 
HRESULT WbemQualifierSet_create (const WCHAR *, const WCHAR *, LPVOID *) DECLSPEC_HIDDEN
 
HRESULT process_get_owner (IWbemClassObject *, IWbemClassObject *, IWbemClassObject **) DECLSPEC_HIDDEN
 
HRESULT reg_create_key (IWbemClassObject *, IWbemClassObject *, IWbemClassObject **) DECLSPEC_HIDDEN
 
HRESULT reg_enum_key (IWbemClassObject *, IWbemClassObject *, IWbemClassObject **) DECLSPEC_HIDDEN
 
HRESULT reg_enum_values (IWbemClassObject *, IWbemClassObject *, IWbemClassObject **) DECLSPEC_HIDDEN
 
HRESULT reg_get_stringvalue (IWbemClassObject *, IWbemClassObject *, IWbemClassObject **) DECLSPEC_HIDDEN
 
HRESULT service_pause_service (IWbemClassObject *, IWbemClassObject *, IWbemClassObject **) DECLSPEC_HIDDEN
 
HRESULT service_resume_service (IWbemClassObject *, IWbemClassObject *, IWbemClassObject **) DECLSPEC_HIDDEN
 
HRESULT service_start_service (IWbemClassObject *, IWbemClassObject *, IWbemClassObject **) DECLSPEC_HIDDEN
 
HRESULT service_stop_service (IWbemClassObject *, IWbemClassObject *, IWbemClassObject **) DECLSPEC_HIDDEN
 
HRESULT security_get_sd (IWbemClassObject *, IWbemClassObject *, IWbemClassObject **) DECLSPEC_HIDDEN
 
HRESULT security_set_sd (IWbemClassObject *, IWbemClassObject *, IWbemClassObject **) DECLSPEC_HIDDEN
 
static WCHARheap_strdupW (const WCHAR *src)
 
static WCHARheap_strdupAW (const char *src)
 

Variables

IClientSecurity client_security DECLSPEC_HIDDEN
 
enum param_direction helpstring
 
static const WCHAR class_processW [] = {'W','i','n','3','2','_','P','r','o','c','e','s','s',0}
 
static const WCHAR class_serviceW [] = {'W','i','n','3','2','_','S','e','r','v','i','c','e',0}
 
static const WCHAR class_stdregprovW [] = {'S','t','d','R','e','g','P','r','o','v',0}
 
static const WCHAR class_systemsecurityW [] = {'_','_','S','y','s','t','e','m','S','e','c','u','r','i','t','y',0}
 
static const WCHAR prop_nameW [] = {'N','a','m','e',0}
 
static const WCHAR method_createkeyW [] = {'C','r','e','a','t','e','K','e','y',0}
 
static const WCHAR method_enumkeyW [] = {'E','n','u','m','K','e','y',0}
 
static const WCHAR method_enumvaluesW [] = {'E','n','u','m','V','a','l','u','e','s',0}
 
static const WCHAR method_getownerW [] = {'G','e','t','O','w','n','e','r',0}
 
static const WCHAR method_getsdW [] = {'G','e','t','S','D',0}
 
static const WCHAR method_getstringvalueW [] = {'G','e','t','S','t','r','i','n','g','V','a','l','u','e',0}
 
static const WCHAR method_pauseserviceW [] = {'P','a','u','s','e','S','e','r','v','i','c','e',0}
 
static const WCHAR method_resumeserviceW [] = {'R','e','s','u','m','e','S','e','r','v','i','c','e',0}
 
static const WCHAR method_setsdW [] = {'S','e','t','S','D',0}
 
static const WCHAR method_startserviceW [] = {'S','t','a','r','t','S','e','r','v','i','c','e',0}
 
static const WCHAR method_stopserviceW [] = {'S','t','o','p','S','e','r','v','i','c','e',0}
 
static const WCHAR param_defkeyW [] = {'h','D','e','f','K','e','y',0}
 
static const WCHAR param_domainW [] = {'D','o','m','a','i','n',0}
 
static const WCHAR param_namesW [] = {'s','N','a','m','e','s',0}
 
static const WCHAR param_returnvalueW [] = {'R','e','t','u','r','n','V','a','l','u','e',0}
 
static const WCHAR param_sdW [] = {'S','D',0}
 
static const WCHAR param_subkeynameW [] = {'s','S','u','b','K','e','y','N','a','m','e',0}
 
static const WCHAR param_typesW [] = {'T','y','p','e','s',0}
 
static const WCHAR param_userW [] = {'U','s','e','r',0}
 
static const WCHAR param_valueW [] = {'s','V','a','l','u','e',0}
 
static const WCHAR param_valuenameW [] = {'s','V','a','l','u','e','N','a','m','e',0}
 

Macro Definition Documentation

◆ CIM_TYPE_MASK

#define CIM_TYPE_MASK   0x00000fff

Definition at line 38 of file wbemprox_private.h.

◆ COL_FLAG_DYNAMIC

#define COL_FLAG_DYNAMIC   0x00010000

Definition at line 41 of file wbemprox_private.h.

◆ COL_FLAG_KEY

#define COL_FLAG_KEY   0x00020000

Definition at line 42 of file wbemprox_private.h.

◆ COL_FLAG_METHOD

#define COL_FLAG_METHOD   0x00040000

Definition at line 43 of file wbemprox_private.h.

◆ COL_TYPE_MASK

#define COL_TYPE_MASK   0x0000ffff

Definition at line 40 of file wbemprox_private.h.

◆ TABLE_FLAG_DYNAMIC

#define TABLE_FLAG_DYNAMIC   0x00000001

Definition at line 106 of file wbemprox_private.h.

Typedef Documentation

◆ class_method

typedef HRESULT() class_method(IWbemClassObject *, IWbemClassObject *, IWbemClassObject **)

Definition at line 45 of file wbemprox_private.h.

Enumeration Type Documentation

◆ expr_type

Enumerator
EXPR_COMPLEX 
EXPR_UNARY 
EXPR_PROPVAL 
EXPR_SVAL 
EXPR_IVAL 
EXPR_BVAL 
EXPR_VOID 
EXPR_NUM 
EXPR_HEXNUM 
EXPR_DOUBLE 
EXPR_IDENTIFIER 
EXPR_NEG 
EXPR_NOT 
EXPR_PPTR 
EXPR_CAST 
EXPR_SIZEOF 
EXPR_SHL 
EXPR_SHR 
EXPR_MUL 
EXPR_DIV 
EXPR_ADD 
EXPR_SUB 
EXPR_AND 
EXPR_OR 
EXPR_COND 
EXPR_TRUEFALSE 
EXPR_ADDRESSOF 
EXPR_MEMBER 
EXPR_ARRAY 
EXPR_MOD 
EXPR_LOGOR 
EXPR_LOGAND 
EXPR_XOR 
EXPR_EQUALITY 
EXPR_INEQUALITY 
EXPR_GTR 
EXPR_LESS 
EXPR_GTREQL 
EXPR_LESSEQL 
EXPR_LOGNOT 
EXPR_POS 
EXPR_STRLIT 
EXPR_WSTRLIT 
EXPR_CHARCONST 

Definition at line 71 of file wbemprox_private.h.

◆ fill_status

Enumerator
FILL_STATUS_FAILED 
FILL_STATUS_UNFILTERED 
FILL_STATUS_FILTERED 

Definition at line 99 of file wbemprox_private.h.

◆ operator

Enumerator
OP_EQ 
OP_AND 
OP_OR 
OP_GT 
OP_LT 
OP_LE 
OP_GE 
OP_NE 
OP_ISNULL 
OP_NOTNULL 
OP_LIKE 
OP_NOT 

Definition at line 47 of file wbemprox_private.h.

48 {
49  OP_EQ = 1,
50  OP_AND = 2,
51  OP_OR = 3,
52  OP_GT = 4,
53  OP_LT = 5,
54  OP_LE = 6,
55  OP_GE = 7,
56  OP_NE = 8,
57  OP_ISNULL = 9,
58  OP_NOTNULL = 10,
59  OP_LIKE = 11,
60  OP_NOT = 12
61 };

◆ param_direction

Enumerator
PARAM_OUT 
PARAM_INOUT 
PARAM_IN 

Definition at line 31 of file wbemprox_private.h.

32 {
33  PARAM_OUT = -1,
34  PARAM_INOUT = 0,
35  PARAM_IN = 1
36 };

◆ view_type

Enumerator
VIEW_TYPE_SELECT 
VIEW_TYPE_ASSOCIATORS 

Definition at line 161 of file wbemprox_private.h.

Function Documentation

◆ add_table()

BOOL add_table ( struct table )

Definition at line 400 of file table.c.

401 {
402  struct table *iter;
403 
404  LIST_FOR_EACH_ENTRY( iter, table_list, struct table, entry )
405  {
406  if (!wcsicmp( iter->name, table->name ))
407  {
408  TRACE("table %s already exists\n", debugstr_w(table->name));
409  return FALSE;
410  }
411  }
412  list_add_tail( table_list, &table->entry );
413  TRACE("added %p\n", table);
414  return TRUE;
415 }
#define TRUE
Definition: types.h:120
const WCHAR * name
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define debugstr_w
Definition: kernel32.h:32
struct list entry
#define TRACE(s)
Definition: solgame.cpp:4
uint32_t entry
Definition: isohybrid.c:63
#define wcsicmp
Definition: string.h:1152

Referenced by create_signature_table().

◆ addref_query()

struct query* addref_query ( struct query )

Definition at line 775 of file query.c.

776 {
778  return query;
779 }
#define InterlockedIncrement
Definition: armddk.h:53
GLenum query
Definition: glext.h:7781

Referenced by EnumWbemClassObject_create().

◆ addref_table()

struct table* addref_table ( struct table )

Definition at line 359 of file table.c.

360 {
362  return table;
363 }
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
#define InterlockedIncrement
Definition: armddk.h:53

Referenced by create_record(), get_antecedent_table(), and grab_table().

◆ clear_table()

void clear_table ( struct table )

Definition at line 314 of file table.c.

315 {
316  UINT i;
317 
318  if (!table->data) return;
319 
320  for (i = 0; i < table->num_rows; i++) free_row_values( table, i );
321  if (table->fill)
322  {
323  table->num_rows = 0;
325  heap_free( table->data );
326  table->data = NULL;
327  }
328 }
UINT num_rows
enum fill_status(* fill)(struct table *, const struct expr *cond)
void free_row_values(const struct table *table, UINT row)
Definition: table.c:292
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
UINT num_rows_allocated
BYTE * data
unsigned int UINT
Definition: ndis.h:50
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by exec_select_view(), and free_table().

◆ create_class_object()

HRESULT create_class_object ( const WCHAR ,
IEnumWbemClassObject ,
UINT  ,
struct record ,
IWbemClassObject **   
)

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:59
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_query()

struct query* create_query ( void  )

Definition at line 755 of file query.c.

756 {
757  struct query *query;
758 
759  if (!(query = heap_alloc( sizeof(*query) ))) return NULL;
760  list_init( &query->mem );
761  query->refs = 1;
762  return query;
763 }
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
struct list mem
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
GLenum query
Definition: glext.h:7781

Referenced by do_query(), and exec_query().

◆ create_signature()

HRESULT create_signature ( const WCHAR ,
const WCHAR ,
enum  param_direction,
IWbemClassObject **   
)

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:415
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:932
static const WCHAR selectW[]
Definition: htmlelem.c:38
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#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:59
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_table()

struct table* create_table ( const WCHAR ,
UINT  ,
const struct column ,
UINT  ,
UINT  ,
BYTE ,
enum   fill_status*)(struct table *, const struct expr * 
)

◆ create_view()

HRESULT create_view ( enum  view_type,
const WCHAR ,
const struct keyword ,
const WCHAR ,
const struct property ,
const struct expr ,
struct view **   
)

Definition at line 44 of file query.c.

46 {
47  struct view *view = heap_alloc_zero( sizeof(*view) );
48 
49  if (!view) return E_OUTOFMEMORY;
50 
51  switch (type)
52  {
54  view->path = path;
56  break;
57 
58  case VIEW_TYPE_SELECT:
59  {
60  struct table *table = grab_table( class );
61  HRESULT hr;
62 
63  if (table && (hr = append_table( view, table )) != S_OK)
64  {
65  heap_free( view );
66  return hr;
67  }
68  view->proplist = proplist;
69  view->cond = cond;
70  break;
71  }
72  default:
73  ERR( "unhandled type %u\n", type );
74  heap_free( view );
75  return E_INVALIDARG;
76  }
77 
78  view->type = type;
79  *ret = view;
80  return S_OK;
81 }
static HRESULT append_table(struct view *view, struct table *table)
Definition: query.c:35
HRESULT hr
Definition: shlfolder.c:183
GLsizei const GLchar ** path
Definition: glext.h:7234
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
const struct expr * cond
const struct keyword * keywordlist
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
struct table * grab_table(const WCHAR *name)
Definition: table.c:365
const struct property * proplist
LONG HRESULT
Definition: typedefs.h:77
int ret
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
enum view_type type
static IOleDocumentView * view
Definition: activex.c:1749
const WCHAR * path
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ destroy_array()

void destroy_array ( struct array ,
CIMTYPE   
)

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_view()

void destroy_view ( struct view )

Definition at line 83 of file query.c.

84 {
85  ULONG i;
86  if (!view) return;
87  for (i = 0; i < view->table_count; i++) release_table( view->table[i] );
88  heap_free( view->table );
89  heap_free( view->result );
90  heap_free( view );
91 }
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
UINT * result
void release_table(struct table *table)
Definition: table.c:354
struct table ** table
UINT table_count
unsigned int ULONG
Definition: retypes.h:1
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by free_query(), and parse_query().

◆ EnumWbemClassObject_create()

HRESULT EnumWbemClassObject_create ( struct query ,
LPVOID  
)

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:59

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

◆ eval_cond()

HRESULT eval_cond ( const struct table ,
UINT  ,
const struct expr ,
LONGLONG ,
UINT  
)

Definition at line 440 of file query.c.

441 {
442  if (!cond)
443  {
444  *val = 1;
445  *type = CIM_UINT64;
446  return S_OK;
447  }
448  switch (cond->type)
449  {
450  case EXPR_COMPLEX:
451  return eval_binary( table, row, &cond->u.expr, val, type );
452 
453  case EXPR_UNARY:
454  return eval_unary( table, row, &cond->u.expr, val, type );
455 
456  case EXPR_PROPVAL:
457  return eval_propval( table, row, cond->u.propval, val, type );
458 
459  case EXPR_SVAL:
460  *val = (INT_PTR)cond->u.sval;
461  *type = CIM_STRING;
462  return S_OK;
463 
464  case EXPR_IVAL:
465  *val = cond->u.ival;
466  *type = CIM_UINT64;
467  return S_OK;
468 
469  case EXPR_BVAL:
470  *val = cond->u.ival;
471  *type = CIM_BOOLEAN;
472  return S_OK;
473 
474  default:
475  ERR("invalid expression type\n");
476  break;
477  }
478  return WBEM_E_INVALID_QUERY;
479 }
static HRESULT eval_unary(const struct table *table, UINT row, const struct complex_expr *expr, LONGLONG *val, UINT *type)
Definition: query.c:383
static HRESULT eval_binary(const struct table *table, UINT row, const struct complex_expr *expr, LONGLONG *val, UINT *type)
Definition: query.c:315
static HRESULT eval_propval(const struct table *table, UINT row, const struct property *propval, LONGLONG *val, UINT *type)
Definition: query.c:425
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
int32_t INT_PTR
Definition: typedefs.h:62
GLuint GLfloat * val
Definition: glext.h:7180
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
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 eval_binary(), eval_unary(), exec_select_view(), and match_row().

◆ exec_query()

HRESULT exec_query ( const WCHAR ,
IEnumWbemClassObject **   
)

Definition at line 786 of file query.c.

787 {
788  HRESULT hr;
789  struct query *query;
790 
791  *result = NULL;
792  if (!(query = create_query())) return E_OUTOFMEMORY;
793  hr = parse_query( str, &query->view, &query->mem );
794  if (hr != S_OK) goto done;
795  hr = execute_view( query->view );
796  if (hr != S_OK) goto done;
797  hr = EnumWbemClassObject_create( query, (void **)result );
798 
799 done:
800  release_query( query );
801  return hr;
802 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT EnumWbemClassObject_create(struct query *query, LPVOID *ppObj)
Definition: class.c:199
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static BOOL parse_query(const WCHAR **ptr, parse_data *data, DWORD flags)
Definition: uri.c:2044
const WCHAR * str
void release_query(struct query *query)
Definition: query.c:781
smooth NULL
Definition: ftsmooth.c:416
HRESULT execute_view(struct view *view)
Definition: query.c:739
LONG HRESULT
Definition: typedefs.h:77
struct list mem
#define S_OK
Definition: intsafe.h:59
struct view * view
GLuint64EXT * result
Definition: glext.h:11304
GLenum query
Definition: glext.h:7781
struct query * create_query(void)
Definition: query.c:755

Referenced by async_exec_query(), create_assoc_enum(), create_instance_enum(), create_qualifier_enum(), create_signature(), get_antecedent(), test_associators(), test_select(), and wbem_services_ExecQuery().

◆ execute_view()

HRESULT execute_view ( struct view )

Definition at line 739 of file query.c.

740 {
741  switch (view->type)
742  {
744  return exec_assoc_view( view );
745 
746  case VIEW_TYPE_SELECT:
747  return exec_select_view( view );
748 
749  default:
750  ERR( "unhandled type %u\n", view->type );
751  return E_INVALIDARG;
752  }
753 }
#define E_INVALIDARG
Definition: ddrawi.h:101
static HRESULT exec_select_view(struct view *view)
Definition: query.c:697
#define ERR(fmt,...)
Definition: debug.h:109
enum view_type type
static HRESULT exec_assoc_view(struct view *view)
Definition: query.c:646

Referenced by do_query(), exec_query(), get_diskdrivetodiskpartition_pairs(), get_logicaldisktopartition_pairs(), and wbem_services_ExecMethod().

◆ free_columns()

void free_columns ( struct column ,
UINT   
)

Definition at line 330 of file table.c.

331 {
332  UINT i;
333 
334  for (i = 0; i < num_cols; i++) { heap_free( (WCHAR *)columns[i].name ); }
335  heap_free( columns );
336 }
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
int JSAMPARRAY int int JDIMENSION num_cols
Definition: jpegint.h:412
unsigned int UINT
Definition: ndis.h:50
Definition: name.c:38
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by create_signature_table(), and free_table().

◆ free_path()

void free_path ( struct path )

Definition at line 413 of file services.c.

414 {
415  if (!path) return;
416  heap_free( path->class );
417  heap_free( path->filter );
418  heap_free( path );
419 }
WCHAR * filter
WCHAR * class
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by get_object(), wbem_services_CreateInstanceEnum(), and wbem_services_ExecMethod().

◆ free_query()

void free_query ( struct query )

Definition at line 765 of file query.c.

766 {
767  struct list *mem, *next;
768 
769  if (!query) return;
770  destroy_view( query->view );
772  heap_free( query );
773 }
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
void destroy_view(struct view *view)
Definition: query.c:83
Definition: _list.h:228
struct list mem
static unsigned __int64 next
Definition: rand_nt.c:6
struct view * view
Definition: mem.c:156
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by get_diskdrivetodiskpartition_pairs(), get_logicaldisktopartition_pairs(), release_query(), and wbem_services_ExecMethod().

◆ free_row_values()

void free_row_values ( const struct table ,
UINT   
)

Definition at line 292 of file table.c.

293 {
294  UINT i, type;
295  LONGLONG val;
296 
297  for (i = 0; i < table->num_cols; i++)
298  {
299  if (!(table->columns[i].type & COL_FLAG_DYNAMIC)) continue;
300 
301  type = table->columns[i].type & COL_TYPE_MASK;
302  if (type == CIM_STRING || type == CIM_DATETIME || type == CIM_REFERENCE)
303  {
304  if (get_value( table, row, i, &val ) == S_OK) heap_free( (void *)(INT_PTR)val );
305  }
306  else if (type & CIM_FLAG_ARRAY)
307  {
308  if (get_value( table, row, i, &val ) == S_OK)
309  destroy_array( (void *)(INT_PTR)val, type & CIM_TYPE_MASK );
310  }
311  }
312 }
UINT num_cols
const struct column * columns
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
int32_t INT_PTR
Definition: typedefs.h:62
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
#define COL_TYPE_MASK
GLuint GLfloat * val
Definition: glext.h:7180
int64_t LONGLONG
Definition: typedefs.h:66
#define COL_FLAG_DYNAMIC
#define S_OK
Definition: intsafe.h:59
HRESULT get_value(const struct table *table, UINT row, UINT column, LONGLONG *val)
Definition: table.c:99
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
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by clear_table(), fill_baseboard(), fill_bios(), fill_cdromdrive(), fill_compsys(), fill_compsysproduct(), fill_datafile(), fill_directory(), fill_diskdrive(), fill_diskdrivetodiskpartition(), fill_diskpartition(), fill_displaycontrollerconfig(), fill_ip4routetable(), fill_logicaldisk(), fill_logicaldisktopartition(), fill_networkadapter(), fill_networkadapterconfig(), fill_operatingsystem(), fill_physicalmemory(), fill_pnpentity(), fill_printer(), fill_process(), fill_processor(), fill_service(), fill_systemenclosure(), and fill_videocontroller().

◆ free_table()

void free_table ( struct table )

Definition at line 338 of file table.c.

339 {
340  if (!table) return;
341 
342  clear_table( table );
344  {
345  TRACE("destroying %p\n", table);
346  heap_free( (WCHAR *)table->name );
347  free_columns( (struct column *)table->columns, table->num_cols );
348  heap_free( table->data );
349  list_remove( &table->entry );
350  heap_free( table );
351  }
352 }
UINT num_cols
void free_columns(struct column *columns, UINT num_cols)
Definition: table.c:330
const WCHAR * name
const struct column * columns
struct list entry
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define TABLE_FLAG_DYNAMIC
void clear_table(struct table *table)
Definition: table.c:314
BYTE * data
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by release_table().

◆ get_column_index()

HRESULT get_column_index ( const struct table ,
const WCHAR ,
UINT  
)

Definition at line 35 of file table.c.

36 {
37  UINT i;
38  for (i = 0; i < table->num_cols; i++)
39  {
40  if (!wcsicmp( table->columns[i].name, name ))
41  {
42  *column = i;
43  return S_OK;
44  }
45  }
46  return WBEM_E_INVALID_QUERY;
47 }
UINT num_cols
const struct column * columns
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 wcsicmp
Definition: string.h:1152
#define S_OK
Definition: intsafe.h:59
unsigned int UINT
Definition: ndis.h:50
Definition: name.c:38

Referenced by class_object_Get(), class_object_Put(), eval_propval(), eval_unary(), get_propval(), and put_propval().

◆ get_method()

HRESULT get_method ( const struct table ,
const WCHAR ,
class_method **   
)

Definition at line 269 of file table.c.

270 {
271  UINT i, j;
272 
273  for (i = 0; i < table->num_rows; i++)
274  {
275  for (j = 0; j < table->num_cols; j++)
276  {
277  if (table->columns[j].type & COL_FLAG_METHOD && !wcscmp( table->columns[j].name, name ))
278  {
279  HRESULT hr;
280  LONGLONG val;
281 
282  if ((hr = get_value( table, i, j, &val )) != S_OK) return hr;
283  *func = (class_method *)(INT_PTR)val;
284  return S_OK;
285  }
286  }
287  }
288  return WBEM_E_INVALID_METHOD;
289 
290 }
GLenum func
Definition: glext.h:6028
UINT num_cols
HRESULT hr
Definition: shlfolder.c:183
UINT num_rows
const struct column * columns
int32_t INT_PTR
Definition: typedefs.h:62
#define COL_FLAG_METHOD
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
GLuint GLfloat * val
Definition: glext.h:7180
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 GLint GLint j
Definition: glfuncs.h:250
int64_t LONGLONG
Definition: typedefs.h:66
LONG HRESULT
Definition: typedefs.h:77
HRESULT() class_method(IWbemClassObject *, IWbemClassObject *, IWbemClassObject **)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define S_OK
Definition: intsafe.h:59
HRESULT get_value(const struct table *table, UINT row, UINT column, LONGLONG *val)
Definition: table.c:99
unsigned int UINT
Definition: ndis.h:50
Definition: name.c:38

Referenced by wbem_services_ExecMethod().

◆ get_method_name()

BSTR get_method_name ( const WCHAR ,
UINT   
)

Definition at line 417 of file table.c.

418 {
419  struct table *table;
420  UINT i, count = 0;
421  BSTR ret;
422 
423  if (!(table = grab_table( class ))) return NULL;
424 
425  for (i = 0; i < table->num_cols; i++)
426  {
427  if (table->columns[i].type & COL_FLAG_METHOD)
428  {
429  if (index == count)
430  {
431  ret = SysAllocString( table->columns[i].name );
432  release_table( table );
433  return ret;
434  }
435  count++;
436  }
437  }
438  release_table( table );
439  return NULL;
440 }
UINT num_cols
GLuint GLuint GLsizei count
Definition: gl.h:1545
const struct column * columns
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
OLECHAR * BSTR
Definition: compat.h:1942
#define COL_FLAG_METHOD
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
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
GLuint index
Definition: glext.h:6031
struct table * grab_table(const WCHAR *name)
Definition: table.c:365
void release_table(struct table *table)
Definition: table.c:354
int ret
unsigned int UINT
Definition: ndis.h:50

Referenced by class_object_NextMethod().

◆ get_object()

HRESULT get_object ( const WCHAR ,
IWbemClassObject **   
)

Definition at line 458 of file services.c.

459 {
460  IEnumWbemClassObject *iter;
461  struct path *path;
462  HRESULT hr;
463 
464  hr = parse_path( object_path, &path );
465  if (hr != S_OK) return hr;
466 
467  hr = create_instance_enum( path, &iter );
468  if (hr != S_OK)
469  {
470  free_path( path );
471  return hr;
472  }
473  hr = create_class_object( path->class, iter, 0, NULL, obj );
474  IEnumWbemClassObject_Release( iter );
475  free_path( path );
476  return hr;
477 }
HRESULT hr
Definition: shlfolder.c:183
GLsizei const GLchar ** path
Definition: glext.h:7234
void free_path(struct path *path)
Definition: services.c:413
smooth NULL
Definition: ftsmooth.c:416
static HRESULT create_instance_enum(const struct path *path, IEnumWbemClassObject **iter)
Definition: services.c:447
WCHAR * class
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:1021
HRESULT parse_path(const WCHAR *str, struct path **ret)
Definition: services.c:326

Referenced by wbem_services_GetObject().

◆ get_properties()

HRESULT get_properties ( const struct view ,
UINT  ,
LONG  ,
SAFEARRAY **   
)

Definition at line 1401 of file query.c.

1402 {
1403  SAFEARRAY *sa;
1404  BSTR str;
1405  UINT i, table_index, result_index, num_props;
1406  struct table *table;
1407  HRESULT hr;
1408  LONG j;
1409 
1410  if ((hr = map_view_index( view, index, &table_index, &result_index )) != S_OK) return hr;
1411 
1412  num_props = count_result_properties( view, table_index );
1413  if (!(sa = SafeArrayCreateVector( VT_BSTR, 0, num_props ))) return E_OUTOFMEMORY;
1414 
1415  table = view->table[table_index];
1416  for (i = 0, j = 0; i < table->num_cols; i++)
1417  {
1418  BOOL is_system;
1419 
1420  if (is_method( table, i )) continue;
1421  if (!is_result_prop( view, table->columns[i].name )) continue;
1422 
1423  is_system = is_system_prop( table->columns[i].name );
1424  if ((flags & WBEM_FLAG_NONSYSTEM_ONLY) && is_system) continue;
1425  else if ((flags & WBEM_FLAG_SYSTEM_ONLY) && !is_system) continue;
1426 
1427  str = SysAllocString( table->columns[i].name );
1428  if (!str || SafeArrayPutElement( sa, &j, str ) != S_OK)
1429  {
1430  SysFreeString( str );
1431  SafeArrayDestroy( sa );
1432  return E_OUTOFMEMORY;
1433  }
1434  SysFreeString( str );
1435  j++;
1436  }
1437  *props = sa;
1438  return S_OK;
1439 }
UINT num_cols
HRESULT hr
Definition: shlfolder.c:183
const struct column * columns
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
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
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
static BOOL is_system_prop(const WCHAR *name)
Definition: query.c:816
const WCHAR * str
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
GLuint index
Definition: glext.h:6031
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 GLint GLint j
Definition: glfuncs.h:250
LONG HRESULT
Definition: typedefs.h:77
GLbitfield flags
Definition: glext.h:7161
HRESULT WINAPI SafeArrayDestroy(SAFEARRAY *psa)
Definition: safearray.c:1347
SAFEARRAY *WINAPI SafeArrayCreateVector(VARTYPE vt, LONG lLbound, ULONG cElements)
Definition: safearray.c:677
BOOL is_result_prop(const struct view *view, const WCHAR *name)
Definition: query.c:804
struct table ** table
#define S_OK
Definition: intsafe.h:59
static UINT count_result_properties(const struct view *view, UINT table_index)
Definition: query.c:933
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
unsigned int UINT
Definition: ndis.h:50
static const WCHAR props[]
Definition: wbemdisp.c:288
HRESULT WINAPI SafeArrayPutElement(SAFEARRAY *psa, LONG *rgIndices, void *pvData)
Definition: safearray.c:864
BOOL is_method(const struct table *table, UINT column)
Definition: query.c:917
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
static HRESULT map_view_index(const struct view *view, UINT index, UINT *table_index, UINT *result_index)
Definition: query.c:1139

Referenced by class_object_GetNames().

◆ get_propval()

HRESULT get_propval ( const struct view ,
UINT  ,
const WCHAR ,
VARIANT ,
CIMTYPE ,
LONG  
)

Definition at line 1177 of file query.c.

1179 {
1180  HRESULT hr;
1181  UINT column, row, table_index, result_index;
1182  struct table *table;
1183  VARTYPE vartype;
1184  void *val_ptr = NULL;
1185  LONGLONG val;
1186 
1187  if ((hr = map_view_index( view, index, &table_index, &result_index )) != S_OK) return hr;
1188 
1189  if (is_system_prop( name )) return get_system_propval( view, table_index, result_index, name, ret, type, flavor );
1190  if (!view->result_count || !is_result_prop( view, name )) return WBEM_E_NOT_FOUND;
1191 
1192  table = view->table[table_index];
1194  if (hr != S_OK || is_method( table, column )) return WBEM_E_NOT_FOUND;
1195 
1196  row = view->result[result_index];
1197  hr = get_value( table, row, column, &val );
1198  if (hr != S_OK) return hr;
1199 
1200  if (type) *type = table->columns[column].type & COL_TYPE_MASK;
1201  if (flavor) *flavor = 0;
1202 
1203  if (!ret) return S_OK;
1204 
1206  if (table->columns[column].type & CIM_FLAG_ARRAY)
1207  {
1208  CIMTYPE basetype = table->columns[column].type & CIM_TYPE_MASK;
1209 
1210  val_ptr = to_safearray( (const struct array *)(INT_PTR)val, basetype );
1211  if (!val_ptr) vartype = VT_NULL;
1212  else vartype |= VT_ARRAY;
1213  set_variant( vartype, val, val_ptr, ret );
1214  return S_OK;
1215  }
1216 
1217  switch (table->columns[column].type & COL_TYPE_MASK)
1218  {
1219  case CIM_STRING:
1220  case CIM_REFERENCE:
1221  case CIM_DATETIME:
1222  if (val)
1223  {
1224  vartype = VT_BSTR;
1225  val_ptr = SysAllocString( (const WCHAR *)(INT_PTR)val );
1226  }
1227  else
1228  vartype = VT_NULL;
1229  break;
1230  case CIM_SINT64:
1231  vartype = VT_BSTR;
1232  val_ptr = get_value_bstr( table, row, column );
1233  break;
1234  case CIM_UINT64:
1235  vartype = VT_BSTR;
1236  val_ptr = get_value_bstr( table, row, column );
1237  break;
1238  case CIM_BOOLEAN:
1239  case CIM_SINT8:
1240  case CIM_UINT8:
1241  case CIM_SINT16:
1242  case CIM_UINT16:
1243  case CIM_SINT32:
1244  case CIM_UINT32:
1245  case CIM_REAL32:
1246  break;
1247  default:
1248  ERR("unhandled column type %u\n", table->columns[column].type);
1249  return WBEM_E_FAILED;
1250  }
1251 
1252  set_variant( vartype, val, val_ptr, ret );
1253  return S_OK;
1254 }
HRESULT get_column_index(const struct table *table, const WCHAR *name, UINT *column)
Definition: table.c:35
HRESULT hr
Definition: shlfolder.c:183
const struct column * columns
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
VARTYPE to_vartype(CIMTYPE type)
Definition: query.c:1032
int32_t INT_PTR
Definition: typedefs.h:62
BSTR get_value_bstr(const struct table *table, UINT row, UINT column)
Definition: table.c:158
UINT result_count
#define CIM_TYPE_MASK
static BOOL is_system_prop(const WCHAR *name)
Definition: query.c:816
UINT * result
#define COL_TYPE_MASK
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
void set_variant(VARTYPE type, LONGLONG val, void *val_ptr, VARIANT *ret)
Definition: query.c:1093
GLuint index
Definition: glext.h:6031
GLuint GLfloat * val
Definition: glext.h:7180
int64_t LONGLONG
Definition: typedefs.h:66
SAFEARRAY * to_safearray(const struct array *array, CIMTYPE basetype)
Definition: query.c:1062
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
int ret
long CIMTYPE
Definition: wbemcli.idl:258
BOOL is_result_prop(const struct view *view, const WCHAR *name)
Definition: query.c:804
struct table ** table
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
HRESULT get_value(const struct table *table, UINT row, UINT column, LONGLONG *val)
Definition: table.c:99
unsigned short VARTYPE
Definition: compat.h:1903
static HRESULT get_system_propval(const struct view *view, UINT table_index, UINT result_index, const WCHAR *name, VARIANT *ret, CIMTYPE *type, LONG *flavor)
Definition: query.c:945
unsigned int UINT
Definition: ndis.h:50
Definition: name.c:38
BOOL is_method(const struct table *table, UINT column)
Definition: query.c:917
GLenum GLenum GLvoid GLvoid * column
Definition: glext.h:5664
static HRESULT map_view_index(const struct view *view, UINT index, UINT *table_index, UINT *result_index)
Definition: query.c:1139
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_Get(), class_object_Next(), get_diskdrivetodiskpartition_pairs(), and get_logicaldisktopartition_pairs().

◆ get_type_size()

UINT get_type_size ( CIMTYPE  )

Definition at line 49 of file table.c.

50 {
51  if (type & CIM_FLAG_ARRAY) return sizeof(void *);
52 
53  switch (type)
54  {
55  case CIM_BOOLEAN:
56  return sizeof(int);
57  case CIM_SINT8:
58  case CIM_UINT8:
59  return sizeof(INT8);
60  case CIM_SINT16:
61  case CIM_UINT16:
62  return sizeof(INT16);
63  case CIM_SINT32:
64  case CIM_UINT32:
65  return sizeof(INT32);
66  case CIM_SINT64:
67  case CIM_UINT64:
68  return sizeof(INT64);
69  case CIM_DATETIME:
70  case CIM_REFERENCE:
71  case CIM_STRING:
72  return sizeof(WCHAR *);
73  case CIM_REAL32:
74  return sizeof(FLOAT);
75  default:
76  ERR("unhandled type %u\n", type);
77  break;
78  }
79  return sizeof(LONGLONG);
80 }
signed char INT8
#define FLOAT
Definition: i386-dis.c:516
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
int64_t LONGLONG
Definition: typedefs.h:66
__wchar_t WCHAR
Definition: xmlstorage.h:180
signed long long INT64
#define ERR(fmt,...)
Definition: debug.h:109
signed int INT32
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
signed short INT16

Referenced by get_column_size().

◆ get_value()

HRESULT get_value ( const struct table ,
UINT  ,
UINT  ,
LONGLONG  
)

Definition at line 99 of file table.c.

100 {
101  UINT col_offset, row_size;
102  const BYTE *ptr;
103 
104  col_offset = get_column_offset( table, column );
105  row_size = get_row_size( table );
106  ptr = table->data + row * row_size + col_offset;
107 
108  if (table->columns[column].type & CIM_FLAG_ARRAY)
109  {
110  *val = (INT_PTR)*(const void **)ptr;
111  return S_OK;
112  }
113  switch (table->columns[column].type & COL_TYPE_MASK)
114  {
115  case CIM_BOOLEAN:
116  *val = *(const int *)ptr;
117  break;
118  case CIM_DATETIME:
119  case CIM_REFERENCE:
120  case CIM_STRING:
121  *val = (INT_PTR)*(const WCHAR **)ptr;
122  break;
123  case CIM_SINT8:
124  *val = *(const INT8 *)ptr;
125  break;
126  case CIM_UINT8:
127  *val = *(const UINT8 *)ptr;
128  break;
129  case CIM_SINT16:
130  *val = *(const INT16 *)ptr;
131  break;
132  case CIM_UINT16:
133  *val = *(const UINT16 *)ptr;
134  break;
135  case CIM_SINT32:
136  *val = *(const INT32 *)ptr;
137  break;
138  case CIM_UINT32:
139  *val = *(const UINT32 *)ptr;
140  break;
141  case CIM_SINT64:
142  *val = *(const INT64 *)ptr;
143  break;
144  case CIM_UINT64:
145  *val = *(const UINT64 *)ptr;
146  break;
147  case CIM_REAL32:
148  memcpy( val, ptr, sizeof(FLOAT) );
149  break;
150  default:
151  ERR("invalid column type %u\n", table->columns[column].type & COL_TYPE_MASK);
152  *val = 0;
153  break;
154  }
155  return S_OK;
156 }
signed char INT8
const struct column * columns
int32_t INT_PTR
Definition: typedefs.h:62
unsigned int UINT32
static PVOID ptr
Definition: dispmode.c:27
#define COL_TYPE_MASK
GLuint GLfloat * val
Definition: glext.h:7180
__wchar_t WCHAR
Definition: xmlstorage.h:180
signed long long INT64
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
static UINT get_column_offset(const struct table *table, UINT column)
Definition: table.c:87
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
BYTE * data
unsigned short UINT16
unsigned int UINT
Definition: ndis.h:50
static UINT get_row_size(const struct table *table)
Definition: table.c:94
float FLOAT
Definition: typedefs.h:67
signed int INT32
unsigned long long UINT64
unsigned char UINT8
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
signed short INT16

Referenced by eval_propval(), eval_unary(), free_row_values(), get_method(), get_propval(), and get_value_bstr().

◆ get_value_bstr()

BSTR get_value_bstr ( const struct table ,
UINT  ,
UINT   
)

Definition at line 158 of file table.c.

159 {
160  static const WCHAR fmt_signedW[] = {'%','d',0};
161  static const WCHAR fmt_unsignedW[] = {'%','u',0};
162  static const WCHAR fmt_signed64W[] = {'%','I','6','4','d',0};
163  static const WCHAR fmt_unsigned64W[] = {'%','I','6','4','u',0};
164  static const WCHAR fmt_strW[] = {'\"','%','s','\"',0};
165  static const WCHAR trueW[] = {'T','R','U','E',0};
166  static const WCHAR falseW[] = {'F','A','L','S','E',0};
167  LONGLONG val;
168  BSTR ret;
169  WCHAR number[22];
170  UINT len;
171 
172  if (table->columns[column].type & CIM_FLAG_ARRAY)
173  {
174  FIXME("array to string conversion not handled\n");
175  return NULL;
176  }
177  if (get_value( table, row, column, &val ) != S_OK) return NULL;
178 
179  switch (table->columns[column].type & COL_TYPE_MASK)
180  {
181  case CIM_BOOLEAN:
182  if (val) return SysAllocString( trueW );
183  else return SysAllocString( falseW );
184 
185  case CIM_DATETIME:
186  case CIM_REFERENCE:
187  case CIM_STRING:
188  if (!val) return NULL;
189  len = lstrlenW( (const WCHAR *)(INT_PTR)val ) + 2;
190  if (!(ret = SysAllocStringLen( NULL, len ))) return NULL;
191  swprintf( ret, fmt_strW, (const WCHAR *)(INT_PTR)val );
192  return ret;
193 
194  case CIM_SINT16:
195  case CIM_SINT32:
196  swprintf( number, fmt_signedW, val );
197  return SysAllocString( number );
198 
199  case CIM_UINT16:
200  case CIM_UINT32:
201  swprintf( number, fmt_unsignedW, val );
202  return SysAllocString( number );
203 
204  case CIM_SINT64:
205  wsprintfW( number, fmt_signed64W, val );
206  return SysAllocString( number );
207 
208  case CIM_UINT64:
209  wsprintfW( number, fmt_unsigned64W, val );
210  return SysAllocString( number );
211 
212  default:
213  FIXME("unhandled column type %u\n", table->columns[column].type & COL_TYPE_MASK);
214  break;
215  }
216  return NULL;
217 }
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
const struct column * columns
OLECHAR * BSTR
Definition: compat.h:1942
int32_t INT_PTR
Definition: typedefs.h:62
#define lstrlenW
Definition: compat.h:415
static size_t double number
Definition: printf.c:69
#define FIXME(fmt,...)
Definition: debug.h:110
#define COL_TYPE_MASK
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
GLuint GLfloat * val
Definition: glext.h:7180
int64_t LONGLONG
Definition: typedefs.h:66
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR falseW[]
Definition: json.c:34
#define swprintf(buf, format,...)
Definition: sprintf.c:56
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59
HRESULT get_value(const struct table *table, UINT row, UINT column, LONGLONG *val)
Definition: table.c:99
unsigned int UINT
Definition: ndis.h:50
static const WCHAR trueW[]
Definition: json.c:33
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 build_proplist(), get_body_text(), and get_propval().

◆ get_view_table()

struct table* get_view_table ( const struct view ,
UINT   
)

Definition at line 1161 of file query.c.

1162 {
1163  switch (view->type)
1164  {
1165  case VIEW_TYPE_SELECT:
1166  return view->table[0];
1167 
1168  case VIEW_TYPE_ASSOCIATORS:
1169  return view->table[index];
1170 
1171  default:
1172  ERR( "unhandled view type %u\n", view->type );
1173  return NULL;
1174  }
1175 }
smooth NULL
Definition: ftsmooth.c:416
#define index(s, c)
Definition: various.h:29
struct table ** table
#define ERR(fmt,...)
Definition: debug.h:109
enum view_type type

Referenced by class_object_Next(), class_object_SpawnInstance(), enum_class_object_Next(), get_object_text(), and wbem_services_ExecMethod().

◆ grab_table()

struct table* grab_table ( const WCHAR )

Definition at line 365 of file table.c.

366 {
367  struct table *table;
368 
369  LIST_FOR_EACH_ENTRY( table, table_list, struct table, entry )
370  {
371  if (name && !wcsicmp( table->name, name ))
372  {
373  TRACE("returning %p\n", table);
374  return addref_table( table );
375  }
376  }
377  return NULL;
378 }
const WCHAR * name
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
struct table * addref_table(struct table *table)
Definition: table.c:359
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
uint32_t entry
Definition: isohybrid.c:63
#define wcsicmp
Definition: string.h:1152
Definition: name.c:38

Referenced by create_view(), and get_method_name().

◆ heap_strdupAW()

static WCHAR* heap_strdupAW ( const char src)
inlinestatic

Definition at line 270 of file wbemprox_private.h.

271 {
272  int len;
273  WCHAR *dst;
274  if (!src) return NULL;
275  len = MultiByteToWideChar( CP_ACP, 0, src, -1, NULL, 0 );
276  if ((dst = heap_alloc( len * sizeof(*dst) ))) MultiByteToWideChar( CP_ACP, 0, src, -1, dst, len );
277  return dst;
278 }
#define CP_ACP
Definition: compat.h:99
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLenum GLsizei len
Definition: glext.h:6722
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
#define MultiByteToWideChar
Definition: compat.h:100

Referenced by get_smbios_string().

◆ heap_strdupW()

static WCHAR* heap_strdupW ( const WCHAR src)
inlinestatic

Definition at line 262 of file wbemprox_private.h.

263 {
264  WCHAR *dst;
265  if (!src) return NULL;
266  if ((dst = heap_alloc( (lstrlenW( src ) + 1) * sizeof(WCHAR) ))) lstrcpyW( dst, src );
267  return dst;
268 }
#define lstrlenW
Definition: compat.h:415
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLenum src
Definition: glext.h:6340
#define lstrcpyW
Definition: compat.h:414
GLenum GLenum dst
Definition: glext.h:6340

◆ init_table_list()

void init_table_list ( void  )

Definition at line 4591 of file builtin.c.

4592 {
4593  static struct list tables = LIST_INIT( tables );
4594  UINT i;
4595 
4597  table_list = &tables;
4598 }
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
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 struct table builtin_classes[]
Definition: builtin.c:4544
#define LIST_INIT(head)
Definition: queue.h:197
uint32_t entry
Definition: isohybrid.c:63
Definition: _list.h:228
#define ARRAY_SIZE(a)
Definition: main.h:24
unsigned int UINT
Definition: ndis.h:50
struct nls_table * tables
Definition: nls_base.c:22

Referenced by DllMain().

◆ is_method()

BOOL is_method ( const struct table ,
UINT   
)

Definition at line 917 of file query.c.

918 {
919  return table->columns[column].type & COL_FLAG_METHOD;
920 }
const struct column * columns
#define COL_FLAG_METHOD
GLenum GLenum GLvoid GLvoid * column
Definition: glext.h:5664

Referenced by class_object_Next(), count_properties(), get_properties(), get_propval(), and put_propval().

◆ is_result_prop()

BOOL is_result_prop ( const struct view ,
const WCHAR  
)

Definition at line 804 of file query.c.

805 {
806  const struct property *prop = view->proplist;
807  if (!prop) return TRUE;
808  while (prop)
809  {
810  if (!wcsicmp( prop->name, name )) return TRUE;
811  prop = prop->next;
812  }
813  return FALSE;
814 }
#define TRUE
Definition: types.h:120
const struct property * next
const struct property * proplist
#define wcsicmp
Definition: string.h:1152
BSTR name
Definition: locator.c:107
Definition: name.c:38

Referenced by class_object_Next(), get_properties(), and get_propval().

◆ parse_path()

HRESULT parse_path ( const WCHAR ,
struct path **   
)

Definition at line 326 of file services.c.

327 {
328  struct path *path;
329  const WCHAR *p = str, *q;
330  UINT len;
331 
332  if (!(path = heap_alloc_zero( sizeof(*path) ))) return E_OUTOFMEMORY;
333 
334  if (*p == '\\')
335  {
336  static const WCHAR cimv2W[] = {'R','O','O','T','\\','C','I','M','V','2',0};
338  DWORD server_len = ARRAY_SIZE(server);
339 
340  p++;
341  if (*p != '\\')
342  {
343  heap_free( path );
345  }
346  p++;
347 
348  q = p;
349  while (*p && *p != '\\') p++;
350  if (!*p)
351  {
352  heap_free( path );
354  }
355 
356  len = p - q;
357  if (!GetComputerNameW( server, &server_len ) || server_len != len || _wcsnicmp( q, server, server_len ))
358  {
359  heap_free( path );
360  return WBEM_E_NOT_SUPPORTED;
361  }
362 
363  q = ++p;
364  while (*p && *p != ':') p++;
365  if (!*p)
366  {
367  heap_free( path );
369  }
370 
371  len = p - q;
372  if (len != ARRAY_SIZE(cimv2W) - 1 || _wcsnicmp( q, cimv2W, ARRAY_SIZE(cimv2W) - 1 ))
373  {
374  heap_free( path );
376  }
377  p++;
378  }
379 
380  q = p;
381  while (*p && *p != '.') p++;
382 
383  len = p - q;
384  if (!(path->class = heap_alloc( (len + 1) * sizeof(WCHAR) )))
385  {
386  heap_free( path );
387  return E_OUTOFMEMORY;
388  }
389  memcpy( path->class, q, len * sizeof(WCHAR) );
390  path->class[len] = 0;
391  path->class_len = len;
392 
393  if (p[0] == '.' && p[1])
394  {
395  q = ++p;
396  while (*q) q++;
397 
398  len = q - p;
399  if (!(path->filter = heap_alloc( (len + 1) * sizeof(WCHAR) )))
400  {
401  heap_free( path->class );
402  heap_free( path );
403  return E_OUTOFMEMORY;
404  }
405  memcpy( path->filter, p, len * sizeof(WCHAR) );
406  path->filter[len] = 0;
407  path->filter_len = len;
408  }
409  *ret = path;
410  return S_OK;
411 }
WCHAR * filter
static rfbScreenInfoPtr server
Definition: vnc.c:74
GLsizei const GLchar ** path
Definition: glext.h:7234
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
Definition: compname.c:440
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
UINT class_len
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
const WCHAR * str
UINT filter_len
WCHAR * class
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:240
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
unsigned int UINT
Definition: ndis.h:50
GLfloat GLfloat p
Definition: glext.h:8902
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by get_object(), wbem_services_CreateInstanceEnum(), and wbem_services_ExecMethod().

◆ parse_query()

HRESULT parse_query ( const WCHAR ,
struct view **  ,
struct list  
)

Definition at line 2227 of file wql.tab.c.

2228 {
2229  struct parser parser;
2230  int ret;
2231 
2232  *view = NULL;
2233 
2234  parser.cmd = str;
2235  parser.idx = 0;
2236  parser.len = 0;
2238  parser.view = view;
2239  parser.mem = mem;
2240 
2241  ret = wql_parse( &parser );
2242  TRACE("wql_parse returned %d\n", ret);
2243  if (ret)
2244  {
2245  if (*parser.view)
2246  {
2247  destroy_view( *parser.view );
2248  *parser.view = NULL;
2249  }
2250  return parser.error;
2251  }
2252  return S_OK;
2253 }
UINT idx
Definition: wql.tab.c:111
struct list * mem
Definition: wql.tab.c:115
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
const WCHAR * cmd
Definition: wql.tab.c:110
#define TRACE(s)
Definition: solgame.cpp:4
void destroy_view(struct view *view)
Definition: query.c:83
int wql_parse(struct parser *ctx)
unsigned int error
Definition: inffile.c:97
int ret
#define S_OK
Definition: intsafe.h:59
UINT len
Definition: wql.tab.c:112
Definition: import.c:86
static IOleDocumentView * view
Definition: activex.c:1749
struct view ** view
Definition: wql.tab.c:114

◆ process_get_owner()

HRESULT process_get_owner ( IWbemClassObject ,
IWbemClassObject ,
IWbemClassObject **   
)

Definition at line 65 of file process.c.

66 {
67  VARIANT user, domain, retval;
69  HRESULT hr;
70 
71  TRACE("%p, %p, %p\n", obj, in, out);
72 
74  if (hr != S_OK) return hr;
75 
76  if (out)
77  {
78  hr = IWbemClassObject_SpawnInstance( sig, 0, &out_params );
79  if (hr != S_OK)
80  {
81  IWbemClassObject_Release( sig );
82  return hr;
83  }
84  }
85  VariantInit( &user );
86  VariantInit( &domain );
87  hr = get_owner( &user, &domain, &retval );
88  if (hr != S_OK) goto done;
89  if (out_params)
90  {
91  if (!V_UI4( &retval ))
92  {
93  hr = IWbemClassObject_Put( out_params, param_userW, 0, &user, CIM_STRING );
94  if (hr != S_OK) goto done;
95  hr = IWbemClassObject_Put( out_params, param_domainW, 0, &domain, CIM_STRING );
96  if (hr != S_OK) goto done;
97  }
98  hr = IWbemClassObject_Put( out_params, param_returnvalueW, 0, &retval, CIM_UINT32 );
99  }
100 
101 done:
102  VariantClear( &user );
103  VariantClear( &domain );
104  IWbemClassObject_Release( sig );
105  if (hr == S_OK && out)
106  {
107  *out = out_params;
108  IWbemClassObject_AddRef( out_params );
109  }
110  if (out_params) IWbemClassObject_Release( out_params );
111  return hr;
112 }
HRESULT hr
Definition: shlfolder.c:183
static HRESULT get_owner(VARIANT *user, VARIANT *domain, VARIANT *retval)
Definition: process.c:34
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
Definition: cookie.c:41
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static FILE * out
Definition: regtests2xml.c:44
static void out_params(void)
Definition: nanoxwin.c:1413
#define V_UI4(A)
Definition: oleauto.h:270
static const WCHAR method_getownerW[]
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
static const WCHAR param_userW[]
static const WCHAR class_processW[]
static const WCHAR param_domainW[]
#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:819
static const WCHAR param_returnvalueW[]
void user(int argc, const char *argv[])
Definition: cmds.c:1350

Referenced by fill_process().

◆ put_propval()

HRESULT put_propval ( const struct view ,
UINT  ,
const WCHAR ,
VARIANT ,
CIMTYPE   
)

Definition at line 1375 of file query.c.

1376 {
1377  HRESULT hr;
1378  UINT row, column, table_index, result_index;
1379  struct table *table;
1380  LONGLONG val;
1381 
1382  if ((hr = map_view_index( view, index, &table_index, &result_index )) != S_OK) return hr;
1383 
1384  table = view->table[table_index];
1386  if (hr != S_OK)
1387  {
1388  FIXME("no support for creating new properties\n");
1389  return WBEM_E_FAILED;
1390  }
1391  if (is_method( table, column ) || !(table->columns[column].type & COL_FLAG_DYNAMIC))
1392  return WBEM_E_FAILED;
1393 
1394  hr = to_longlong( var, &val, &type );
1395  if (hr != S_OK) return hr;
1396 
1397  row = view->result[result_index];
1398  return set_value( table, row, column, val, type );
1399 }
HRESULT get_column_index(const struct table *table, const WCHAR *name, UINT *column)
Definition: table.c:35
HRESULT hr
Definition: shlfolder.c:183
const struct column * columns
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
#define FIXME(fmt,...)
Definition: debug.h:110
UINT * result
HRESULT set_value(const struct table *table, UINT row, UINT column, LONGLONG val, CIMTYPE type)
Definition: table.c:219
GLuint index
Definition: glext.h:6031
GLuint GLfloat * val
Definition: glext.h:7180
int64_t LONGLONG
Definition: typedefs.h:66
LONG HRESULT
Definition: typedefs.h:77
#define COL_FLAG_DYNAMIC
struct table ** table
#define S_OK
Definition: intsafe.h:59
unsigned int UINT
Definition: ndis.h:50
Definition: name.c:38
HRESULT to_longlong(VARIANT *var, LONGLONG *val, CIMTYPE *type)
Definition: query.c:1325
BOOL is_method(const struct table *table, UINT column)
Definition: query.c:917
GLenum GLenum GLvoid GLvoid * column
Definition: glext.h:5664
static HRESULT map_view_index(const struct view *view, UINT index, UINT *table_index, UINT *result_index)
Definition: query.c:1139
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_Put().

◆ query_from_path()

WCHAR* query_from_path ( const struct path )

Definition at line 421 of file services.c.

422 {
423  static const WCHAR selectW[] =
424  {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','%','s',' ',
425  'W','H','E','R','E',' ','%','s',0};
426  static const WCHAR select_allW[] =
427  {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',0};
428  WCHAR *query;
429  UINT len;
430 
431  if (path->filter)
432  {
434  if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return NULL;
436  }
437  else
438  {
439  len = path->class_len + ARRAY_SIZE(select_allW);
440  if (!(query = heap_alloc( len * sizeof(WCHAR) ))) return NULL;
441  lstrcpyW( query, select_allW );
442  lstrcatW( query, path->class );
443  }
444  return query;
445 }
WCHAR * filter
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
UINT class_len
smooth NULL
Definition: ftsmooth.c:416
UINT filter_len
WCHAR * class
static const WCHAR selectW[]
Definition: htmlelem.c:38
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define swprintf(buf, format,...)
Definition: sprintf.c:56
GLenum GLsizei len
Definition: glext.h:6722
#define lstrcpyW
Definition: compat.h:414
#define ARRAY_SIZE(a)
Definition: main.h:24
unsigned int UINT
Definition: ndis.h:50
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
GLenum query
Definition: glext.h:7781

Referenced by create_instance_enum(), get_antecedent_table(), and wbem_services_ExecMethod().

◆ reg_create_key()

HRESULT reg_create_key ( IWbemClassObject ,
IWbemClassObject ,
IWbemClassObject **   
)

Definition at line 99 of file reg.c.

100 {
101  VARIANT defkey, subkey, retval;
103  HRESULT hr;
104 
105  TRACE("%p, %p\n", in, out);
106 
107  hr = IWbemClassObject_Get( in, param_defkeyW, 0, &defkey, NULL, NULL );
108  if (hr != S_OK) return hr;
109  hr = IWbemClassObject_Get( in, param_subkeynameW, 0, &subkey, NULL, NULL );
110  if (hr != S_OK) return hr;
111 
113  if (hr != S_OK)
114  {
115  VariantClear( &subkey );
116  return hr;
117  }
118  if (out)
119  {
120  hr = IWbemClassObject_SpawnInstance( sig, 0, &out_params );
121  if (hr != S_OK)
122  {
123  VariantClear( &subkey );
124  IWbemClassObject_Release( sig );
125  return hr;
126  }
127  }
128  hr = create_key( (HKEY)(INT_PTR)V_I4(&defkey), V_BSTR(&subkey), &retval );
129  if (hr == S_OK && out_params)
130  hr = IWbemClassObject_Put( out_params, param_returnvalueW, 0, &retval, CIM_UINT32 );
131 
132  VariantClear( &subkey );
133  IWbemClassObject_Release( sig );
134  if (hr == S_OK && out)
135  {
136  *out = out_params;
137  IWbemClassObject_AddRef( out_params );
138  }
139  if (out_params) IWbemClassObject_Release( out_params );
140  return hr;
141 }
HRESULT hr
Definition: shlfolder.c:183
int32_t INT_PTR
Definition: typedefs.h:62
static const WCHAR param_subkeynameW[]
#define V_I4(A)
Definition: oleauto.h:247
static HRESULT create_key(HKEY root, const WCHAR *subkey, VARIANT *retval)
Definition: reg.c:82
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR class_stdregprovW[]
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static FILE * out
Definition: regtests2xml.c:44
static void out_params(void)
Definition: nanoxwin.c:1413
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
static const WCHAR param_defkeyW[]
#define V_BSTR(A)
Definition: oleauto.h:226
#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:819
static const WCHAR method_createkeyW[]
static const WCHAR param_returnvalueW[]

◆ reg_enum_key()

HRESULT reg_enum_key ( IWbemClassObject ,
IWbemClassObject ,
IWbemClassObject **   
)

Definition at line 198 of file reg.c.

199 {
200  VARIANT defkey, subkey, names, retval;
202  HRESULT hr;
203 
204  TRACE("%p, %p\n", in, out);
205 
206  hr = IWbemClassObject_Get( in, param_defkeyW, 0, &defkey, NULL, NULL );
207  if (hr != S_OK) return hr;
208  hr = IWbemClassObject_Get( in, param_subkeynameW, 0, &subkey, NULL, NULL );
209  if (hr != S_OK) return hr;
210 
212  if (hr != S_OK)
213  {
214  VariantClear( &subkey );
215  return hr;
216  }
217  if (out)
218  {
219  hr = IWbemClassObject_SpawnInstance( sig, 0, &out_params );
220  if (hr != S_OK)
221  {
222  VariantClear( &subkey );
223  IWbemClassObject_Release( sig );
224  return hr;
225  }
226  }
227  VariantInit( &names );
228  hr = enum_key( (HKEY)(INT_PTR)V_I4(&defkey), V_BSTR(&subkey), &names, &retval );
229  if (hr != S_OK) goto done;
230  if (out_params)
231  {
232  if (!V_UI4( &retval ))
233  {
234  hr = IWbemClassObject_Put( out_params, param_namesW, 0, &names, CIM_STRING|CIM_FLAG_ARRAY );
235  if (hr != S_OK) goto done;
236  }
237  hr = IWbemClassObject_Put( out_params, param_returnvalueW, 0, &retval, CIM_UINT32 );
238  }
239 
240 done:
241  VariantClear( &names );
242  VariantClear( &subkey );
243  IWbemClassObject_Release( sig );
244  if (hr == S_OK && out)
245  {
246  *out = out_params;
247  IWbemClassObject_AddRef( out_params );
248  }
249  if (out_params) IWbemClassObject_Release( out_params );
250  return hr;
251 }
static HRESULT enum_key(HKEY root, const WCHAR *subkey, VARIANT *names, VARIANT *retval)
Definition: reg.c:143
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
int32_t INT_PTR
Definition: typedefs.h:62
static const WCHAR param_subkeynameW[]
static const WCHAR method_enumkeyW[]
#define V_I4(A)
Definition: oleauto.h:247
GLuint GLuint * names
Definition: glext.h:11545
static const WCHAR param_namesW[]
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR class_stdregprovW[]
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static FILE * out
Definition: regtests2xml.c:44
static void out_params(void)
Definition: nanoxwin.c:1413
#define V_UI4(A)
Definition: oleauto.h:270
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
static const WCHAR param_defkeyW[]
#define V_BSTR(A)
Definition: oleauto.h:226
#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:819
static const WCHAR param_returnvalueW[]

◆ reg_enum_values()

HRESULT reg_enum_values ( IWbemClassObject ,
IWbemClassObject ,
IWbemClassObject **   
)

Definition at line 308 of file reg.c.

309 {
310  VARIANT defkey, subkey, names, types, retval;
312  HRESULT hr;
313 
314  TRACE("%p, %p\n", in, out);
315 
316  hr = IWbemClassObject_Get( in, param_defkeyW, 0, &defkey, NULL, NULL );
317  if (hr != S_OK) return hr;
318  hr = IWbemClassObject_Get( in, param_subkeynameW, 0, &subkey, NULL, NULL );
319  if (hr != S_OK) return hr;
320 
322  if (hr != S_OK)
323  {
324  VariantClear( &subkey );
325  return hr;
326  }
327  if (out)
328  {
329  hr = IWbemClassObject_SpawnInstance( sig, 0, &out_params );
330  if (hr != S_OK)
331  {
332  VariantClear( &subkey );
333  IWbemClassObject_Release( sig );
334  return hr;
335  }
336  }
337  VariantInit( &names );
338  VariantInit( &types );
339  hr = enum_values( (HKEY)(INT_PTR)V_I4(&defkey), V_BSTR(&subkey), &names, &types, &retval );
340  if (hr != S_OK) goto done;
341  if (out_params)
342  {
343  if (!V_UI4( &retval ))
344  {
345  hr = IWbemClassObject_Put( out_params, param_namesW, 0, &names, CIM_STRING|CIM_FLAG_ARRAY );
346  if (hr != S_OK) goto done;
347  hr = IWbemClassObject_Put( out_params, param_typesW, 0, &types, CIM_SINT32|CIM_FLAG_ARRAY );
348  if (hr != S_OK) goto done;
349  }
350  hr = IWbemClassObject_Put( out_params, param_returnvalueW, 0, &retval, CIM_UINT32 );
351  }
352 
353 done:
354  VariantClear( &types );
355  VariantClear( &names );
356  VariantClear( &subkey );
357  IWbemClassObject_Release( sig );
358  if (hr == S_OK && out)
359  {
360  *out = out_params;
361  IWbemClassObject_AddRef( out_params );
362  }
363  if (out_params) IWbemClassObject_Release( out_params );
364  return hr;
365 }
HRESULT hr
Definition: shlfolder.c:183
static const WCHAR method_enumvaluesW[]
GLsizei GLenum GLenum * types
Definition: glext.h:7753
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
int32_t INT_PTR
Definition: typedefs.h:62
static const WCHAR param_subkeynameW[]
#define V_I4(A)
Definition: oleauto.h:247
GLuint GLuint * names
Definition: glext.h:11545
static const WCHAR param_typesW[]
static const WCHAR param_namesW[]
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR class_stdregprovW[]
#define TRACE(s)
Definition: solgame.cpp:4
Definition: cmds.c:130
LONG HRESULT
Definition: typedefs.h:77
static FILE * out
Definition: regtests2xml.c:44
static void out_params(void)
Definition: nanoxwin.c:1413
static HRESULT enum_values(HKEY root, const WCHAR *subkey, VARIANT *names, VARIANT *types, VARIANT *retval)
Definition: reg.c:253
#define V_UI4(A)
Definition: oleauto.h:270
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
static const WCHAR param_defkeyW[]
#define V_BSTR(A)
Definition: oleauto.h:226
#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:819
static const WCHAR param_returnvalueW[]

◆ reg_get_stringvalue()

HRESULT reg_get_stringvalue ( IWbemClassObject ,
IWbemClassObject ,
IWbemClassObject **   
)

Definition at line 391 of file reg.c.

392 {
393  VARIANT defkey, subkey, name, value, retval;
395  HRESULT hr;
396 
397  TRACE("%p, %p\n", in, out);
398 
399  hr = IWbemClassObject_Get( in, param_defkeyW, 0, &defkey, NULL, NULL );
400  if (hr != S_OK) return hr;
401  hr = IWbemClassObject_Get( in, param_subkeynameW, 0, &subkey, NULL, NULL );
402  if (hr != S_OK) return hr;
403  hr = IWbemClassObject_Get( in, param_valuenameW, 0, &name, NULL, NULL );
404  if (hr != S_OK) return hr;
405 
407  if (hr != S_OK)
408  {
409  VariantClear( &name );
410  VariantClear( &subkey );
411  return hr;
412  }
413  if (out)
414  {
415  hr = IWbemClassObject_SpawnInstance( sig, 0, &out_params );
416  if (hr != S_OK)
417  {
418  VariantClear( &name );
419  VariantClear( &subkey );
420  IWbemClassObject_Release( sig );
421  return hr;
422  }
423  }
424  VariantInit( &value );
425  hr = get_stringvalue( (HKEY)(INT_PTR)V_I4(&defkey), V_BSTR(&subkey), V_BSTR(&name), &value, &retval );
426  if (hr != S_OK) goto done;
427  if (out_params)
428  {
429  if (!V_UI4( &retval ))
430  {
431  hr = IWbemClassObject_Put( out_params, param_valueW, 0, &value, CIM_STRING );
432  if (hr != S_OK) goto done;
433  }
434  hr = IWbemClassObject_Put( out_params, param_returnvalueW, 0, &retval, CIM_UINT32 );
435  }
436 
437 done:
438  VariantClear( &name );
439  VariantClear( &subkey );
440  IWbemClassObject_Release( sig );
441  if (hr == S_OK && out)
442  {
443  *out = out_params;
444  IWbemClassObject_AddRef( out_params );
445  }
446  if (out_params) IWbemClassObject_Release( out_params );
447  return hr;
448 }
HRESULT hr
Definition: shlfolder.c:183
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
int32_t INT_PTR
Definition: typedefs.h:62
static const WCHAR param_subkeynameW[]
#define V_I4(A)
Definition: oleauto.h:247
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR class_stdregprovW[]
static const WCHAR param_valuenameW[]
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static FILE * out
Definition: regtests2xml.c:44
static void out_params(void)
Definition: nanoxwin.c:1413
#define V_UI4(A)
Definition: oleauto.h:270
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
static const WCHAR method_getstringvalueW[]
static const WCHAR param_defkeyW[]
GLsizei const GLfloat * value
Definition: glext.h:6069
#define V_BSTR(A)
Definition: oleauto.h:226
#define S_OK
Definition: intsafe.h:59
GLuint in
Definition: glext.h:9616
static HRESULT get_stringvalue(HKEY root, const WCHAR *subkey, const WCHAR *name, VARIANT *value, VARIANT *retval)
Definition: reg.c:367
static const WCHAR param_valueW[]
HRESULT create_signature(const WCHAR *class, const WCHAR *method, enum param_direction dir, IWbemClassObject **sig)
Definition: class.c:819
Definition: name.c:38
static const WCHAR param_returnvalueW[]
const WCHAR * name
Definition: reg.c:67

◆ release_query()

void release_query ( struct query query)

Definition at line 781 of file query.c.

782 {
784 }
void free_query(struct query *query)
Definition: query.c:765
#define InterlockedDecrement
Definition: armddk.h:52

Referenced by do_query(), enum_class_object_Release(), exec_query(), and get_antecedent_table().

◆ release_table()

void release_table ( struct table )

Definition at line 354 of file table.c.

355 {
357 }
void free_table(struct table *table)
Definition: table.c:338
#define InterlockedDecrement
Definition: armddk.h:52

Referenced by destroy_record(), destroy_view(), exec_assoc_view(), and get_method_name().

◆ security_get_sd()

HRESULT security_get_sd ( IWbemClassObject ,
IWbemClassObject ,
IWbemClassObject **   
)

Definition at line 132 of file security.c.

133 {
134  VARIANT var_sd, retval;
136  HRESULT hr, ret;
138  DWORD sd_size;
139 
140  TRACE("%p, %p\n", in, out);
141 
143 
144  if (SUCCEEDED(hr))
145  {
146  hr = IWbemClassObject_SpawnInstance( sig, 0, &out_params );
147 
148  IWbemClassObject_Release( sig );
149  }
150 
151  if (SUCCEEDED(hr))
152  {
153  ret = get_sd( &sd, &sd_size );
154 
155  if (SUCCEEDED(ret))
156  {
157  VariantInit( &var_sd );
158 
159  hr = to_byte_array( sd, sd_size, &var_sd );
160 
161  if (SUCCEEDED(hr))
162  hr = IWbemClassObject_Put( out_params, param_sdW, 0, &var_sd, CIM_UINT8|CIM_FLAG_ARRAY );
163 
164  HeapFree( GetProcessHeap(), 0, sd );
165  VariantClear( &var_sd );
166  }
167 
168  if (SUCCEEDED(hr))
169  {
170  set_variant( VT_UI4, ret, NULL, &retval );
171  hr = IWbemClassObject_Put( out_params, param_returnvalueW, 0, &retval, CIM_UINT32 );
172  }
173 
174  if (SUCCEEDED(hr) && out)
175  {
176  *out = out_params;
177  IWbemClassObject_AddRef( out_params );
178  }
179 
180  IWbemClassObject_Release( out_params );
181  }
182 
183  return hr;
184 }
static HRESULT get_sd(SECURITY_DESCRIPTOR **sd, DWORD *size)
Definition: security.c:61
static const WCHAR method_getsdW[]
HRESULT hr
Definition: shlfolder.c:183
static const WCHAR class_systemsecurityW[]
static HRESULT to_byte_array(void *data, DWORD size, VARIANT *var)
Definition: security.c:35
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
smooth NULL
Definition: ftsmooth.c:416
void set_variant(VARTYPE type, LONGLONG val, void *val_ptr, VARIANT *ret)
Definition: query.c:1093
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
LONG HRESULT
Definition: typedefs.h:77
static FILE * out
Definition: regtests2xml.c:44
static void out_params(void)
Definition: nanoxwin.c:1413
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR sd[]
Definition: suminfo.c:287
int ret
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
static const WCHAR param_sdW[]
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
static const WCHAR param_returnvalueW[]
#define HeapFree(x, y, z)
Definition: compat.h:402
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ security_set_sd()

HRESULT security_set_sd ( IWbemClassObject ,
IWbemClassObject ,
IWbemClassObject **   
)

Definition at line 187 of file security.c.

188 {
189  VARIANT retval;
191  HRESULT hr;
192 
193  FIXME("stub\n");
194 
196 
197  if (SUCCEEDED(hr))
198  {
199  hr = IWbemClassObject_SpawnInstance( sig, 0, &out_params );
200 
201  IWbemClassObject_Release( sig );
202  }
203 
204  if (SUCCEEDED(hr))
205  {
206  set_variant( VT_UI4, S_OK, NULL, &retval );
207  hr = IWbemClassObject_Put( out_params, param_returnvalueW, 0, &retval, CIM_UINT32 );
208 
209  if (SUCCEEDED(hr) && out)
210  {
211  *out = out_params;
212  IWbemClassObject_AddRef( out_params );
213  }
214 
215  IWbemClassObject_Release( out_params );
216  }
217 
218  return hr;
219 }
HRESULT hr
Definition: shlfolder.c:183
static const WCHAR class_systemsecurityW[]
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
void set_variant(VARTYPE type, LONGLONG val, void *val_ptr, VARIANT *ret)
Definition: query.c:1093
static const WCHAR method_setsdW[]
LONG HRESULT
Definition: typedefs.h:77
static FILE * out
Definition: regtests2xml.c:44
static void out_params(void)
Definition: nanoxwin.c:1413
#define S_OK
Definition: intsafe.h:59
HRESULT create_signature(const WCHAR *class, const WCHAR *method, enum param_direction dir, IWbemClassObject **sig)
Definition: class.c:819
static const WCHAR param_returnvalueW[]
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ service_pause_service()

HRESULT service_pause_service ( IWbemClassObject ,
IWbemClassObject ,
IWbemClassObject **   
)

Definition at line 79 of file service.c.

80 {
81  VARIANT name, retval;
83  HRESULT hr;
84 
85  TRACE("%p, %p, %p\n", obj, in, out);
86 
87  hr = IWbemClassObject_Get( obj, prop_nameW, 0, &name, NULL, NULL );
88  if (hr != S_OK) return hr;
89 
91  if (hr != S_OK)
92  {
93  VariantClear( &name );
94  return hr;
95  }
96  if (out)
97  {
98  hr = IWbemClassObject_SpawnInstance( sig, 0, &out_params );
99  if (hr != S_OK)
100  {
101  VariantClear( &name );
102  IWbemClassObject_Release( sig );
103  return hr;
104  }
105  }
107  if (hr != S_OK) goto done;
108 
109  if (out_params)
110  hr = IWbemClassObject_Put( out_params, param_returnvalueW, 0, &retval, CIM_UINT32 );
111 
112 done:
113  VariantClear( &name );
114  IWbemClassObject_Release( sig );
115  if (hr == S_OK && out)
116  {
117  *out = out_params;
118  IWbemClassObject_AddRef( out_params );
119  }
120  if (out_params) IWbemClassObject_Release( out_params );
121  return hr;
122 }
HRESULT hr
Definition: shlfolder.c:183
static const WCHAR method_pauseserviceW[]
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR prop_nameW[]
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT control_service(const WCHAR *name, DWORD control, VARIANT *retval)
Definition: service.c:54
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR class_serviceW[]
static FILE * out
Definition: regtests2xml.c:44
static void out_params(void)
Definition: nanoxwin.c:1413
#define SERVICE_CONTROL_PAUSE
Definition: winsvc.h:37
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_BSTR(A)
Definition: oleauto.h:226
#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:819
Definition: name.c:38
static const WCHAR param_returnvalueW[]
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by fill_service().

◆ service_resume_service()

HRESULT service_resume_service ( IWbemClassObject ,
IWbemClassObject ,
IWbemClassObject **   
)

Definition at line 124 of file service.c.

125 {
126  VARIANT name, retval;
128  HRESULT hr;
129 
130  TRACE("%p, %p, %p\n", obj, in, out);
131 
132  hr = IWbemClassObject_Get( obj, prop_nameW, 0, &name, NULL, NULL );
133  if (hr != S_OK) return hr;
134 
136  if (hr != S_OK)
137  {
138  VariantClear( &name );
139  return hr;
140  }
141  if (out)
142  {
143  hr = IWbemClassObject_SpawnInstance( sig, 0, &out_params );
144  if (hr != S_OK)
145  {
146  VariantClear( &name );
147  IWbemClassObject_Release( sig );
148  return hr;
149  }
150  }
152  if (hr != S_OK) goto done;
153 
154  if (out_params)
155  hr = IWbemClassObject_Put( out_params, param_returnvalueW, 0, &retval, CIM_UINT32 );
156 
157 done:
158  VariantClear( &name );
159  IWbemClassObject_Release( sig );
160  if (hr == S_OK && out)
161  {
162  *out = out_params;
163  IWbemClassObject_AddRef( out_params );
164  }
165  if (out_params) IWbemClassObject_Release( out_params );
166  return hr;
167 }
HRESULT hr
Definition: shlfolder.c:183
static const WCHAR method_resumeserviceW[]
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR prop_nameW[]
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT control_service(const WCHAR *name, DWORD control, VARIANT *retval)
Definition: service.c:54
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR class_serviceW[]
static FILE * out
Definition: regtests2xml.c:44
static void out_params(void)
Definition: nanoxwin.c:1413
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_BSTR(A)
Definition: oleauto.h:226
#define S_OK
Definition: intsafe.h:59
GLuint in
Definition: glext.h:9616
#define SERVICE_CONTROL_CONTINUE
Definition: winsvc.h:38
HRESULT create_signature(const WCHAR *class, const WCHAR *method, enum param_direction dir, IWbemClassObject **sig)
Definition: class.c:819
Definition: name.c:38
static const WCHAR param_returnvalueW[]
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by fill_service().

◆ service_start_service()

HRESULT service_start_service ( IWbemClassObject ,
IWbemClassObject ,
IWbemClassObject **   
)

Definition at line 193 of file service.c.

194 {
195  VARIANT name, retval;
197  HRESULT hr;
198 
199  TRACE("%p, %p, %p\n", obj, in, out);
200 
201  hr = IWbemClassObject_Get( obj, prop_nameW, 0, &name, NULL, NULL );
202  if (hr != S_OK) return hr;
203 
205  if (hr != S_OK)
206  {
207  VariantClear( &name );
208  return hr;
209  }
210  if (out)
211  {
212  hr = IWbemClassObject_SpawnInstance( sig, 0, &out_params );
213  if (hr != S_OK)
214  {
215  VariantClear( &name );
216  IWbemClassObject_Release( sig );
217  return hr;
218  }
219  }
220  hr = start_service( V_BSTR(&name), &retval );
221  if (hr != S_OK) goto done;
222 
223  if (out_params)
224  hr = IWbemClassObject_Put( out_params, param_returnvalueW, 0, &retval, CIM_UINT32 );
225 
226 done:
227  VariantClear( &name );
228  IWbemClassObject_Release( sig );
229  if (hr == S_OK && out)
230  {
231  *out = out_params;
232  IWbemClassObject_AddRef( out_params );
233  }
234  if (out_params) IWbemClassObject_Release( out_params );
235  return hr;
236 }
HRESULT hr
Definition: shlfolder.c:183
smooth NULL
Definition: ftsmooth.c:416
static HRESULT start_service(const WCHAR *name, VARIANT *retval)
Definition: service.c:169
static const WCHAR prop_nameW[]
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR class_serviceW[]
static FILE * out
Definition: regtests2xml.c:44
static void out_params(void)
Definition: nanoxwin.c:1413
static const WCHAR method_startserviceW[]
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_BSTR(A)
Definition: oleauto.h:226
#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:819
Definition: name.c:38
static const WCHAR param_returnvalueW[]
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by fill_service().

◆ service_stop_service()

HRESULT service_stop_service ( IWbemClassObject ,
IWbemClassObject ,
IWbemClassObject **   
)

Definition at line 238 of file service.c.

239 {
240  VARIANT name, retval;
242  HRESULT hr;
243 
244  TRACE("%p, %p, %p\n", obj, in, out);
245 
246  hr = IWbemClassObject_Get( obj, prop_nameW, 0, &name, NULL, NULL );
247  if (hr != S_OK) return hr;
248 
250  if (hr != S_OK)
251  {
252  VariantClear( &name );
253  return hr;
254  }
255  if (out)
256  {
257  hr = IWbemClassObject_SpawnInstance( sig, 0, &out_params );
258  if (hr != S_OK)
259  {
260  VariantClear( &name );
261  IWbemClassObject_Release( sig );
262  return hr;
263  }
264  }
266  if (hr != S_OK) goto done;
267 
268  if (out_params)
269  hr = IWbemClassObject_Put( out_params, param_returnvalueW, 0, &retval, CIM_UINT32 );
270 
271 done:
272  VariantClear( &name );
273  IWbemClassObject_Release( sig );
274  if (hr == S_OK && out)
275  {
276  *out = out_params;
277  IWbemClassObject_AddRef( out_params );
278  }
279  if (out_params) IWbemClassObject_Release( out_params );
280  return hr;
281 }
HRESULT hr
Definition: shlfolder.c:183
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR prop_nameW[]
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT control_service(const WCHAR *name, DWORD control, VARIANT *retval)
Definition: service.c:54
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR class_serviceW[]
static FILE * out
Definition: regtests2xml.c:44
static void out_params(void)
Definition: nanoxwin.c:1413
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_BSTR(A)
Definition: oleauto.h:226
static const WCHAR method_stopserviceW[]
#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:819
Definition: name.c:38
static const WCHAR param_returnvalueW[]
#define SERVICE_CONTROL_STOP
Definition: winsvc.h:36
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by fill_service().

◆ set_value()

HRESULT set_value ( const struct table ,
UINT  ,
UINT  ,
LONGLONG  ,
CIMTYPE   
)

Definition at line 219 of file table.c.

221 {
222  UINT col_offset, row_size;
223  BYTE *ptr;
224 
225  if ((table->columns[column].type & COL_TYPE_MASK) != type) return WBEM_E_TYPE_MISMATCH;
226 
227  col_offset = get_column_offset( table, column );
228  row_size = get_row_size( table );
229  ptr = table->data + row * row_size + col_offset;
230 
231  switch (table->columns[column].type & COL_TYPE_MASK)
232  {
233  case CIM_DATETIME:
234  case CIM_REFERENCE:
235  case CIM_STRING:
236  *(WCHAR **)ptr = (WCHAR *)(INT_PTR)val;
237  break;
238  case CIM_SINT8:
239  *(INT8 *)ptr = val;
240  break;
241  case CIM_UINT8:
242  *(UINT8 *)ptr = val;
243  break;
244  case CIM_SINT16:
245  *(INT16 *)ptr = val;
246  break;
247  case CIM_UINT16:
248  *(UINT16 *)ptr = val;
249  break;
250  case CIM_SINT32:
251  *(INT32 *)ptr = val;
252  break;
253  case CIM_UINT32:
254  *(UINT32 *)ptr = val;
255  break;
256  case CIM_SINT64:
257  *(INT64 *)ptr = val;
258  break;
259  case CIM_UINT64:
260  *(UINT64 *)ptr = val;
261  break;
262  default:
263  FIXME("unhandled column type %u\n", type);
264  return WBEM_E_FAILED;
265  }
266  return S_OK;
267 }
signed char INT8
const struct column * columns
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
int32_t INT_PTR
Definition: typedefs.h:62
unsigned int UINT32
#define FIXME(fmt,...)
Definition: debug.h:110
static PVOID ptr
Definition: dispmode.c:27
#define COL_TYPE_MASK
GLuint GLfloat * val
Definition: glext.h:7180
__wchar_t WCHAR
Definition: xmlstorage.h:180
signed long long INT64
unsigned char BYTE
Definition: mem.h:68
static UINT get_column_offset(const struct table *table, UINT column)
Definition: table.c:87
#define S_OK
Definition: intsafe.h:59
BYTE * data
unsigned short UINT16
unsigned int UINT
Definition: ndis.h:50
static UINT get_row_size(const struct table *table)
Definition: table.c:94
signed int INT32
unsigned long long UINT64
unsigned char UINT8
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
signed short INT16

Referenced by hex_data_state(), and put_propval().

◆ set_variant()

void set_variant ( VARTYPE  ,
LONGLONG  ,
void ,
VARIANT  
)

Definition at line 1093 of file query.c.

1094 {
1095  if (type & VT_ARRAY)
1096  {
1097  V_VT( ret ) = type;
1098  V_ARRAY( ret ) = val_ptr;
1099  return;
1100  }
1101  switch (type)
1102  {
1103  case VT_BOOL:
1104  V_BOOL( ret ) = val;
1105  break;
1106  case VT_BSTR:
1107  V_BSTR( ret ) = val_ptr;
1108  break;
1109  case VT_I1:
1110  V_I1( ret ) = val;
1111  break;
1112  case VT_UI1:
1113  V_UI1( ret ) = val;
1114  break;
1115  case VT_I2:
1116  V_I2( ret ) = val;
1117  break;
1118  case VT_UI2:
1119  V_UI2( ret ) = val;
1120  break;
1121  case VT_I4:
1122  V_I4( ret ) = val;
1123  break;
1124  case VT_UI4:
1125  V_UI4( ret ) = val;
1126  break;
1127  case VT_NULL:
1128  break;
1129  case VT_R4:
1130  V_R4( ret ) = *(FLOAT *)&val;
1131  break;
1132  default:
1133  ERR("unhandled variant type %u\n", type);
1134  return;
1135  }
1136  V_VT( ret ) = type;
1137 }
Definition: compat.h:1947
Definition: compat.h:1959
#define V_ARRAY(A)
Definition: oleauto.h:222
#define V_I2(A)
Definition: oleauto.h:245
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define V_I4(A)
Definition: oleauto.h:247
#define V_UI2(A)
Definition: oleauto.h:268
#define V_I1(A)
Definition: oleauto.h:243
GLuint GLfloat * val
Definition: glext.h:7180
#define V_R4(A)
Definition: oleauto.h:260
#define V_UI1(A)
Definition: oleauto.h:266
#define V_BOOL(A)
Definition: oleauto.h:224
#define V_UI4(A)
Definition: oleauto.h:270
int ret
Definition: compat.h:1948
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define ERR(fmt,...)
Definition: debug.h:109
float FLOAT
Definition: typedefs.h:67
Definition: compat.h:1946

Referenced by control_service(), create_key(), enum_key(), enum_values(), get_owner(), get_propval(), get_stringvalue(), security_get_sd(), security_set_sd(), start_service(), to_bstr_array(), to_byte_array(), and to_i4_array().

◆ to_longlong()

HRESULT to_longlong ( VARIANT ,
LONGLONG ,
CIMTYPE  
)

Definition at line 1325 of file query.c.

1326 {
1327  if (!var)
1328  {
1329  *val = 0;
1330  return S_OK;
1331  }
1332  if (V_VT( var ) & VT_ARRAY)
1333  {
1334