[4/5] oledb32: DataConvert only variant length types can have a null dst

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Thu May 23 03:47:34 CDT 2013


Hi,


Changelog:
     oledb32: DataConvert only variant length types can have a null dst


Best Regards
  Alistair Leslie-Hughes
-------------- next part --------------
>From 0e61a573195a495ce1a2774f85d177706c5a74bc Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Thu, 23 May 2013 14:57:39 +1000
Subject: [PATCH] DataConvert only variant length types can have a null dst.
To: wine-patches <wine-patches at winehq.org>

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

diff --git a/dlls/oledb32/convert.c b/dlls/oledb32/convert.c
index 7e6a0c0..0961464 100644
--- a/dlls/oledb32/convert.c
+++ b/dlls/oledb32/convert.c
@@ -191,6 +191,13 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
         return S_OK;
     }
 
+    if(dst == NULL && get_length(dst_type) != 0)
+    {
+        *dst_len = get_length(src_type);
+        *dst_status = DBSTATUS_S_OK;
+        return S_OK;
+    }
+
     if(src_type == DBTYPE_STR)
     {
         BSTR b;
diff --git a/dlls/oledb32/tests/convert.c b/dlls/oledb32/tests/convert.c
index e0c6671..dcc20a1 100644
--- a/dlls/oledb32/tests/convert.c
+++ b/dlls/oledb32/tests/convert.c
@@ -892,6 +892,13 @@ todo_wine
     ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status);
     ok(dst_len == 0, "got %ld\n", dst_len);
 
+    /* dst = NULL */
+    *(int *)src = 0x4321cafe;
+    dst_len = 0x1234;
+    hr = IDataConvert_DataConvert(convert, DBTYPE_I4, DBTYPE_I4, 0, &dst_len, src, NULL, 0, 0, NULL, 0, 0, 0);
+    ok(hr == S_OK, "got %08x\n", hr);
+    ok(dst_len == sizeof(i4), "got %ld\n", dst_len);
+
 }
 
 static void test_converttoi8(void)
-- 
1.8.1.2



More information about the wine-patches mailing list