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: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
bb72548f38
commit
9c70026092
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue