oledb32: Add CanConvert support for DBTYPE_FILETIME.

This commit is contained in:
Huw Davies 2009-10-27 12:17:27 +00:00 committed by Alexandre Julliard
parent 021eaadea3
commit ed53dafcab
2 changed files with 29 additions and 16 deletions

View File

@ -452,6 +452,7 @@ static HRESULT WINAPI convert_CanConvert(IDataConvert* iface,
{
case DBTYPE_DATE:
case DBTYPE_GUID:
case DBTYPE_FILETIME:
return S_OK;
default:
if(dst_base_type == DBTYPE_DBTIMESTAMP) return S_OK;
@ -462,7 +463,8 @@ static HRESULT WINAPI convert_CanConvert(IDataConvert* iface,
switch(dst_base_type)
{
case DBTYPE_NULL:
case DBTYPE_VARIANT: return S_OK;
case DBTYPE_VARIANT:
case DBTYPE_FILETIME: return S_OK;
default: return S_FALSE;
}
@ -486,8 +488,12 @@ static HRESULT WINAPI convert_CanConvert(IDataConvert* iface,
case DBTYPE_I8:
if(common_class(dst_class)) return S_OK;
if(dst_base_type == DBTYPE_BYTES) return S_OK;
return S_FALSE;
switch(dst_base_type)
{
case DBTYPE_BYTES:
case DBTYPE_FILETIME: return S_OK;
default: return S_FALSE;
}
case DBTYPE_DATE:
switch(dst_class)
@ -502,6 +508,7 @@ static HRESULT WINAPI convert_CanConvert(IDataConvert* iface,
case DBTYPE_I8:
case DBTYPE_DATE:
case DBTYPE_DBDATE:
case DBTYPE_FILETIME:
return S_OK;
default: return S_FALSE;
}
@ -524,6 +531,7 @@ static HRESULT WINAPI convert_CanConvert(IDataConvert* iface,
case DBTYPE_GUID:
case DBTYPE_BYTES:
case DBTYPE_DBDATE:
case DBTYPE_FILETIME:
return S_OK;
default: return S_FALSE;
}
@ -567,6 +575,9 @@ static HRESULT WINAPI convert_CanConvert(IDataConvert* iface,
default: return S_FALSE;
}
case DBTYPE_FILETIME:
if(dst_class == DBTYPE_I8) return S_OK;
/* fall through */
case DBTYPE_DBDATE:
switch(dst_class)
{
@ -576,6 +587,7 @@ static HRESULT WINAPI convert_CanConvert(IDataConvert* iface,
case DBTYPE_BSTR:
case DBTYPE_VARIANT:
case DBTYPE_DBDATE:
case DBTYPE_FILETIME:
return S_OK;
default: return S_FALSE;
}

View File

@ -150,22 +150,22 @@ struct can_convert
DWORD can_convert_to;
} simple_convert[] =
{
{DBTYPE_EMPTY, 0x23bfd9ff},
{DBTYPE_NULL, 0x00001002},
{DBTYPE_EMPTY, 0x63bfd9ff},
{DBTYPE_NULL, 0x40001002},
{DBTYPE_I2, 0x3b9fd9ff},
{DBTYPE_I4, 0x3bdfd9ff},
{DBTYPE_R4, 0x3b9fd9ff},
{DBTYPE_R8, 0x3b9fd9ff},
{DBTYPE_CY, 0x039fd97f},
{DBTYPE_DATE, 0x399f99bf},
{DBTYPE_DATE, 0x799f99bf},
{DBTYPE_BSTR, 0x3bffd9ff},
{DBTYPE_IDISPATCH, 0x3bffffff},
{DBTYPE_BSTR, 0x7bffd9ff},
{DBTYPE_IDISPATCH, 0x7bffffff},
{DBTYPE_ERROR, 0x01001500},
{DBTYPE_BOOL, 0x039fd9ff},
{DBTYPE_VARIANT, 0x3bffffff},
{DBTYPE_VARIANT, 0x7bffffff},
{DBTYPE_IUNKNOWN, 0x00003203},
{DBTYPE_DECIMAL, 0x3b9fd97f},
{DBTYPE_I1, 0x3b9fd9ff},
@ -173,20 +173,21 @@ struct can_convert
{DBTYPE_UI1, 0x3b9fd9ff},
{DBTYPE_UI2, 0x3b9fd9ff},
{DBTYPE_UI4, 0x3bdfd9ff},
{DBTYPE_I8, 0x03dfd97f},
{DBTYPE_I8, 0x43dfd97f},
{DBTYPE_UI8, 0x03dfd97f},
{DBTYPE_UI8, 0x43dfd97f},
{DBTYPE_GUID, 0x01e01103},
{DBTYPE_BYTES, 0x01fc110b},
{DBTYPE_STR, 0x3bffd9ff},
{DBTYPE_STR, 0x7bffd9ff},
{DBTYPE_WSTR, 0x3bffd9ff},
{DBTYPE_WSTR, 0x7bffd9ff},
{DBTYPE_NUMERIC, 0x039fd97f},
{DBTYPE_UDT, 0x00000000},
{DBTYPE_DBDATE, 0x39801183},
{DBTYPE_DBDATE, 0x79801183},
{DBTYPE_DBTIME, 0x39801183},
{DBTYPE_DBTIMESTAMP, 0x39801183}
{DBTYPE_DBTIME, 0x79801183},
{DBTYPE_DBTIMESTAMP, 0x79801183},
{DBTYPE_FILETIME, 0x79981183}
};