Commit 975f1dcd authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

oledb32: Implement DataConvert DBTYPE_I8->DBTYPE_I8.

parent faba70ad
...@@ -287,6 +287,17 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface, ...@@ -287,6 +287,17 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
break; 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: case DBTYPE_R4:
{ {
FLOAT *d = dst; FLOAT *d = dst;
......
...@@ -917,6 +917,34 @@ todo_wine ...@@ -917,6 +917,34 @@ todo_wine
IDataConvert_Release(convert); 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) static void test_converttobstr(void)
{ {
IDataConvert *convert; IDataConvert *convert;
...@@ -2530,6 +2558,7 @@ START_TEST(convert) ...@@ -2530,6 +2558,7 @@ START_TEST(convert)
test_canconvert(); test_canconvert();
test_converttoi2(); test_converttoi2();
test_converttoi4(); test_converttoi4();
test_converttoi8();
test_converttostr(); test_converttostr();
test_converttobstr(); test_converttobstr();
test_converttowstr(); test_converttowstr();
......
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