ReactOS 0.4.15-dev-7788-g1ad9096
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
 
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.

72{
73 EXPR_COMPLEX = 1,
74 EXPR_UNARY = 2,
75 EXPR_PROPVAL = 3,
76 EXPR_SVAL = 4,
77 EXPR_IVAL = 5,
78 EXPR_BVAL = 6
79};
@ EXPR_SVAL
@ EXPR_UNARY
@ EXPR_IVAL
@ EXPR_PROPVAL
@ EXPR_BVAL
@ EXPR_COMPLEX

◆ fill_status

Enumerator
FILL_STATUS_FAILED 
FILL_STATUS_UNFILTERED 
FILL_STATUS_FILTERED 

Definition at line 99 of file wbemprox_private.h.

100{
104};
@ FILL_STATUS_UNFILTERED
@ FILL_STATUS_FAILED
@ FILL_STATUS_FILTERED

◆ 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};
@ OP_LIKE
@ OP_NE
@ OP_EQ
@ OP_ISNULL
@ OP_GE
@ OP_NOT
@ OP_LT
@ OP_GT
@ OP_NOTNULL
@ OP_LE
@ OP_AND
@ OP_OR

◆ 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};
@ PARAM_OUT
@ PARAM_INOUT
@ PARAM_IN

◆ view_type

Enumerator
VIEW_TYPE_SELECT 
VIEW_TYPE_ASSOCIATORS 

Definition at line 161 of file wbemprox_private.h.

162{
165};
@ VIEW_TYPE_ASSOCIATORS
@ VIEW_TYPE_SELECT

Function Documentation

◆ add_table()

BOOL add_table ( struct table 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 }
413 TRACE("added %p\n", table);
414 return TRUE;
415}
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define wcsicmp
Definition: compat.h:15
struct list * table_list
Definition: main.c:38
uint32_t entry
Definition: isohybrid.c:63
#define debugstr_w
Definition: kernel32.h:32
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define TRACE(s)
Definition: solgame.cpp:4
const WCHAR * name
struct list entry

Referenced by create_signature_table().

◆ addref_query()

struct query * addref_query ( struct query query)

Definition at line 775 of file query.c.

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

Referenced by EnumWbemClassObject_create().

◆ addref_table()

struct table * addref_table ( struct table table)

Definition at line 359 of file table.c.

360{
362 return table;
363}

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

◆ clear_table()

void clear_table ( struct table 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}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define NULL
Definition: types.h:112
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
unsigned int UINT
Definition: ndis.h:50
UINT num_rows
enum fill_status(* fill)(struct table *, const struct expr *cond)
UINT num_rows_allocated
BYTE * data

Referenced by exec_select_view(), and free_table().

◆ create_class_object()

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

Definition at line 1021 of file class.c.

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

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 list_init(struct list_entry *head)
Definition: list.h:51
struct list mem

Referenced by do_query(), and exec_query().

◆ create_signature()

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

Definition at line 819 of file class.c.

821{
822 static const WCHAR selectW[] =
823 {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
824 '_','_','P','A','R','A','M','E','T','E','R','S',' ','W','H','E','R','E',' ',
825 'C','l','a','s','s','=','\'','%','s','\'',' ','A','N','D',' ',
826 'M','e','t','h','o','d','=','\'','%','s','\'',' ','A','N','D',' ',
827 'D','i','r','e','c','t','i','o','n','%','s',0};
828 static const WCHAR geW[] = {'>','=','0',0};
829 static const WCHAR leW[] = {'<','=','0',0};
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}
unsigned int dir
Definition: maze.c:112
#define ARRAY_SIZE(A)
Definition: main.h:33
#define lstrlenW
Definition: compat.h:750
static UINT count_instances(IEnumWbemClassObject *iter)
Definition: class.c:702
static HRESULT create_signature_table(IEnumWbemClassObject *iter, WCHAR *name)
Definition: class.c:785
static WCHAR * build_signature_table_name(const WCHAR *class, const WCHAR *method, enum param_direction dir)
Definition: class.c:806
HRESULT exec_query(const WCHAR *str, IEnumWbemClassObject **result)
Definition: query.c:786
#define swprintf
Definition: precomp.h:40
method
Definition: dragdrop.c:54
GLenum GLsizei len
Definition: glext.h:6722
static const WCHAR selectW[]
Definition: htmlelem.c:38
static IDispatch * get_object(jsval_t v)
Definition: jsval.h:219
HRESULT hr
Definition: shlfolder.c:183
__wchar_t WCHAR
Definition: xmlstorage.h:180

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 path,
const struct keyword keywordlist,
const WCHAR class,
const struct property proplist,
const struct expr cond,
struct view **  ret 
)

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
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}
#define ERR(fmt,...)
Definition: debug.h:110
#define E_INVALIDARG
Definition: ddrawi.h:101
static HRESULT append_table(struct view *view, struct table *table)
Definition: query.c:35
struct table * grab_table(const WCHAR *name)
Definition: table.c:365
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
const WCHAR * path
const struct property * proplist
const struct expr * cond
const struct keyword * keywordlist
enum view_type type
int ret

◆ destroy_array()

void destroy_array ( struct array array,
CIMTYPE  type 
)

Definition at line 240 of file class.c.

241{
242 UINT i;
243 if (!array) return;
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}
UINT elem_size
void * ptr
@ CIM_REFERENCE
Definition: wbemcli.idl:253
@ CIM_DATETIME
Definition: wbemcli.idl:252
@ CIM_STRING
Definition: wbemcli.idl:243

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

◆ destroy_view()

void destroy_view ( struct view 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] );
90 heap_free( view );
91}
void release_table(struct table *table)
Definition: table.c:354
UINT * result
UINT table_count
struct table ** table
uint32_t ULONG
Definition: typedefs.h:59

Referenced by free_query().

◆ EnumWbemClassObject_create()

HRESULT EnumWbemClassObject_create ( struct query query,
LPVOID ppObj 
)

Definition at line 199 of file class.c.

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

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

◆ eval_cond()

HRESULT eval_cond ( const struct table table,
UINT  row,
const struct expr cond,
LONGLONG val,
UINT type 
)

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 }
479}
@ EXPR_PROPVAL
Definition: parser.h:273
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
static HRESULT eval_unary(const struct table *table, UINT row, const struct complex_expr *expr, LONGLONG *val, UINT *type)
Definition: query.c:383
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
GLuint GLfloat * val
Definition: glext.h:7180
#define EXPR_COMPLEX
Definition: query.h:47
#define EXPR_IVAL
Definition: query.h:50
#define EXPR_UNARY
Definition: query.h:57
#define EXPR_SVAL
Definition: query.h:51
struct complex_expr expr
Definition: query.h:91
const struct property * propval
union expr::@507 u
int type
Definition: query.h:88
LPCWSTR sval
Definition: query.h:94
INT ival
Definition: query.h:92
int32_t INT_PTR
Definition: typedefs.h:64
@ CIM_BOOLEAN
Definition: wbemcli.idl:244
@ CIM_UINT64
Definition: wbemcli.idl:251
@ WBEM_E_INVALID_QUERY
Definition: wbemcli.idl:73

Referenced by eval_binary(), eval_unary(), exec_select_view(), and match_row().

◆ exec_query()

HRESULT exec_query ( const WCHAR str,
IEnumWbemClassObject **  result 
)

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;
796 if (hr != S_OK) goto done;
798
799done:
801 return hr;
802}
static BOOL parse_query(const WCHAR **ptr, parse_data *data, DWORD flags)
Definition: uri.c:2044
HRESULT EnumWbemClassObject_create(struct query *query, LPVOID *ppObj)
Definition: class.c:199
void release_query(struct query *query)
Definition: query.c:781
HRESULT execute_view(struct view *view)
Definition: query.c:739
struct query * create_query(void)
Definition: query.c:755
GLuint64EXT * result
Definition: glext.h:11304
const WCHAR * str
struct view * view

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 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}
static HRESULT exec_assoc_view(struct view *view)
Definition: query.c:646
static HRESULT exec_select_view(struct view *view)
Definition: query.c:697

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

◆ free_columns()

void free_columns ( struct column columns,
UINT  num_cols 
)

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}
int JSAMPARRAY int int JDIMENSION num_cols
Definition: jpegint.h:421

Referenced by create_signature_table(), and free_table().

◆ free_path()

void free_path ( struct path path)

Definition at line 413 of file services.c.

414{
415 if (!path) return;
416 heap_free( path->class );
418 heap_free( path );
419}
WCHAR * filter
WCHAR * class

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

◆ free_query()

void free_query ( struct query query)

Definition at line 765 of file query.c.

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

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

◆ free_row_values()

void free_row_values ( const struct table table,
UINT  row 
)

Definition at line 292 of file table.c.

293{
294 UINT i, type;
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;
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)
310 }
311 }
312}
void destroy_array(struct array *array, CIMTYPE type)
Definition: class.c:240
HRESULT get_value(const struct table *table, UINT row, UINT column, LONGLONG *val)
Definition: table.c:99
const struct column * columns
UINT num_cols
int64_t LONGLONG
Definition: typedefs.h:68
@ CIM_FLAG_ARRAY
Definition: wbemcli.idl:255
#define COL_FLAG_DYNAMIC
#define COL_TYPE_MASK
#define CIM_TYPE_MASK

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 table)

Definition at line 338 of file table.c.

339{
340 if (!table) return;
341
344 {
345 TRACE("destroying %p\n", table);
346 heap_free( (WCHAR *)table->name );
348 heap_free( table->data );
350 heap_free( table );
351 }
352}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
void clear_table(struct table *table)
Definition: table.c:314
void free_columns(struct column *columns, UINT num_cols)
Definition: table.c:330
#define TABLE_FLAG_DYNAMIC

◆ get_column_index()

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

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 }
47}

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 table,
const WCHAR name,
class_method **  func 
)

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;
281
282 if ((hr = get_value( table, i, j, &val )) != S_OK) return hr;
284 return S_OK;
285 }
286 }
287 }
289
290}
GLenum func
Definition: glext.h:6028
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
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
@ WBEM_E_INVALID_METHOD
Definition: wbemcli.idl:96
HRESULT() class_method(IWbemClassObject *, IWbemClassObject *, IWbemClassObject **)
#define COL_FLAG_METHOD

Referenced by wbem_services_ExecMethod().

◆ get_method_name()

BSTR get_method_name ( const WCHAR class,
UINT  index 
)

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 );
433 return ret;
434 }
435 count++;
436 }
437 }
439 return NULL;
440}
OLECHAR * BSTR
Definition: compat.h:2293
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint index
Definition: glext.h:6031
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238

Referenced by class_object_NextMethod().

◆ get_object()

HRESULT get_object ( const WCHAR object_path,
IWbemClassObject **  obj 
)

Definition at line 458 of file services.c.

459{
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 create_class_object(const WCHAR *name, IEnumWbemClassObject *iter, UINT index, struct record *record, IWbemClassObject **obj)
Definition: class.c:1021
static HRESULT create_instance_enum(const struct path *path, IEnumWbemClassObject **iter)
Definition: services.c:447
HRESULT parse_path(const WCHAR *str, struct path **ret)
Definition: services.c:326
void free_path(struct path *path)
Definition: services.c:413

Referenced by wbem_services_GetObject().

◆ get_properties()

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

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 );
1432 return E_OUTOFMEMORY;
1433 }
1434 SysFreeString( str );
1435 j++;
1436 }
1437 *props = sa;
1438 return S_OK;
1439}
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
@ VT_BSTR
Definition: compat.h:2303
SAFEARRAY *WINAPI SafeArrayCreateVector(VARTYPE vt, LONG lLbound, ULONG cElements)
Definition: safearray.c:677
HRESULT WINAPI SafeArrayDestroy(SAFEARRAY *psa)
Definition: safearray.c:1347
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 BOOL is_system_prop(const WCHAR *name)
Definition: query.c:816
BOOL is_result_prop(const struct view *view, const WCHAR *name)
Definition: query.c:804
static HRESULT map_view_index(const struct view *view, UINT index, UINT *table_index, UINT *result_index)
Definition: query.c:1139
static UINT count_result_properties(const struct view *view, UINT table_index)
Definition: query.c:933
unsigned int BOOL
Definition: ntddk_ex.h:94
GLbitfield flags
Definition: glext.h:7161
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
long LONG
Definition: pedump.c:60
@ WBEM_FLAG_NONSYSTEM_ONLY
Definition: wbemcli.idl:204
@ WBEM_FLAG_SYSTEM_ONLY
Definition: wbemcli.idl:203
static const WCHAR props[]
Definition: wbemdisp.c:288

Referenced by class_object_GetNames().

◆ get_propval()

HRESULT get_propval ( const struct view view,
UINT  index,
const WCHAR name,
VARIANT ret,
CIMTYPE type,
LONG flavor 
)

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 );
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
1205 vartype = to_vartype( table->columns[column].type & CIM_TYPE_MASK );
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}
unsigned short VARTYPE
Definition: compat.h:2254
@ VT_NULL
Definition: compat.h:2296
@ VT_ARRAY
Definition: compat.h:2341
VARTYPE to_vartype(CIMTYPE type)
Definition: query.c:1032
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
SAFEARRAY * to_safearray(const struct array *array, CIMTYPE basetype)
Definition: query.c:1062
void set_variant(VARTYPE type, LONGLONG val, void *val_ptr, VARIANT *ret)
Definition: query.c:1093
HRESULT get_column_index(const struct table *table, const WCHAR *name, UINT *column)
Definition: table.c:35
BSTR get_value_bstr(const struct table *table, UINT row, UINT column)
Definition: table.c:158
UINT result_count
@ CIM_UINT32
Definition: wbemcli.idl:249
@ CIM_UINT8
Definition: wbemcli.idl:247
@ CIM_SINT64
Definition: wbemcli.idl:250
@ CIM_UINT16
Definition: wbemcli.idl:248
@ CIM_REAL32
Definition: wbemcli.idl:241
@ CIM_SINT8
Definition: wbemcli.idl:246
@ CIM_SINT16
Definition: wbemcli.idl:239
@ CIM_SINT32
Definition: wbemcli.idl:240
long CIMTYPE
Definition: wbemcli.idl:258
@ WBEM_E_NOT_FOUND
Definition: wbemcli.idl:52
@ WBEM_E_FAILED
Definition: wbemcli.idl:51

Referenced by class_object_Get(), class_object_Next(), get_diskdrivetodiskpartition_pairs(), and get_logicaldisktopartition_pairs().

◆ get_type_size()

UINT get_type_size ( CIMTYPE  type)

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 int INT32
signed short INT16
signed char INT8
signed long long INT64
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define FLOAT
Definition: i386-dis.c:525

Referenced by get_column_size().

◆ get_value()

HRESULT get_value ( const struct table table,
UINT  row,
UINT  column,
LONGLONG val 
)

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}
unsigned short UINT16
unsigned long long UINT64
unsigned char UINT8
unsigned int UINT32
static UINT get_column_offset(const struct table *table, UINT column)
Definition: table.c:87
static UINT get_row_size(const struct table *table)
Definition: table.c:94
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static PVOID ptr
Definition: dispmode.c:27
float FLOAT
Definition: typedefs.h:69
unsigned char BYTE
Definition: xxhash.c:193

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 table,
UINT  row,
UINT  column 
)

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};
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}
#define FIXME(fmt,...)
Definition: debug.h:111
static const WCHAR falseW[]
Definition: json.c:34
static const WCHAR trueW[]
Definition: json.c:33
static unsigned int number
Definition: dsound.c:1479
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)

Referenced by build_proplist(), get_body_text(), and get_propval().

◆ get_view_table()

struct table * get_view_table ( const struct view view,
UINT  index 
)

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
1169 return view->table[index];
1170
1171 default:
1172 ERR( "unhandled view type %u\n", view->type );
1173 return NULL;
1174 }
1175}

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 name)

Definition at line 365 of file table.c.

366{
367 struct table *table;
368
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}
struct table * addref_table(struct table *table)
Definition: table.c:359

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:109
#define MultiByteToWideChar
Definition: compat.h:110
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340

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 lstrcpyW
Definition: compat.h:749

◆ init_table_list()

void init_table_list ( void  )

Definition at line 4605 of file builtin.c.

4606{
4607 static struct list tables = LIST_INIT( tables );
4608 UINT i;
4609
4611 table_list = &tables;
4612}
static struct table builtin_classes[]
Definition: builtin.c:4558
struct nls_table * tables
Definition: nls_base.c:22
#define LIST_INIT(head)
Definition: queue.h:197

Referenced by DllMain().

◆ is_method()

BOOL is_method ( const struct table table,
UINT  column 
)

Definition at line 917 of file query.c.

918{
919 return table->columns[column].type & COL_FLAG_METHOD;
920}

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

◆ is_result_prop()

BOOL is_result_prop ( const struct view view,
const WCHAR name 
)

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}
const struct property * next
BSTR name
Definition: locator.c:107

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

◆ parse_path()

HRESULT parse_path ( const WCHAR str,
struct path **  ret 
)

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 );
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;
408 }
409 *ret = path;
410 return S_OK;
411}
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
Definition: compname.c:446
unsigned long DWORD
Definition: ntddk_ex.h:95
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
GLfloat GLfloat p
Definition: glext.h:8902
_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)
UINT class_len
UINT filter_len
static rfbScreenInfoPtr server
Definition: vnc.c:74
@ WBEM_E_NOT_SUPPORTED
Definition: wbemcli.idl:62
@ WBEM_E_INVALID_NAMESPACE
Definition: wbemcli.idl:64
@ WBEM_E_INVALID_OBJECT_PATH
Definition: wbemcli.idl:108
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:243

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

◆ parse_query()

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

◆ process_get_owner()

HRESULT process_get_owner ( IWbemClassObject obj,
IWbemClassObject in,
IWbemClassObject **  out 
)

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 );
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
101done:
102 VariantClear( &user );
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}
void user(int argc, const char *argv[])
Definition: cmds.c:1350
HRESULT create_signature(const WCHAR *class, const WCHAR *method, enum param_direction dir, IWbemClassObject **sig)
Definition: class.c:819
static HRESULT get_owner(VARIANT *user, VARIANT *domain, VARIANT *retval)
Definition: process.c:34
GLuint in
Definition: glext.h:9616
static void out_params(void)
Definition: nanoxwin.c:1413
#define V_UI4(A)
Definition: oleauto.h:270
static FILE * out
Definition: regtests2xml.c:44
Definition: cookie.c:42
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
static const WCHAR param_userW[]
static const WCHAR method_getownerW[]
static const WCHAR class_processW[]
static const WCHAR param_returnvalueW[]
static const WCHAR param_domainW[]

Referenced by fill_process().

◆ put_propval()

HRESULT put_propval ( const struct view view,
UINT  index,
const WCHAR name,
VARIANT var,
CIMTYPE  type 
)

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}
static HRESULT set_value(struct d3dx_parameter *param, const void *data, unsigned int bytes, void *dst_data)
Definition: effect.c:889
HRESULT to_longlong(VARIANT *var, LONGLONG *val, CIMTYPE *type)
Definition: query.c:1325
const char * var
Definition: shader.c:5666

Referenced by class_object_Put().

◆ query_from_path()

WCHAR * query_from_path ( const struct path 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 );
443 }
444 return query;
445}
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274

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

◆ reg_create_key()

HRESULT reg_create_key ( IWbemClassObject obj,
IWbemClassObject in,
IWbemClassObject **  out 
)

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}
static HRESULT create_key(HKEY root, const WCHAR *subkey, VARIANT *retval)
Definition: reg.c:82
#define V_BSTR(A)
Definition: oleauto.h:226
#define V_I4(A)
Definition: oleauto.h:247
static const WCHAR class_stdregprovW[]
static const WCHAR method_createkeyW[]
static const WCHAR param_defkeyW[]
static const WCHAR param_subkeynameW[]

◆ reg_enum_key()

HRESULT reg_enum_key ( IWbemClassObject obj,
IWbemClassObject in,
IWbemClassObject **  out 
)

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
240done:
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
GLuint GLuint * names
Definition: glext.h:11545
static const WCHAR method_enumkeyW[]
static const WCHAR param_namesW[]

◆ reg_enum_values()

HRESULT reg_enum_values ( IWbemClassObject obj,
IWbemClassObject in,
IWbemClassObject **  out 
)

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
353done:
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}
static HRESULT enum_values(HKEY root, const WCHAR *subkey, VARIANT *names, VARIANT *types, VARIANT *retval)
Definition: reg.c:253
Definition: cmds.c:130
static const WCHAR method_enumvaluesW[]
static const WCHAR param_typesW[]

◆ reg_get_stringvalue()

HRESULT reg_get_stringvalue ( IWbemClassObject obj,
IWbemClassObject in,
IWbemClassObject **  out 
)

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
437done:
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}
static HRESULT get_stringvalue(HKEY root, const WCHAR *subkey, const WCHAR *name, VARIANT *value, VARIANT *retval)
Definition: reg.c:367
Definition: pdh_main.c:94
static const WCHAR param_valuenameW[]
static const WCHAR param_valueW[]
static const WCHAR method_getstringvalueW[]

◆ release_query()

void release_query ( struct query query)

Definition at line 781 of file query.c.

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

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

◆ release_table()

void release_table ( struct table table)

Definition at line 354 of file table.c.

355{
357}
static void free_table(MSITABLE *table)
Definition: table.c:362

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

◆ security_get_sd()

HRESULT security_get_sd ( IWbemClassObject obj,
IWbemClassObject in,
IWbemClassObject **  out 
)

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}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
@ VT_UI4
Definition: compat.h:2313
static HRESULT get_sd(SECURITY_DESCRIPTOR **sd, DWORD *size)
Definition: security.c:61
static HRESULT to_byte_array(void *data, DWORD size, VARIANT *var)
Definition: security.c:35
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static const WCHAR sd[]
Definition: suminfo.c:286
static const WCHAR param_sdW[]
static const WCHAR class_systemsecurityW[]
static const WCHAR method_getsdW[]

◆ security_set_sd()

HRESULT security_set_sd ( IWbemClassObject obj,
IWbemClassObject in,
IWbemClassObject **  out 
)

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}
static const WCHAR method_setsdW[]

◆ service_pause_service()

HRESULT service_pause_service ( IWbemClassObject obj,
IWbemClassObject in,
IWbemClassObject **  out 
)

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 {
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
112done:
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}
static HRESULT control_service(const WCHAR *name, DWORD control, VARIANT *retval)
Definition: service.c:54
static const WCHAR class_serviceW[]
static const WCHAR method_pauseserviceW[]
static const WCHAR prop_nameW[]
#define SERVICE_CONTROL_PAUSE
Definition: winsvc.h:37

Referenced by fill_service().

◆ service_resume_service()

HRESULT service_resume_service ( IWbemClassObject obj,
IWbemClassObject in,
IWbemClassObject **  out 
)

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
157done:
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}
static const WCHAR method_resumeserviceW[]
#define SERVICE_CONTROL_CONTINUE
Definition: winsvc.h:38

Referenced by fill_service().

◆ service_start_service()

HRESULT service_start_service ( IWbemClassObject obj,
IWbemClassObject in,
IWbemClassObject **  out 
)

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
226done:
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}
static HRESULT start_service(const WCHAR *name, VARIANT *retval)
Definition: service.c:169
static const WCHAR method_startserviceW[]

Referenced by fill_service().

◆ service_stop_service()

HRESULT service_stop_service ( IWbemClassObject obj,
IWbemClassObject in,
IWbemClassObject **  out 
)

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
271done:
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}
static const WCHAR method_stopserviceW[]
#define SERVICE_CONTROL_STOP
Definition: winsvc.h:36

Referenced by fill_service().

◆ set_value()

HRESULT set_value ( const struct table table,
UINT  row,
UINT  column,
LONGLONG  val,
CIMTYPE  type 
)

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}
@ WBEM_E_TYPE_MISMATCH
Definition: wbemcli.idl:55

◆ set_variant()

void set_variant ( VARTYPE  type,
LONGLONG  val,
void val_ptr,
VARIANT ret 
)

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}
@ VT_R4
Definition: compat.h:2299
@ VT_UI2
Definition: compat.h:2312
@ VT_I1
Definition: compat.h:2310
@ VT_I4
Definition: compat.h:2298
@ VT_BOOL
Definition: compat.h:2306
@ VT_I2
Definition: compat.h:2297
@ VT_UI1
Definition: compat.h:2311
#define V_UI1(A)
Definition: oleauto.h:266
#define V_BOOL(A)
Definition: oleauto.h:224
#define V_ARRAY(A)
Definition: oleauto.h:222
#define V_UI2(A)
Definition: oleauto.h:268
#define V_I1(A)
Definition: oleauto.h:243
#define V_VT(A)
Definition: oleauto.h:211
#define V_R4(A)
Definition: oleauto.h:260
#define V_I2(A)
Definition: oleauto.h:245

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 var,
LONGLONG val,
CIMTYPE type 
)

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 *val = (INT_PTR)to_array( var, type );
1335 if (!*val) return E_OUTOFMEMORY;
1336 return S_OK;
1337 }
1338 switch (V_VT( var ))
1339 {
1340 case VT_BOOL:
1341 *val = V_BOOL( var );
1342 *type = CIM_BOOLEAN;
1343 break;
1344 case VT_BSTR:
1345 *val = (INT_PTR)heap_strdupW( V_BSTR( var ) );
1346 if (!*val) return E_OUTOFMEMORY;
1347 *type = CIM_STRING;
1348 break;
1349 case VT_I2:
1350 *val = V_I2( var );
1351 *type = CIM_SINT16;
1352 break;
1353 case VT_UI2:
1354 *val = V_UI2( var );
1355 *type = CIM_UINT16;
1356 break;
1357 case VT_I4:
1358 *val = V_I4( var );
1359 *type = CIM_SINT32;
1360 break;
1361 case VT_UI4:
1362 *val = V_UI4( var );
1363 *type = CIM_UINT32;
1364 break;
1365 case VT_NULL:
1366 *val = 0;
1367 break;
1368 default:
1369 ERR("unhandled type %u\n", V_VT( var ));
1370 return WBEM_E_FAILED;
1371 }
1372 return S_OK;
1373}
static struct array * to_array(VARIANT *var, CIMTYPE *type)
Definition: query.c:1277

Referenced by put_propval(), and record_set_value().

◆ to_safearray()

SAFEARRAY * to_safearray ( const struct array array,
CIMTYPE  basetype 
)

Definition at line 1062 of file query.c.

1063{
1064 SAFEARRAY *ret;
1065 VARTYPE vartype = to_vartype( basetype );
1066 LONG i;
1067
1068 if (!array || !(ret = SafeArrayCreateVector( vartype, 0, array->count ))) return NULL;
1069
1070 for (i = 0; i < array->count; i++)
1071 {
1072 void *ptr = (char *)array->ptr + i * array->elem_size;
1073 if (vartype == VT_BSTR)
1074 {
1075 BSTR str = SysAllocString( *(const WCHAR **)ptr );
1076 if (!str || SafeArrayPutElement( ret, &i, str ) != S_OK)
1077 {
1078 SysFreeString( str );
1080 return NULL;
1081 }
1082 SysFreeString( str );
1083 }
1084 else if (SafeArrayPutElement( ret, &i, ptr ) != S_OK)
1085 {
1087 return NULL;
1088 }
1089 }
1090 return ret;
1091}
if(dx< 0)
Definition: linetemp.h:194

Referenced by get_propval(), and record_get_value().

◆ to_vartype()

VARTYPE to_vartype ( CIMTYPE  type)

Definition at line 1032 of file query.c.

1033{
1034 switch (type)
1035 {
1036 case CIM_BOOLEAN: return VT_BOOL;
1037
1038 case CIM_STRING:
1039 case CIM_REFERENCE:
1040 case CIM_DATETIME: return VT_BSTR;
1041
1042 case CIM_SINT8: return VT_I1;
1043 case CIM_UINT8: return VT_UI1;
1044 case CIM_SINT16: return VT_I2;
1045
1046 case CIM_UINT16:
1047 case CIM_SINT32:
1048 case CIM_UINT32: return VT_I4;
1049
1050 case CIM_SINT64: return VT_I8;
1051 case CIM_UINT64: return VT_UI8;
1052
1053 case CIM_REAL32: return VT_R4;
1054
1055 default:
1056 ERR("unhandled type %u\n", type);
1057 break;
1058 }
1059 return 0;
1060}
@ VT_UI8
Definition: compat.h:2315
@ VT_I8
Definition: compat.h:2314

Referenced by get_propval(), record_get_value(), and to_safearray().

◆ WbemLocator_create()

HRESULT WbemLocator_create ( LPVOID ppObj)

Definition at line 212 of file wbemlocator.c.

213{
214 wbem_locator *wl;
215
216 TRACE("(%p)\n", ppObj);
217
218 wl = heap_alloc( sizeof(*wl) );
219 if (!wl) return E_OUTOFMEMORY;
220
222 wl->refs = 1;
223
224 *ppObj = &wl->IWbemLocator_iface;
225
226 TRACE("returning iface %p\n", *ppObj);
227 return S_OK;
228}
IWbemLocator IWbemLocator_iface
Definition: wbemlocator.c:35
static const IWbemLocatorVtbl wbem_locator_vtbl
Definition: wbemlocator.c:204

◆ WbemQualifierSet_create()

HRESULT WbemQualifierSet_create ( const WCHAR class,
const WCHAR member,
LPVOID ppObj 
)

Definition at line 293 of file qualifier.c.

294{
295 struct qualifier_set *set;
296
297 TRACE("%p\n", ppObj);
298
299 if (!(set = heap_alloc( sizeof(*set) ))) return E_OUTOFMEMORY;
300
301 set->IWbemQualifierSet_iface.lpVtbl = &qualifier_set_vtbl;
302 if (!(set->class = heap_strdupW( class )))
303 {
304 heap_free( set );
305 return E_OUTOFMEMORY;
306 }
307 if (!member) set->member = NULL;
308 else if (!(set->member = heap_strdupW( member )))
309 {
310 heap_free( set->class );
311 heap_free( set );
312 return E_OUTOFMEMORY;
313 }
314 set->refs = 1;
315
316 *ppObj = &set->IWbemQualifierSet_iface;
317
318 TRACE("returning iface %p\n", *ppObj);
319 return S_OK;
320}
Definition: _set.h:50
static const IWbemQualifierSetVtbl qualifier_set_vtbl
Definition: qualifier.c:279

Referenced by class_object_GetPropertyQualifierSet(), and class_object_GetQualifierSet().

◆ WbemServices_create()

HRESULT WbemServices_create ( const WCHAR namespace,
LPVOID ppObj 
)

Definition at line 925 of file services.c.

926{
927 struct wbem_services *ws;
928
929 TRACE("(%p)\n", ppObj);
930
931 ws = heap_alloc( sizeof(*ws) );
932 if (!ws) return E_OUTOFMEMORY;
933
934 ws->IWbemServices_iface.lpVtbl = &wbem_services_vtbl;
935 ws->refs = 1;
936 ws->namespace = heap_strdupW( namespace );
937 ws->async = NULL;
939 ws->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": wbemprox_services.cs");
940
941 *ppObj = &ws->IWbemServices_iface;
942
943 TRACE("returning iface %p\n", *ppObj);
944 return S_OK;
945}
static const IWbemServicesVtbl wbem_services_vtbl
Definition: services.c:895
const char * ws
Definition: skip_ws.cpp:7
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
#define DWORD_PTR
Definition: treelist.c:76

Referenced by wbem_locator_ConnectServer(), and wbem_services_OpenNamespace().

Variable Documentation

◆ class_processW

const WCHAR class_processW[] = {'W','i','n','3','2','_','P','r','o','c','e','s','s',0}
static

Definition at line 280 of file wbemprox_private.h.

Referenced by process_get_owner().

◆ class_serviceW

const WCHAR class_serviceW[] = {'W','i','n','3','2','_','S','e','r','v','i','c','e',0}
static

◆ class_stdregprovW

const WCHAR class_stdregprovW[] = {'S','t','d','R','e','g','P','r','o','v',0}
static

◆ class_systemsecurityW

const WCHAR class_systemsecurityW[] = {'_','_','S','y','s','t','e','m','S','e','c','u','r','i','t','y',0}
static

Definition at line 283 of file wbemprox_private.h.

Referenced by security_get_sd(), and security_set_sd().

◆ DECLSPEC_HIDDEN

struct list* table_list DECLSPEC_HIDDEN
extern

Definition at line 29 of file wbemprox_private.h.

◆ method_createkeyW

const WCHAR method_createkeyW[] = {'C','r','e','a','t','e','K','e','y',0}
static

Definition at line 287 of file wbemprox_private.h.

Referenced by reg_create_key().

◆ method_enumkeyW

const WCHAR method_enumkeyW[] = {'E','n','u','m','K','e','y',0}
static

Definition at line 288 of file wbemprox_private.h.

Referenced by reg_enum_key().

◆ method_enumvaluesW

const WCHAR method_enumvaluesW[] = {'E','n','u','m','V','a','l','u','e','s',0}
static

Definition at line 289 of file wbemprox_private.h.

Referenced by reg_enum_values().

◆ method_getownerW

const WCHAR method_getownerW[] = {'G','e','t','O','w','n','e','r',0}
static

Definition at line 290 of file wbemprox_private.h.

Referenced by process_get_owner().

◆ method_getsdW

const WCHAR method_getsdW[] = {'G','e','t','S','D',0}
static

Definition at line 291 of file wbemprox_private.h.

Referenced by security_get_sd().

◆ method_getstringvalueW

const WCHAR method_getstringvalueW[] = {'G','e','t','S','t','r','i','n','g','V','a','l','u','e',0}
static

Definition at line 292 of file wbemprox_private.h.

Referenced by reg_get_stringvalue().

◆ method_pauseserviceW

const WCHAR method_pauseserviceW[] = {'P','a','u','s','e','S','e','r','v','i','c','e',0}
static

Definition at line 293 of file wbemprox_private.h.

Referenced by service_pause_service().

◆ method_resumeserviceW

const WCHAR method_resumeserviceW[] = {'R','e','s','u','m','e','S','e','r','v','i','c','e',0}
static

Definition at line 294 of file wbemprox_private.h.

Referenced by service_resume_service().

◆ method_setsdW

const WCHAR method_setsdW[] = {'S','e','t','S','D',0}
static

Definition at line 295 of file wbemprox_private.h.

Referenced by security_set_sd().

◆ method_startserviceW

const WCHAR method_startserviceW[] = {'S','t','a','r','t','S','e','r','v','i','c','e',0}
static

Definition at line 296 of file wbemprox_private.h.

Referenced by service_start_service().

◆ method_stopserviceW

const WCHAR method_stopserviceW[] = {'S','t','o','p','S','e','r','v','i','c','e',0}
static

Definition at line 297 of file wbemprox_private.h.

Referenced by service_stop_service().

◆ param_defkeyW

const WCHAR param_defkeyW[] = {'h','D','e','f','K','e','y',0}
static

◆ param_domainW

const WCHAR param_domainW[] = {'D','o','m','a','i','n',0}
static

Definition at line 300 of file wbemprox_private.h.

Referenced by process_get_owner().

◆ param_namesW

const WCHAR param_namesW[] = {'s','N','a','m','e','s',0}
static

Definition at line 301 of file wbemprox_private.h.

Referenced by reg_enum_key(), and reg_enum_values().

◆ param_returnvalueW

◆ param_sdW

const WCHAR param_sdW[] = {'S','D',0}
static

Definition at line 303 of file wbemprox_private.h.

Referenced by security_get_sd().

◆ param_subkeynameW

const WCHAR param_subkeynameW[] = {'s','S','u','b','K','e','y','N','a','m','e',0}
static

◆ param_typesW

const WCHAR param_typesW[] = {'T','y','p','e','s',0}
static

Definition at line 305 of file wbemprox_private.h.

Referenced by reg_enum_values().

◆ param_userW

const WCHAR param_userW[] = {'U','s','e','r',0}
static

Definition at line 306 of file wbemprox_private.h.

Referenced by process_get_owner().

◆ param_valuenameW

const WCHAR param_valuenameW[] = {'s','V','a','l','u','e','N','a','m','e',0}
static

Definition at line 308 of file wbemprox_private.h.

Referenced by reg_get_stringvalue().

◆ param_valueW

const WCHAR param_valueW[] = {'s','V','a','l','u','e',0}
static

Definition at line 307 of file wbemprox_private.h.

Referenced by reg_get_stringvalue().

◆ prop_nameW

const WCHAR prop_nameW[] = {'N','a','m','e',0}
static