Commit 454fa4be authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Make sure we only CoUninitialize after successfully initializing.

Fix the address of the returned IShellLinkDataList interface.
parent bf5155b6
......@@ -1818,14 +1818,12 @@ UINT WINAPI MsiGetShortcutTargetW( LPCWSTR szShortcutTarget,
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( LPCWSTR szShortcutTarget,
if( SUCCEEDED( r ) )
{
r = IPersistFile_QueryInterface( pf, &IID_IShellLinkDataList,
(LPVOID*) dl );
(LPVOID*) &dl );
if( SUCCEEDED( r ) )
{
IShellLinkDataList_CopyDataBlock( dl, EXP_DARWIN_ID_SIG,
......@@ -1847,6 +1845,7 @@ UINT WINAPI MsiGetShortcutTargetW( LPCWSTR szShortcutTarget,
IPersistFile_Release( pf );
}
if (SUCCEEDED(init))
CoUninitialize();
TRACE("darwin = %p\n", darwin);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment