Alistair Leslie-Hughes : oledb32: DataConvert support DBTYPE_VARIANT -> DBTYPE_R4.
Alexandre Julliard
julliard at winehq.org
Wed Nov 8 16:01:09 CST 2017
Module: wine
Branch: master
Commit: 4a5759dcc21ceff27c94b246c561b3d25f0e7784
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4a5759dcc21ceff27c94b246c561b3d25f0e7784
Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Tue Nov 7 23:11:03 2017 +0000
oledb32: DataConvert support DBTYPE_VARIANT -> DBTYPE_R4.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/oledb32/convert.c | 5 +++++
dlls/oledb32/tests/convert.c | 9 +++++++++
2 files changed, 14 insertions(+)
diff --git a/dlls/oledb32/convert.c b/dlls/oledb32/convert.c
index 7fa4c81..267de1b 100644
--- a/dlls/oledb32/convert.c
+++ b/dlls/oledb32/convert.c
@@ -343,6 +343,11 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
case DBTYPE_UI4: hr = VarR4FromUI4(*(DWORD*)src, d); break;
case DBTYPE_I8: hr = VarR4FromI8(*(LONGLONG*)src, d); break;
case DBTYPE_UI8: hr = VarR4FromUI8(*(ULONGLONG*)src, d); break;
+ case DBTYPE_VARIANT:
+ VariantInit(&tmp);
+ if ((hr = VariantChangeType(&tmp, (VARIANT*)src, 0, VT_R4)) == S_OK)
+ *d = V_R4(&tmp);
+ break;
default: FIXME("Unimplemented conversion %04x -> R4\n", src_type); return E_NOTIMPL;
}
break;
diff --git a/dlls/oledb32/tests/convert.c b/dlls/oledb32/tests/convert.c
index 708471b..b45775f 100644
--- a/dlls/oledb32/tests/convert.c
+++ b/dlls/oledb32/tests/convert.c
@@ -2580,6 +2580,15 @@ static void test_converttor4(void)
ok(hr == S_OK, "got %08x\n", hr);
ok(dst_status == DBSTATUS_S_ISNULL, "got %08x\n", dst_status);
ok(dst_len == 44, "got %ld\n", dst_len);
+
+ dst_len = dst = 0x1234;
+ V_VT(&v) = VT_I2;
+ V_I2(&v) = 0x4321;
+ hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_R4, 0, &dst_len, &v, &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 == 0x4321, "got %f\n", dst);
}
static void test_converttor8(void)
More information about the wine-cvs
mailing list