ChangeSet ID: 19963 CVSROOT: /opt/cvs-commit Module name: wine Changes by: julliard@winehq.org 2005/09/03 04:37:15 Modified files: dlls/shell32/tests: shellpath.c Log message: Juan Lang Fix a test failing on Windows. Reported by Katerina Nizhnik. Patch: http://cvs.winehq.org/patch.py?id=19963 Old revision New revision Changes Path 1.11 1.12 +12 -4 wine/dlls/shell32/tests/shellpath.c Index: wine/dlls/shell32/tests/shellpath.c diff -u -p wine/dlls/shell32/tests/shellpath.c:1.11 wine/dlls/shell32/tests/shellpath.c:1.12 --- wine/dlls/shell32/tests/shellpath.c:1.11 Thu May 23 21:24:16 2013 +++ wine/dlls/shell32/tests/shellpath.c Thu May 23 21:24:16 2013 @@ -827,13 +827,13 @@ static void testNonExistentPath(void) modifiedPath[len++] = '\0'; if (winetest_interactive) printf("Changing CSIDL_FAVORITES to %s\n", modifiedPath); - if (!RegSetValueExA(key, "Favorites", 0, type, (LPBYTE) modifiedPath, len)) + if (!RegSetValueExA(key, "Favorites", 0, type, (LPBYTE)modifiedPath, len)) { char buffer[MAX_PATH]; STARTUPINFOA startup; PROCESS_INFORMATION info; HRESULT hr; - BOOL ret; + SHFILEOPSTRUCTA shFileOp; wnsprintfA(buffer, sizeof(buffer), "%s tests/shellpath.c 1", selfname); @@ -869,8 +869,16 @@ static void testNonExistentPath(void) ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "child process termination\n"); - ret = RemoveDirectoryA(modifiedPath); - ok( ret, "RemoveDirectoryA failed: %ld\n", GetLastError()); + /* Remove the directory. In some Windows versions, it + * contains the system file desktop.ini, so use SHFileOperation + * to remove it and its contents. + */ + shFileOp.hwnd = NULL; + shFileOp.wFunc = FO_DELETE; + shFileOp.pFrom = modifiedPath; + shFileOp.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI | + FOF_SILENT; + SHFileOperationA(&shFileOp); } } else if (winetest_interactive)