[2/2] oledb32: Source status DBSTATUS_S_ISNULL applies to all conversions

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Tue May 21 05:42:24 CDT 2013


Hi,


Changelog:
     oledb32: Source status DBSTATUS_S_ISNULL applies to all conversions


Best Regards
  Alistair Leslie-Hughes
-------------- next part --------------
>From fdcfe4f917fa7158cfce6e1f0f74492e6cc37426 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Tue, 21 May 2013 13:43:42 +1000
Subject: [PATCH] Source status DBSTATUS_S_ISNULL applies to any conversions
To: wine-patches <wine-patches at winehq.org>

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

diff --git a/dlls/oledb32/convert.c b/dlls/oledb32/convert.c
index a5cdde3..bd7c353 100644
--- a/dlls/oledb32/convert.c
+++ b/dlls/oledb32/convert.c
@@ -184,6 +184,13 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
         return DB_E_UNSUPPORTEDCONVERSION;
     }
 
+    if(src_status == DBSTATUS_S_ISNULL)
+    {
+        *dst_status = DBSTATUS_S_ISNULL;
+        *dst_len = 0;
+        return S_OK;
+    }
+
     if(src_type == DBTYPE_STR)
     {
         BSTR b;
@@ -803,13 +810,6 @@ 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 305433a..92d3a64 100644
--- a/dlls/oledb32/tests/convert.c
+++ b/dlls/oledb32/tests/convert.c
@@ -884,6 +884,14 @@ todo_wine
     ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status);
     ok(dst_len == sizeof(i4), "got %ld\n", dst_len);
     ok(i4 == 10, "got %08x\n", i4);
+
+    /* src_status = DBSTATUS_S_ISNULL */
+    i4 = 0x12345678;
+    hr = IDataConvert_DataConvert(convert, DBTYPE_I4, DBTYPE_I4, 0, &dst_len, src, &i4, sizeof(i4), 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_converttoi8(void)
-- 
1.8.1.2



More information about the wine-patches mailing list