[2/3] oledb32: Implement DataConvert DBTYPE_I8->DBTYPE_I8

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Tue Apr 16 05:21:47 CDT 2013


Hi,


Changelog:
     oledb32: Implement DataConvert DBTYPE_I8->DBTYPE_I8


Best Regards
  Alistair Leslie-Hughes
-------------- next part --------------
>From 3b9d20b1726c0dc48deb28cd0cb44361cd2f4df6 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Tue, 16 Apr 2013 10:34:52 +1000
Subject: [PATCH] Implement DataConvert DBTYPE_I8->DBTYPE_I8
To: wine-patches <wine-patches at winehq.org>

---
 dlls/oledb32/convert.c       |   11 +++++++++++
 dlls/oledb32/tests/convert.c |   29 +++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/dlls/oledb32/convert.c b/dlls/oledb32/convert.c
index 1cce07a..9a82956 100644
--- a/dlls/oledb32/convert.c
+++ b/dlls/oledb32/convert.c
@@ -287,6 +287,17 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
         break;
     }
 
+    case DBTYPE_I8:
+    {
+        LONGLONG *d = dst;
+        switch(src_type)
+        {
+        case DBTYPE_I8:          *d = *(LONGLONG*)src; hr = S_OK;              break;
+        default: FIXME("Unimplemented conversion %04x -> I8\n", src_type); return E_NOTIMPL;
+        }
+        break;
+    }
+
     case DBTYPE_R4:
     {
         FLOAT *d = dst;
diff --git a/dlls/oledb32/tests/convert.c b/dlls/oledb32/tests/convert.c
index 4623825..ef05c40 100644
--- a/dlls/oledb32/tests/convert.c
+++ b/dlls/oledb32/tests/convert.c
@@ -917,6 +917,34 @@ todo_wine
     IDataConvert_Release(convert);
 }
 
+static void test_converttoi8(void)
+{
+    IDataConvert *convert;
+    HRESULT hr;
+    LARGE_INTEGER dst;
+    BYTE src[20];
+    DBSTATUS dst_status;
+    DBLENGTH dst_len;
+
+    hr = CoCreateInstance(&CLSID_OLEDB_CONVERSIONLIBRARY, NULL, CLSCTX_INPROC_SERVER, &IID_IDataConvert, (void**)&convert);
+    if(FAILED(hr))
+    {
+        win_skip("Unable to load oledb conversion library\n");
+        return;
+    }
+
+    dst.QuadPart = 0xcc;
+    ((ULARGE_INTEGER*)src)->QuadPart = 1234;
+    dst_len = 0x1234;
+    hr = IDataConvert_DataConvert(convert, DBTYPE_I8, DBTYPE_I8, 0, &dst_len, src, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0);
+    ok(hr == S_OK, "got %08x\n", hr);
+    ok(dst_status == DBSTATUS_S_OK, "got %08x\n", dst_status);
+    ok(dst_len == sizeof(dst), "got %ld\n", dst_len);
+    ok(dst.QuadPart == 1234, "got %d\n", (int)dst.QuadPart);
+
+    IDataConvert_Release(convert);
+}
+
 static void test_converttobstr(void)
 {
     IDataConvert *convert;
@@ -2530,6 +2558,7 @@ START_TEST(convert)
     test_canconvert();
     test_converttoi2();
     test_converttoi4();
+    test_converttoi8();
     test_converttostr();
     test_converttobstr();
     test_converttowstr();
-- 
1.7.10.4



More information about the wine-patches mailing list