ReactOS 0.4.15-dev-7788-g1ad9096
table.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wbemcli.h"
#include "wine/debug.h"
#include "wbemprox_private.h"
Include dependency graph for table.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wbemprox)
 
HRESULT get_column_index (const struct table *table, const WCHAR *name, UINT *column)
 
UINT get_type_size (CIMTYPE type)
 
static UINT get_column_size (const struct table *table, UINT column)
 
static UINT get_column_offset (const struct table *table, UINT column)
 
static UINT get_row_size (const struct table *table)
 
HRESULT get_value (const struct table *table, UINT row, UINT column, LONGLONG *val)
 
BSTR get_value_bstr (const struct table *table, UINT row, UINT column)
 
HRESULT set_value (const struct table *table, UINT row, UINT column, LONGLONG val, CIMTYPE type)
 
HRESULT get_method (const struct table *table, const WCHAR *name, class_method **func)
 
void free_row_values (const struct table *table, UINT row)
 
void clear_table (struct table *table)
 
void free_columns (struct column *columns, UINT num_cols)
 
void free_table (struct table *table)
 
void release_table (struct table *table)
 
struct tableaddref_table (struct table *table)
 
struct tablegrab_table (const WCHAR *name)
 
struct tablecreate_table (const WCHAR *name, UINT num_cols, const struct column *columns, UINT num_rows, UINT num_allocated, BYTE *data, enum fill_status(*fill)(struct table *, const struct expr *cond))
 
BOOL add_table (struct table *table)
 
BSTR get_method_name (const WCHAR *class, UINT index)
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 19 of file table.c.

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

struct table * addref_table ( struct table table)

Definition at line 359 of file table.c.

360{
362 return table;
363}
#define InterlockedIncrement
Definition: armddk.h:53

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

struct table * create_table ( const WCHAR name,
UINT  num_cols,
const struct column columns,
UINT  num_rows,
UINT  num_allocated,
BYTE data,
enum fill_status(*)(struct table *, const struct expr *cond)  fill 
)

Definition at line 380 of file table.c.

383{
384 struct table *table;
385
386 if (!(table = heap_alloc( sizeof(*table) ))) return NULL;
391 table->num_rows_allocated = num_allocated;
392 table->data = data;
393 table->fill = fill;
395 table->refs = 0;
396 list_init( &table->entry );
397 return table;
398}
_STLP_MOVE_TO_STD_NAMESPACE void fill(_ForwardIter __first, _ForwardIter __last, const _Tp &__val)
Definition: _algobase.h:449
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static void list_init(struct list_entry *head)
Definition: list.h:51
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int JSAMPARRAY int int num_rows
Definition: jpegint.h:421
int JSAMPARRAY int int JDIMENSION num_cols
Definition: jpegint.h:421
Definition: name.c:39
const struct column * columns
UINT num_cols
#define TABLE_FLAG_DYNAMIC

Referenced by create_signature_table().

◆ 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}
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by create_signature_table(), and free_table().

◆ 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
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 GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint GLfloat * val
Definition: glext.h:7180
#define S_OK
Definition: intsafe.h:52
int32_t INT_PTR
Definition: typedefs.h:64
int64_t LONGLONG
Definition: typedefs.h:68
@ CIM_REFERENCE
Definition: wbemcli.idl:253
@ CIM_DATETIME
Definition: wbemcli.idl:252
@ CIM_STRING
Definition: wbemcli.idl:243
@ 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

◆ 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}
@ WBEM_E_INVALID_QUERY
Definition: wbemcli.idl:73

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

◆ get_column_offset()

static UINT get_column_offset ( const struct table table,
UINT  column 
)
static

Definition at line 87 of file table.c.

88{
89 UINT i, offset = 0;
90 for (i = 0; i < column; i++) offset += get_column_size( table, i );
91 return offset;
92}
static UINT get_column_size(const struct table *table, UINT column)
Definition: table.c:82
GLintptr offset
Definition: glext.h:5920

Referenced by get_row_size(), get_value(), and set_value().

◆ get_column_size()

static UINT get_column_size ( const struct table table,
UINT  column 
)
static

Definition at line 82 of file table.c.

83{
85}
UINT get_type_size(CIMTYPE type)
Definition: table.c:49

Referenced by get_column_offset(), and get_row_size().

◆ 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)
HRESULT hr
Definition: shlfolder.c:183
@ 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
struct table * grab_table(const WCHAR *name)
Definition: table.c:365
void release_table(struct table *table)
Definition: table.c:354
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint index
Definition: glext.h:6031
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
int ret

Referenced by class_object_NextMethod().

◆ get_row_size()

static UINT get_row_size ( const struct table table)
static

Definition at line 94 of file table.c.

95{
97}
static UINT get_column_offset(const struct table *table, UINT column)
Definition: table.c:87

Referenced by get_value(), and set_value().

◆ 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
#define ERR(fmt,...)
Definition: debug.h:110
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define FLOAT
Definition: i386-dis.c:525
@ CIM_UINT32
Definition: wbemcli.idl:249
@ CIM_UINT8
Definition: wbemcli.idl:247
@ CIM_BOOLEAN
Definition: wbemcli.idl:244
@ CIM_SINT64
Definition: wbemcli.idl:250
@ CIM_UINT16
Definition: wbemcli.idl:248
@ CIM_REAL32
Definition: wbemcli.idl:241
@ CIM_UINT64
Definition: wbemcli.idl:251
@ CIM_SINT8
Definition: wbemcli.idl:246
@ CIM_SINT16
Definition: wbemcli.idl:239
@ CIM_SINT32
Definition: wbemcli.idl:240

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_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
#define lstrlenW
Definition: compat.h:750
#define swprintf
Definition: precomp.h:40
GLenum GLsizei len
Definition: glext.h:6722
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().

◆ 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().

◆ release_table()

void release_table ( struct table table)

Definition at line 354 of file table.c.

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

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

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

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wbemprox  )