ole32: Don't write empty CLIPFORMAT in WriteFmtUserTypeStg.

This commit is contained in:
Piotr Caban 2014-04-07 18:55:31 +02:00 committed by Alexandre Julliard
parent 306e98425b
commit f83d24d4f7
1 changed files with 8 additions and 4 deletions

View File

@ -8769,8 +8769,12 @@ HRESULT WINAPI WriteFmtUserTypeStg(
TRACE("(%p,%x,%s)\n",pstg,cf,debugstr_w(lpszUserType));
/* get the clipboard format name */
n = GetClipboardFormatNameW( cf, szwClipName, sizeof(szwClipName)/sizeof(szwClipName[0]) );
szwClipName[n]=0;
if( cf )
{
n = GetClipboardFormatNameW( cf, szwClipName,
sizeof(szwClipName)/sizeof(szwClipName[0]) );
szwClipName[n]=0;
}
TRACE("Clipboard name is %s\n", debugstr_w(szwClipName));
@ -8784,8 +8788,8 @@ HRESULT WINAPI WriteFmtUserTypeStg(
TRACE("progid is %s\n",debugstr_w(wstrProgID));
r = STORAGE_WriteCompObj( pstg, &clsid,
lpszUserType, szwClipName, wstrProgID );
r = STORAGE_WriteCompObj( pstg, &clsid, lpszUserType,
cf ? szwClipName : NULL, wstrProgID );
CoTaskMemFree(wstrProgID);