Commit 773f5f8d authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wbemprox: Add support for boolean properties.

parent 6714f16c
......@@ -550,6 +550,10 @@ static void set_variant( VARTYPE vartype, LONGLONG val, BSTR val_bstr, VARIANT *
{
switch (vartype)
{
case VT_BOOL:
V_VT( ret ) = VT_BOOL;
V_BOOL( ret ) = val;
return;
case VT_BSTR:
V_VT( ret ) = VT_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)
{
case CIM_BOOLEAN:
if (!vartype) vartype = VT_BOOL;
break;
case CIM_STRING:
case CIM_DATETIME:
if (val)
......@@ -650,6 +657,10 @@ static HRESULT variant_to_longlong( VARIANT *var, LONGLONG *val, CIMTYPE *type )
}
switch (V_VT( var ))
{
case VT_BOOL:
*val = V_BOOL( var );
*type = CIM_BOOLEAN;
break;
case VT_BSTR:
*val = (INT_PTR)SysAllocString( V_BSTR( var ) );
if (!*val) return E_OUTOFMEMORY;
......
......@@ -50,6 +50,8 @@ UINT get_type_size( CIMTYPE type )
switch (type)
{
case CIM_BOOLEAN:
return sizeof(int);
case CIM_SINT16:
case CIM_UINT16:
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)
{
case CIM_BOOLEAN:
*val = *(const int *)ptr;
break;
case CIM_DATETIME:
case CIM_STRING:
*val = (LONGLONG)(INT_PTR)*(const WCHAR **)ptr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment