Module: wine Branch: master Commit: f83d24d4f7eb19df21d60458a48243dd6b5c44d5 URL: http://source.winehq.org/git/wine.git/?a=commit;h=f83d24d4f7eb19df21d60458a4...
Author: Piotr Caban piotr@codeweavers.com Date: Mon Apr 7 18:55:31 2014 +0200
ole32: Don't write empty CLIPFORMAT in WriteFmtUserTypeStg.
---
dlls/ole32/storage32.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index b859ad1..a6d30ab 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -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);