Module: wine Branch: master Commit: f88fecf80ffaad9e12c92326c3c9b72e5d6898b3 URL: https://gitlab.winehq.org/wine/wine/-/commit/f88fecf80ffaad9e12c92326c3c9b72...
Author: Akihiro Sagawa sagawa.aki@gmail.com Date: Sun Oct 30 16:28:48 2022 +0900
shell32: Returns a number of copied bytes in DropQueryFileA.
---
dlls/shell32/shellole.c | 4 ++-- dlls/shell32/tests/shellole.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/shell32/shellole.c b/dlls/shell32/shellole.c index 45ff2a5410c..29d973bf165 100644 --- a/dlls/shell32/shellole.c +++ b/dlls/shell32/shellole.c @@ -583,10 +583,10 @@ UINT WINAPI DragQueryFileA(HDROP hDrop, UINT lFile, LPSTR lpszFile, UINT lLength } filename = malloc(i); if (!filename) goto error; - WideCharToMultiByte(CP_ACP, 0, filenameW, -1, filename, i, NULL, NULL); + i = WideCharToMultiByte(CP_ACP, 0, filenameW, -1, filename, i, NULL, NULL);
- i = strlen(filename); lstrcpynA(lpszFile, filename, lLength); + i = min(i, lLength) - 1; end: free(filenameW); free(filename); diff --git a/dlls/shell32/tests/shellole.c b/dlls/shell32/tests/shellole.c index 6d9d348dc6e..4864d35ea9a 100644 --- a/dlls/shell32/tests/shellole.c +++ b/dlls/shell32/tests/shellole.c @@ -796,7 +796,7 @@ static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA
memset(filename, 0xaa, sizeof(filename)); num = DragQueryFileA(hDrop, 0, filename, 2); - todo_wine ok(num == 1, "expected 1, got %u\n", num); + ok(num == 1, "expected 1, got %u\n", num); ok(filename[0] == expected_filename[0], "expected '%c', got '%c'\n", expected_filename[0], filename[0]); ok(filename[1] == '\0', "expected nul, got %#x\n", (BYTE)filename[1]);