ole32: Allocate copied VT_CF data correctly in PropVariantCopy.

This commit is contained in:
Mike McCormack 2006-07-11 23:47:59 +09:00 committed by Alexandre Julliard
parent 5f5b90914d
commit 704dffcb09
1 changed files with 3 additions and 0 deletions

View File

@ -2699,6 +2699,9 @@ HRESULT WINAPI PropVariantCopy(PROPVARIANT *pvarDest, /* [out] */
if (pvarSrc->u.pclipdata) if (pvarSrc->u.pclipdata)
{ {
len = pvarSrc->u.pclipdata->cbSize - sizeof(pvarSrc->u.pclipdata->ulClipFmt); len = pvarSrc->u.pclipdata->cbSize - sizeof(pvarSrc->u.pclipdata->ulClipFmt);
pvarDest->u.pclipdata = CoTaskMemAlloc(sizeof (CLIPDATA));
pvarDest->u.pclipdata->cbSize = pvarSrc->u.pclipdata->cbSize;
pvarDest->u.pclipdata->ulClipFmt = pvarSrc->u.pclipdata->ulClipFmt;
pvarDest->u.pclipdata->pClipData = CoTaskMemAlloc(len); pvarDest->u.pclipdata->pClipData = CoTaskMemAlloc(len);
CopyMemory(pvarDest->u.pclipdata->pClipData, pvarSrc->u.pclipdata->pClipData, len); CopyMemory(pvarDest->u.pclipdata->pClipData, pvarSrc->u.pclipdata->pClipData, len);
} }