diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c index 4ef7803..0eab9af 100644 --- a/dlls/shell32/shlfileop.c +++ b/dlls/shell32/shlfileop.c @@ -354,8 +354,10 @@ static BOOL SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pszDir, BOOL bShowUI) /* Make sure the directory exists before eventually prompting the user */ PathCombineW(szTemp, pszDir, wWildcardFile); hFind = FindFirstFileW(szTemp, &wfd); - if (hFind == INVALID_HANDLE_VALUE) + if (hFind == INVALID_HANDLE_VALUE){ + SetLastError(ERROR_FILE_NOT_FOUND); return FALSE; + } if (!bShowUI || (ret = SHELL_ConfirmDialogW(hwnd, ASK_DELETE_FOLDER, pszDir, NULL))) { @@ -1380,7 +1382,7 @@ static DWORD delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom) bPathExists = SHELL_DeleteDirectoryW(lpFileOp->hwnd, fileEntry->szFullPath, FALSE); if (!bPathExists) - return ERROR_PATH_NOT_FOUND; + return GetLastError(); } return ERROR_SUCCESS; diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c index 14ace24..f161d01 100644 --- a/dlls/shell32/tests/shlfileop.c +++ b/dlls/shell32/tests/shlfileop.c @@ -622,7 +622,6 @@ static void test_delete(void) shfo.pFrom = "nonexistent.txt\0"; shfo.wFunc = FO_DELETE; ret = SHFileOperationA(&shfo); - todo_wine ok(ret == 1026 || ret == ERROR_FILE_NOT_FOUND || /* Vista */ broken(ret == ERROR_SUCCESS), /* NT4 */ @@ -651,7 +650,6 @@ static void test_delete(void) shfo.pFrom = "test1.txt\0nonexistent.txt\0test2.txt\0"; shfo.wFunc = FO_DELETE; ret = SHFileOperationA(&shfo); - todo_wine ok(ret == 1026 || ret == ERROR_FILE_NOT_FOUND || /* Vista */ broken(ret == ERROR_SUCCESS), /* NT4 */ @@ -664,7 +662,6 @@ static void test_delete(void) init_shfo_tests(); shfo.pFrom = "testdir2\\nonexistent.txt\0"; ret = SHFileOperationA(&shfo); - todo_wine ok(ret == ERROR_FILE_NOT_FOUND || /* Vista */ broken(ret == 0x402) || /* XP */ broken(ret == ERROR_SUCCESS), /* NT4 */