From: Timo Kreuzer Date: Fri, 17 Sep 2010 19:00:12 +0000 (+0000) Subject: [SHELL32] X-Git-Tag: ReactOS-0.3.12~27 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=2cc0f42e454d6478d91c698d24284d767f53ce83;hp=c8d65c59a4e2cbd4dc6a03343220d83a7fbcb821 [SHELL32] Johannes Anderwald: - Partly revert 48786 - Use existing sLinkPath instead of own grown sCurFile - Fixes 6 more winetest failures, 4 to go for shellink test svn path=/trunk/; revision=48792 --- diff --git a/reactos/dll/win32/shell32/shelllink.c b/reactos/dll/win32/shell32/shelllink.c index 53441ba39a0..fb60fab4316 100644 --- a/reactos/dll/win32/shell32/shelllink.c +++ b/reactos/dll/win32/shell32/shelllink.c @@ -443,14 +443,14 @@ static HRESULT WINAPI IPersistFile_fnSave(IPersistFile* iface, LPCOLESTR pszFile if( SUCCEEDED( r ) ) { - if ( This->sCurFile ) + if ( This->sLinkPath ) { - HeapFree(GetProcessHeap(), 0, This->sCurFile); + HeapFree(GetProcessHeap(), 0, This->sLinkPath); } - This->sCurFile = HeapAlloc(GetProcessHeap(), 0, (wcslen(pszFileName)+1) * sizeof(WCHAR)); - if ( This->sCurFile ) + This->sLinkPath = HeapAlloc(GetProcessHeap(), 0, (wcslen(pszFileName)+1) * sizeof(WCHAR)); + if ( This->sLinkPath ) { - wcscpy(This->sCurFile, pszFileName); + wcscpy(This->sLinkPath, pszFileName); } StartLinkProcessor( pszFileName ); @@ -480,13 +480,13 @@ static HRESULT WINAPI IPersistFile_fnGetCurFile(IPersistFile* iface, LPOLESTR *p *ppszFileName = NULL; - if ( !This->sCurFile) + if ( !This->sLinkPath) { /* IPersistFile::GetCurFile called before IPersistFile::Save */ return S_FALSE; } - *ppszFileName = CoTaskMemAlloc((wcslen(This->sCurFile)+1) * sizeof(WCHAR)); + *ppszFileName = CoTaskMemAlloc((wcslen(This->sLinkPath)+1) * sizeof(WCHAR)); if (!*ppszFileName) { /* out of memory */ @@ -494,7 +494,7 @@ static HRESULT WINAPI IPersistFile_fnGetCurFile(IPersistFile* iface, LPOLESTR *p } /* copy last saved filename */ - wcscpy(*ppszFileName, This->sCurFile); + wcscpy(*ppszFileName, This->sLinkPath); return NOERROR; }