oledb32: DataConvert support DBTYPE_VARIANT -> DBTYPE_R4.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alistair Leslie-Hughes 2017-11-07 23:11:03 +00:00 committed by Alexandre Julliard
parent 6864803f1a
commit 4a5759dcc2
2 changed files with 14 additions and 0 deletions

View File

@ -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;

View File

@ -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)