Commit 9c700260 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

oledb32: Convert to a BSTR to work out it size.

This makes code for handling variants with DBTYPE_STR and DBTYPE_WSTR types consistent. Signed-off-by: 's avatarAlistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent bb72548f
......@@ -1372,10 +1372,16 @@ static HRESULT WINAPI convert_GetConversionSize(IDataConvert* iface,
switch (src_type)
{
case DBTYPE_VARIANT:
if(V_VT((VARIANT*)src) == VT_BSTR)
*dst_len = (SysStringLen(V_BSTR((VARIANT*)src))+1) * sizeof(WCHAR);
else
WARN("DBTYPE_VARIANT(%d)->DBTYPE_WSTR unimplemented\n", V_VT((VARIANT*)src));
{
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);
}
}
break;
case DBTYPE_STR:
if(src_len)
......
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