[shell32.dll]

- Fix bug related to correct error code returning in delete_files. The value of 1026 was revealed to be returned by windows 2003 server. Score several passed winetests.
- Fix a bug in ShellLink::SetShowCmd and score one more passed winetest

svn path=/branches/shell32_new-bringup/; revision=53543
This commit is contained in:
Claudiu Mihail 2011-09-03 14:20:03 +00:00
parent 833aa3ffef
commit 8af812d602
2 changed files with 66 additions and 44 deletions

View file

@ -1153,7 +1153,7 @@ HRESULT WINAPI ShellLink::SetShowCmd(INT iShowCmd)
{
TRACE("(%p) %d\n",this, iShowCmd);
iShowCmd = iShowCmd;
this->iShowCmd = iShowCmd;
bDirty = TRUE;
return NOERROR;
@ -1215,7 +1215,8 @@ HRESULT WINAPI ShellLink::GetIconLocation(LPSTR pszIconPath,INT cchIconPath,INT
hr = pdsk->ParseDisplayName(0, NULL, sPath, NULL, &pidl, NULL);
if (SUCCEEDED(hr)) {
if (SUCCEEDED(hr))
{
hr = SHELL_PidlGeticonLocationA(pdsk, pidl, pszIconPath, cchIconPath, piIcon);
SHFree(pidl);
@ -1235,7 +1236,8 @@ HRESULT WINAPI ShellLink::SetIconLocation(LPCSTR pszIconPath,INT iIcon)
HeapFree(GetProcessHeap(), 0, sIcoPath);
sIcoPath = NULL;
if ( pszIconPath ) {
if ( pszIconPath )
{
sIcoPath = HEAP_strdupAtoW(GetProcessHeap(), 0, pszIconPath);
if ( !sIcoPath )
return E_OUTOFMEMORY;
@ -1254,7 +1256,8 @@ HRESULT WINAPI ShellLink::SetRelativePath(LPCSTR pszPathRel, DWORD dwReserved)
HeapFree(GetProcessHeap(), 0, sPathRel);
sPathRel = NULL;
if ( pszPathRel ) {
if ( pszPathRel )
{
sPathRel = HEAP_strdupAtoW(GetProcessHeap(), 0, pszPathRel);
bDirty = TRUE;
}
@ -1271,25 +1274,31 @@ HRESULT WINAPI ShellLink::Resolve(HWND hwnd, DWORD fFlags)
/*FIXME: use IResolveShellLink interface */
if (!sPath && pPidl) {
if (!sPath && pPidl)
{
WCHAR buffer[MAX_PATH];
bSuccess = SHGetPathFromIDListW(pPidl, buffer);
if (bSuccess && *buffer) {
if (bSuccess && *buffer)
{
sPath = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, (wcslen(buffer)+1)*sizeof(WCHAR));
if (!sPath)
return E_OUTOFMEMORY;
wcscpy(sPath, buffer);
bDirty = TRUE;
} else
}
else
hr = S_OK; /* don't report an error occurred while just caching information */
}
if (!sIcoPath && sPath) {
if (!sIcoPath && sPath)
{
sIcoPath = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, (wcslen(sPath)+1)*sizeof(WCHAR));
if (!sIcoPath)
return E_OUTOFMEMORY;
@ -1331,6 +1340,7 @@ HRESULT WINAPI ShellLink::GetPath(LPWSTR pszFile,INT cchMaxPath, WIN32_FIND_DATA
if (cchMaxPath)
pszFile[0] = 0;
if (sPath)
lstrcpynW( pszFile, sPath, cchMaxPath );

View file

@ -24,7 +24,6 @@
//#define NO_SHLWAPI_STREAM
#include <precomp.h>
WINE_DEFAULT_DEBUG_CHANNEL(shell);
#define IsAttrib(x, y) ((INVALID_FILE_ATTRIBUTES != (x)) && ((x) & (y)))
@ -1503,7 +1502,20 @@ static HRESULT delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom)
bPathExists = SHELL_DeleteDirectoryW(lpFileOp->hwnd, fileEntry->szFullPath, FALSE);
if (!bPathExists)
return ERROR_FILE_NOT_FOUND;
{
DWORD err = GetLastError();
if (ERROR_FILE_NOT_FOUND == err)
{
// This is a windows 2003 server specific value which ahs been removed.
// Later versions of windows return ERROR_FILE_NOT_FOUND.
return 1026;
}
else
{
return err;
}
}
}
return ERROR_SUCCESS;