[PATCH v2 0/1] MR9834: user32: Test DlgDirList in a temp directory.
DlgDirList can fail to enumerate files for the ListBox in some scenarios, e.g., when the current directory is a UNC mount provided by the WSL 2 9P server. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=2948wq -- v2: user32: Test DlgDirList in a temp directory. https://gitlab.winehq.org/wine/wine/-/merge_requests/9834
From: James Hawkins <truiken@gmail.com> DlgDirList can fail to enumerate files for the ListBox in some scenarios, e.g., when the current directory is a UNC mount provided by the WSL 2 9P server. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=2948 --- dlls/user32/tests/listbox.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index 0c5dde29410..4b0f047ce7c 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -1521,6 +1521,8 @@ static void test_listbox_dlgdir(void) int itemCount_justFiles; int itemCount_justDrives; int i; + char curdir[MAX_PATH]; + char path[MAX_PATH]; char pathBuffer[MAX_PATH]; char itemBuffer[MAX_PATH]; char tempBuffer[MAX_PATH]; @@ -1528,6 +1530,12 @@ static void test_listbox_dlgdir(void) char driveletter; HANDLE file; + GetCurrentDirectoryA(ARRAY_SIZE(curdir), curdir); + + GetTempPathA(ARRAY_SIZE(path), path); + res = SetCurrentDirectoryA(path); + ok(res, "Failed to set current directory.\n"); + file = CreateFileA( "wtest1.tmp.c", GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL ); ok(file != INVALID_HANDLE_VALUE, "Error creating the test file: %ld\n", GetLastError()); CloseHandle( file ); @@ -1950,6 +1958,7 @@ static void test_listbox_dlgdir(void) "GetLastError should return 0x589, got 0x%lX\n",GetLastError()); DestroyWindow(hWnd); + SetCurrentDirectoryA(curdir); } static void test_set_count( void ) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9834
participants (2)
-
James Hawkins -
James Hawkins (@truiken)