[1/5] wbemprox: Add support for boolean properties.

Hans Leidekker hans at codeweavers.com
Mon Jul 30 08:04:03 CDT 2012


---
 dlls/wbemprox/query.c |   11 +++++++++++
 dlls/wbemprox/table.c |    5 +++++
 2 files changed, 16 insertions(+)

diff --git a/dlls/wbemprox/query.c b/dlls/wbemprox/query.c
index 15423d9..d2b0e76 100644
--- a/dlls/wbemprox/query.c
+++ b/dlls/wbemprox/query.c
@@ -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;
diff --git a/dlls/wbemprox/table.c b/dlls/wbemprox/table.c
index d94a8e8..5b6f4b4 100644
--- a/dlls/wbemprox/table.c
+++ b/dlls/wbemprox/table.c
@@ -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;
-- 
1.7.10.4







More information about the wine-patches mailing list