ChangeSet ID: 21190 CVSROOT: /opt/cvs-commit Module name: wine Changes by: julliard@winehq.org 2005/11/09 04:58:24
Modified files: dlls/msi : msi.c
Log message: Mike McCormack mike@codeweavers.com Make sure we only CoUninitialize after successfully initializing. Fix the address of the returned IShellLinkDataList interface.
Patch: http://cvs.winehq.org/patch.py?id=21190
Old revision New revision Changes Path 1.114 1.115 +5 -6 wine/dlls/msi/msi.c
Index: wine/dlls/msi/msi.c diff -u -p wine/dlls/msi/msi.c:1.114 wine/dlls/msi/msi.c:1.115 --- wine/dlls/msi/msi.c:1.114 9 Nov 2005 10:58:24 -0000 +++ wine/dlls/msi/msi.c 9 Nov 2005 10:58:24 -0000 @@ -1818,14 +1818,12 @@ UINT WINAPI MsiGetShortcutTargetW( LPCWS IShellLinkDataList *dl = NULL; IPersistFile *pf = NULL; LPEXP_DARWIN_LINK darwin = NULL; - HRESULT r; + HRESULT r, init;
TRACE("%s %p %p %p\n", debugstr_w(szShortcutTarget), szProductCode, szFeatureId, szComponentCode );
- r = CoInitialize(NULL); - if( FAILED( r ) ) - return ERROR_FUNCTION_FAILED; + init = CoInitialize(NULL);
r = CoCreateInstance( &CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, &IID_IPersistFile, (LPVOID*) &pf ); @@ -1836,7 +1834,7 @@ UINT WINAPI MsiGetShortcutTargetW( LPCWS if( SUCCEEDED( r ) ) { r = IPersistFile_QueryInterface( pf, &IID_IShellLinkDataList, - (LPVOID*) dl ); + (LPVOID*) &dl ); if( SUCCEEDED( r ) ) { IShellLinkDataList_CopyDataBlock( dl, EXP_DARWIN_ID_SIG, @@ -1847,7 +1845,8 @@ UINT WINAPI MsiGetShortcutTargetW( LPCWS IPersistFile_Release( pf ); }
- CoUninitialize(); + if (SUCCEEDED(init)) + CoUninitialize();
TRACE("darwin = %p\n", darwin);