oledb32: GetConversionSize only returns a valid size of BSTR.

This commit is contained in:
Alistair Leslie-Hughes 2013-05-24 15:12:24 +10:00 committed by Alexandre Julliard
parent 0fe64ce339
commit 338cb2e5dd
2 changed files with 8 additions and 27 deletions

View File

@ -1305,7 +1305,6 @@ static HRESULT WINAPI convert_GetConversionSize(IDataConvert* iface,
switch (dst_type)
{
case DBTYPE_STR:
{
switch (src_type)
{
case DBTYPE_VARIANT:
@ -1326,26 +1325,16 @@ static HRESULT WINAPI convert_GetConversionSize(IDataConvert* iface,
FIXME("unimplemented for %04x -> DBTYPE_STR\n", src_type);
return E_NOTIMPL;
}
}
break;
break;
case DBTYPE_WSTR:
{
switch (src_type)
{
case DBTYPE_VARIANT:
{
VARIANT v;
VariantInit(&v);
if ((hr = VariantChangeType(&v, (VARIANT*)src, 0, VT_BSTR)) == S_OK)
{
*dst_len = (SysStringLen(V_BSTR(&v)) + 1) * sizeof(WCHAR);
VariantClear(&v);
}
if(V_VT((VARIANT*)src) == VT_BSTR)
*dst_len = (SysStringLen(V_BSTR((VARIANT*)src))+1) * sizeof(WCHAR);
else
return hr;
}
break;
WARN("DBTYPE_BYTES->DBTYPE_VARIANT(%d) unimplemented\n", V_VT((VARIANT*)src));
break;
case DBTYPE_STR:
if(src_len)
*dst_len = (*src_len + 1) * sizeof(WCHAR);
@ -1362,28 +1351,21 @@ static HRESULT WINAPI convert_GetConversionSize(IDataConvert* iface,
FIXME("unimplemented for %04x -> DBTYPE_WSTR\n", src_type);
return E_NOTIMPL;
}
}
break;
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;
break;
default:
FIXME("unimplemented for %04x -> DBTYPE_BYTES\n", src_type);
return E_NOTIMPL;
}
}
break;
break;
default:
FIXME("unimplemented for conversion %d->%d\n", src_type, dst_type);
return E_NOTIMPL;

View File

@ -2461,7 +2461,6 @@ static void test_getconversionsize(void)
V_I4(&var) = 4;
hr = IDataConvert_GetConversionSize(convert, DBTYPE_VARIANT, DBTYPE_WSTR, &src_len, &dst_len, &var);
ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(dst_len == 110, "%ld\n", dst_len);
VariantClear(&var);
dst_len = 0;