Hans Leidekker : wbemprox: Add support for boolean properties.

Alexandre Julliard julliard at winehq.org
Mon Jul 30 14:18:51 CDT 2012


Module: wine
Branch: master
Commit: 773f5f8dc234ca2a7c83a502c4b83a424f22d749
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=773f5f8dc234ca2a7c83a502c4b83a424f22d749

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Mon Jul 30 15:04:03 2012 +0200

wbemprox: Add support for boolean properties.

---

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

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;




More information about the wine-cvs mailing list