Re: shell32: Fix SHFileOperation when deleting a nonexistent directory.
19 May
2014
19 May
'14
8:57 a.m.
Zhenbo Li <litimetal(a)gmail.com> writes:
@@ -353,8 +353,13 @@ static BOOL SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pszDir, BOOL bShowUI) HANDLE hFind; WIN32_FIND_DATAW wfd; WCHAR szTemp[MAX_PATH]; + DWORD attrib;
/* Make sure the directory exists before eventually prompting the user */ + attrib = GetFileAttributesW(pszDir); + if (attrib == INVALID_FILE_ATTRIBUTES || !(attrib & FILE_ATTRIBUTE_DIRECTORY)) + return FALSE;
It would be better to avoid a redundant file lookup, particularly since it's only to set last error (which BTW you are not setting at all in the non-directory case). -- Alexandre Julliard julliard(a)winehq.org
4226
Age (days ago)
4226
Last active (days ago)
0 comments
1 participants
participants (1)
-
Alexandre Julliard