oledb32: Support DBSTATUS_S_ISNULL when converting to VARIANT

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Mon May 20 05:54:33 CDT 2013


Hi,


Changelog:
     oledb32: Support DBSTATUS_S_ISNULL when converting to VARIANT


Best Regards
  Alistair Leslie-Hughes
-------------- next part --------------
>From d6e668d1bd6923ba9e5dcde3ab507f7c4d372eda Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Mon, 20 May 2013 15:33:22 +1000
Subject: [PATCH] Support DBSTATUS_S_ISNULL when converting to VARIANT
To: wine-patches <wine-patches at winehq.org>

---
 dlls/oledb32/convert.c       | 7 +++++++
 dlls/oledb32/tests/convert.c | 8 ++++++++
 2 files changed, 15 insertions(+)

diff --git a/dlls/oledb32/convert.c b/dlls/oledb32/convert.c
index 7a15afb..a81f0ce 100644
--- a/dlls/oledb32/convert.c
+++ b/dlls/oledb32/convert.c
@@ -789,6 +789,13 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
     {
         VARIANT *v = dst;
 
+        if(src_status == DBSTATUS_S_ISNULL)
+        {
+            *dst_status = DBSTATUS_S_ISNULL;
+            *dst_len = 0;
+            return S_OK;
+        }
+
         switch(src_type)
         {
         case DBTYPE_BOOL:
diff --git a/dlls/oledb32/tests/convert.c b/dlls/oledb32/tests/convert.c
index 39f96d2..68df732 100644
--- a/dlls/oledb32/tests/convert.c
+++ b/dlls/oledb32/tests/convert.c
@@ -2601,6 +2601,14 @@ static void test_converttovar(void)
     ok(dst_len == sizeof(dst), "got %ld\n", dst_len);
     ok(V_VT(&dst) == VT_DATE, "got %d\n", V_VT(&dst));
     ok( (float)V_DATE(&dst) == 41409.0, "got %f\n", V_DATE(&dst));
+
+    /* src_status = DBSTATUS_S_ISNULL */
+    i4 = 123;
+    hr = IDataConvert_DataConvert(convert, DBTYPE_I4, DBTYPE_VARIANT, sizeof(i4), &dst_len, &i4, &dst, sizeof(dst), DBSTATUS_S_ISNULL, &dst_status, 0, 0, 0);
+    ok(hr == S_OK, "got %08x\n", hr);
+    ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status);
+    ok(dst_len == 0, "got %ld\n", dst_len);
+
 }
 
 static void test_converttotimestamp(void)
-- 
1.8.1.2



More information about the wine-patches mailing list