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:
Alistair Leslie-Hughes 2015-12-22 21:09:45 +11:00 committed by Alexandre Julliard
parent bb72548f38
commit 9c70026092
1 changed files with 10 additions and 4 deletions

View File

@ -1372,10 +1372,16 @@ static HRESULT WINAPI convert_GetConversionSize(IDataConvert* iface,
switch (src_type) switch (src_type)
{ {
case DBTYPE_VARIANT: case DBTYPE_VARIANT:
if(V_VT((VARIANT*)src) == VT_BSTR) {
*dst_len = (SysStringLen(V_BSTR((VARIANT*)src))+1) * sizeof(WCHAR); VARIANT v;
else
WARN("DBTYPE_VARIANT(%d)->DBTYPE_WSTR unimplemented\n", V_VT((VARIANT*)src)); 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; break;
case DBTYPE_STR: case DBTYPE_STR:
if(src_len) if(src_len)