wbemprox: Add support for boolean properties.

This commit is contained in:
Hans Leidekker 2012-07-30 15:04:03 +02:00 committed by Alexandre Julliard
parent 6714f16c74
commit 773f5f8dc2
2 changed files with 16 additions and 0 deletions

View File

@ -550,6 +550,10 @@ static void set_variant( VARTYPE vartype, LONGLONG val, BSTR val_bstr, VARIANT *
{ {
switch (vartype) switch (vartype)
{ {
case VT_BOOL:
V_VT( ret ) = VT_BOOL;
V_BOOL( ret ) = val;
return;
case VT_BSTR: case VT_BSTR:
V_VT( ret ) = VT_BSTR; V_VT( ret ) = VT_BSTR;
V_BSTR( ret ) = val_bstr; V_BSTR( ret ) = val_bstr;
@ -601,6 +605,9 @@ HRESULT get_propval( const struct view *view, UINT index, const WCHAR *name, VAR
switch (view->table->columns[column].type & COL_TYPE_MASK) switch (view->table->columns[column].type & COL_TYPE_MASK)
{ {
case CIM_BOOLEAN:
if (!vartype) vartype = VT_BOOL;
break;
case CIM_STRING: case CIM_STRING:
case CIM_DATETIME: case CIM_DATETIME:
if (val) if (val)
@ -650,6 +657,10 @@ static HRESULT variant_to_longlong( VARIANT *var, LONGLONG *val, CIMTYPE *type )
} }
switch (V_VT( var )) switch (V_VT( var ))
{ {
case VT_BOOL:
*val = V_BOOL( var );
*type = CIM_BOOLEAN;
break;
case VT_BSTR: case VT_BSTR:
*val = (INT_PTR)SysAllocString( V_BSTR( var ) ); *val = (INT_PTR)SysAllocString( V_BSTR( var ) );
if (!*val) return E_OUTOFMEMORY; if (!*val) return E_OUTOFMEMORY;

View File

@ -50,6 +50,8 @@ UINT get_type_size( CIMTYPE type )
switch (type) switch (type)
{ {
case CIM_BOOLEAN:
return sizeof(int);
case CIM_SINT16: case CIM_SINT16:
case CIM_UINT16: case CIM_UINT16:
return sizeof(INT16); return sizeof(INT16);
@ -102,6 +104,9 @@ HRESULT get_value( const struct table *table, UINT row, UINT column, LONGLONG *v
} }
switch (table->columns[column].type & COL_TYPE_MASK) switch (table->columns[column].type & COL_TYPE_MASK)
{ {
case CIM_BOOLEAN:
*val = *(const int *)ptr;
break;
case CIM_DATETIME: case CIM_DATETIME:
case CIM_STRING: case CIM_STRING:
*val = (LONGLONG)(INT_PTR)*(const WCHAR **)ptr; *val = (LONGLONG)(INT_PTR)*(const WCHAR **)ptr;