ole32: Implement reading of VT_CF storage properties.

This commit is contained in:
Mike McCormack 2006-06-20 03:31:01 +09:00 committed by Alexandre Julliard
parent e43cec76d1
commit 98d4c2b049
1 changed files with 25 additions and 0 deletions

View File

@ -82,6 +82,11 @@ static inline StorageImpl *impl_from_IPropertySetStorage( IPropertySetStorage *i
#define MAX_VERSION_0_PROP_NAME_LENGTH 256
#define CFTAG_WINDOWS (-1L)
#define CFTAG_MACINTOSH (-2L)
#define CFTAG_FMTID (-3L)
#define CFTAG_NODATA 0L
/* The format version (and what it implies) is described here:
* http://msdn.microsoft.com/library/en-us/stg/stg/format_version.asp
*/
@ -1138,6 +1143,26 @@ static HRESULT PropertyStorage_ReadProperty(PropertyStorage_impl *This,
StorageUtl_ReadULargeInteger(data, 0,
(ULARGE_INTEGER *)&prop->u.filetime);
break;
case VT_CF:
{
DWORD len = 0, type = 0, tag = 0;
StorageUtl_ReadDWord(data, 0, &len);
StorageUtl_ReadDWord(data, 4, &tag);
StorageUtl_ReadDWord(data, 8, &type);
if (tag == CFTAG_WINDOWS && len > 12)
{
prop->u.pclipdata = CoTaskMemAlloc(sizeof (CLIPDATA));
prop->u.pclipdata->cbSize = len;
prop->u.pclipdata->ulClipFmt = type;
prop->u.pclipdata->pClipData = CoTaskMemAlloc(len);
memcpy(prop->u.pclipdata->pClipData, data+12, len - 12);
TRACE("returning %p, len %ld\n", prop->u.pclipdata->pClipData, len - 12);
}
else
hr = STG_E_INVALIDPARAMETER;
}
break;
default:
FIXME("unsupported type %d\n", prop->vt);
hr = STG_E_INVALIDPARAMETER;