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

oledb32: Support VT_NULL on all conversions.

parent 39d2ce59
...@@ -183,6 +183,15 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface, ...@@ -183,6 +183,15 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
return S_OK; return S_OK;
} }
if(src_type == DBTYPE_VARIANT && V_VT((VARIANT*)src) == VT_NULL)
{
if(dst_type == DBTYPE_VARIANT)
*dst_len = sizeof(VARIANT);
*dst_status = DBSTATUS_S_ISNULL;
return S_OK;
}
if(IDataConvert_CanConvert(iface, src_type, dst_type) != S_OK) if(IDataConvert_CanConvert(iface, src_type, dst_type) != S_OK)
{ {
return DB_E_UNSUPPORTEDCONVERSION; return DB_E_UNSUPPORTEDCONVERSION;
...@@ -631,18 +640,9 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface, ...@@ -631,18 +640,9 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
} }
break; break;
case DBTYPE_VARIANT: case DBTYPE_VARIANT:
if(V_VT((VARIANT*)src) == VT_NULL)
{
*dst_status = DBSTATUS_S_ISNULL;
*dst_len = get_length(DBTYPE_BSTR);
return S_OK;
}
else
{
VariantInit(&tmp); VariantInit(&tmp);
if ((hr = VariantChangeType(&tmp, (VARIANT*)src, 0, VT_BSTR)) == S_OK) if ((hr = VariantChangeType(&tmp, (VARIANT*)src, 0, VT_BSTR)) == S_OK)
*d = V_BSTR(&tmp); *d = V_BSTR(&tmp);
}
break; break;
default: FIXME("Unimplemented conversion %04x -> BSTR\n", src_type); return E_NOTIMPL; default: FIXME("Unimplemented conversion %04x -> BSTR\n", src_type); return E_NOTIMPL;
} }
...@@ -1000,14 +1000,6 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface, ...@@ -1000,14 +1000,6 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
return S_OK; return S_OK;
case DBTYPE_VARIANT: case DBTYPE_VARIANT:
{ {
if(V_VT((VARIANT*)src) == VT_NULL)
{
*dst_status = DBSTATUS_S_ISNULL;
*dst_len = 0;
return S_OK;
}
else
{
switch(V_VT((VARIANT*)src)) switch(V_VT((VARIANT*)src))
{ {
case VT_UI1 | VT_ARRAY: case VT_UI1 | VT_ARRAY:
...@@ -1039,7 +1031,6 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface, ...@@ -1039,7 +1031,6 @@ static HRESULT WINAPI convert_DataConvert(IDataConvert* iface,
return E_NOTIMPL; return E_NOTIMPL;
} }
} }
}
break; break;
default: FIXME("Unimplemented conversion %04x -> DBTYPE_BYTES\n", src_type); return E_NOTIMPL; default: FIXME("Unimplemented conversion %04x -> DBTYPE_BYTES\n", src_type); return E_NOTIMPL;
} }
......
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