Commit 0fe64ce3 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

oledb32: Implement GetConversionSize DBTYPE_VARIANT -> DBTYPE_BYTES.

parent 5b8a375a
......@@ -143,6 +143,7 @@ static int get_length(DBTYPE type)
return sizeof(FILETIME);
case DBTYPE_GUID:
return sizeof(GUID);
case DBTYPE_BYTES:
case DBTYPE_WSTR:
case DBTYPE_STR:
case DBTYPE_BYREF | DBTYPE_WSTR:
......@@ -1363,6 +1364,26 @@ static HRESULT WINAPI convert_GetConversionSize(IDataConvert* iface,
}
}
break;
case DBTYPE_BYTES:
{
switch (src_type)
{
case DBTYPE_VARIANT:
{
if(V_VT((VARIANT*)src) == VT_BSTR)
*dst_len = (SysStringLen(V_BSTR((VARIANT*)src))) / sizeof(WCHAR);
else
WARN("DBTYPE_BYTES->DBTYPE_VARIANT(%d) unimplemented\n", V_VT((VARIANT*)src));
return S_OK;
}
break;
default:
FIXME("unimplemented for %04x -> DBTYPE_BYTES\n", src_type);
return E_NOTIMPL;
}
}
break;
default:
FIXME("unimplemented for conversion %d->%d\n", src_type, dst_type);
return E_NOTIMPL;
......
......@@ -2464,6 +2464,21 @@ static void test_getconversionsize(void)
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
VariantClear(&var);
dst_len = 0;
src_len = 20;
V_VT(&var) = VT_BSTR;
V_BSTR(&var) = SysAllocString(strW);
hr = IDataConvert_GetConversionSize(convert, DBTYPE_VARIANT, DBTYPE_BYTES, &src_len, &dst_len, &var);
ok(hr == S_OK, "got 0x%08x\n", hr);
ok(dst_len == 2, "%ld\n", dst_len);
VariantClear(&var);
dst_len = 0;
src_len = 20;
V_VT(&var) = VT_NULL;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_VARIANT, DBTYPE_BYTES, &src_len, &dst_len, &var);
ok(hr == S_OK, "got 0x%08x\n", hr);
VariantClear(&var);
}
static void test_converttobytes(void)
......
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