[PATCH 0/1] MR9960: shell32: Create parent directories when creating trash directory.
It looks like since 82ad0ecd12 the parents of the trash directory get no longer automatically created before the test starts. The current `CreateDirectoryW` returns in GetLastError 3, ERROR_PATH_NOT_FOUND, as the parent directory does not exist. Locally I could reproduce it inside a test VM when the directory `$HOME/.local/share` did not exist. One solution may be to use this `SHCreateDirectoryExW`. This shows a few `fixme:shell:ISF_NetworkPlaces_fnParseDisplayName not implemented for`, don't know if this matters much. [Test pattern page](https://test.winehq.org/data/patterns.html#shell32:recyclebin) [Test run with this patch](https://testbot.winehq.org/JobDetails.pl?Key=161570) CC: @jactry -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9960
From: Bernhard Übelacker <bernhardu@mailbox.org> Followup of: 82ad0ecd12 --- dlls/shell32/recyclebin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/shell32/recyclebin.c b/dlls/shell32/recyclebin.c index fc1b53a7bc9..494088168f3 100644 --- a/dlls/shell32/recyclebin.c +++ b/dlls/shell32/recyclebin.c @@ -123,11 +123,11 @@ static BOOL WINAPI init_trash_dirs( INIT_ONCE *once, void *param, void **context lstrcpyW( info, files ); lstrcatW( files, L"\\files" ); lstrcatW( info, L"\\info" ); - if (!CreateDirectoryW( info, NULL ) && GetLastError() != ERROR_ALREADY_EXISTS) goto done; + if (!SHCreateDirectoryExW( NULL, info, NULL ) && GetLastError() != ERROR_ALREADY_EXISTS) goto done; trash_info_dir = info; } - if (!CreateDirectoryW( files, NULL ) && GetLastError() != ERROR_ALREADY_EXISTS) goto done; + if (!SHCreateDirectoryExW( NULL, files, NULL ) && GetLastError() != ERROR_ALREADY_EXISTS) goto done; trash_dir = files; random_seed = GetTickCount(); return TRUE; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9960
Thanks for catching this! -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9960#note_128222
This merge request was approved by Jactry Zeng. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9960
participants (3)
-
Bernhard Übelacker -
Bernhard Übelacker (@bernhardu) -
Jactry Zeng (@jactry)