Commit 0dc1c6ac authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

oledb32: Support converting DBTYPE_VARIANT to DBTYPE_UI8.

parent c29b7db3
...@@ -826,6 +826,11 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface, ...@@ -826,6 +826,11 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
case DBTYPE_UI4: hr = VarUI8FromUI4(*(DWORD*)src, d); break; case DBTYPE_UI4: hr = VarUI8FromUI4(*(DWORD*)src, d); break;
case DBTYPE_I8: hr = VarUI8FromI8(*(LONGLONG*)src, d); break; case DBTYPE_I8: hr = VarUI8FromI8(*(LONGLONG*)src, d); break;
case DBTYPE_UI8: *d = *(ULONGLONG*)src; hr = S_OK; break; case DBTYPE_UI8: *d = *(ULONGLONG*)src; hr = S_OK; break;
case DBTYPE_VARIANT:
VariantInit(&tmp);
if ((hr = VariantChangeType(&tmp, src, 0, VT_UI8)) == S_OK)
*d = V_UI8(&tmp);
break;
default: FIXME("Unimplemented conversion %04x -> UI8\n", src_type); return E_NOTIMPL; default: FIXME("Unimplemented conversion %04x -> UI8\n", src_type); return E_NOTIMPL;
} }
break; break;
......
...@@ -3082,13 +3082,9 @@ static void test_converttoui8(void) ...@@ -3082,13 +3082,9 @@ static void test_converttoui8(void)
V_UI8(&v) = 4321; V_UI8(&v) = 4321;
dst_len = 0x1234; dst_len = 0x1234;
hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_UI8, 0, &dst_len, &v, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0); hr = IDataConvert_DataConvert(convert, DBTYPE_VARIANT, DBTYPE_UI8, 0, &dst_len, &v, &dst, sizeof(dst), 0, &dst_status, 0, 0, 0);
todo_wine
ok(hr == S_OK, "got %08lx\n", hr); ok(hr == S_OK, "got %08lx\n", hr);
todo_wine
ok(dst_status == DBSTATUS_S_OK, "got %08lx\n", dst_status); ok(dst_status == DBSTATUS_S_OK, "got %08lx\n", dst_status);
todo_wine
ok(dst_len == sizeof(dst), "got %Id\n", dst_len); ok(dst_len == sizeof(dst), "got %Id\n", dst_len);
todo_wine
ok(dst.QuadPart == 4321, "got %d\n", (int)dst.QuadPart); ok(dst.QuadPart == 4321, "got %d\n", (int)dst.QuadPart);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment