Hans Leidekker : wbemprox: Return a null variant instead of an empty string if the property isn't set .

Alexandre Julliard julliard at winehq.org
Fri Jul 13 14:11:18 CDT 2012


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Fri Jul 13 11:34:42 2012 +0200

wbemprox: Return a null variant instead of an empty string if the property isn't set.

---

 dlls/wbemprox/query.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dlls/wbemprox/query.c b/dlls/wbemprox/query.c
index 1d2eca7..77a3bf3 100644
--- a/dlls/wbemprox/query.c
+++ b/dlls/wbemprox/query.c
@@ -728,6 +728,9 @@ static void set_variant( VARTYPE vartype, LONGLONG val, BSTR val_bstr, VARIANT *
         V_VT( ret ) = VT_UI4;
         V_UI4( ret ) = val;
         return;
+    case VT_NULL:
+        V_VT( ret ) = VT_NULL;
+        return;
     default:
         ERR("unhandled variant type %u\n", vartype);
         return;
@@ -758,8 +761,13 @@ HRESULT get_propval( const struct view *view, UINT index, const WCHAR *name, VAR
     {
     case CIM_STRING:
     case CIM_DATETIME:
-        vartype = VT_BSTR;
-        val_bstr = SysAllocString( (const WCHAR *)(INT_PTR)val );
+        if (val)
+        {
+            vartype = VT_BSTR;
+            val_bstr = SysAllocString( (const WCHAR *)(INT_PTR)val );
+        }
+        else
+            vartype = VT_NULL;
         break;
     case CIM_SINT16:
         if (!vartype) vartype = VT_I2;




More information about the wine-cvs mailing list