Akihiro Sagawa : shell32: Skip buffer allocation when querying drop file numbers.
Module: wine Branch: master Commit: d2e9856a567bd1b83644993bf3b75c0a64cb2916 URL: http://source.winehq.org/git/wine.git/?a=commit;h=d2e9856a567bd1b83644993bf3... Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Tue Jun 2 01:22:08 2015 +0900 shell32: Skip buffer allocation when querying drop file numbers. --- 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 74c5965..637a101 100644 --- a/dlls/shell32/shellole.c +++ b/dlls/shell32/shellole.c @@ -578,7 +578,7 @@ UINT WINAPI DragQueryFileA( if(lpDropFileStruct->fWide) { LPWSTR lpszFileW = NULL; - if(lpszFile) { + if(lpszFile && lFile != 0xFFFFFFFF) { lpszFileW = HeapAlloc(GetProcessHeap(), 0, lLength*sizeof(WCHAR)); if(lpszFileW == NULL) { goto end; @@ -633,7 +633,7 @@ UINT WINAPI DragQueryFileW( if(lpDropFileStruct->fWide == FALSE) { LPSTR lpszFileA = NULL; - if(lpszwFile) { + if(lpszwFile && lFile != 0xFFFFFFFF) { lpszFileA = HeapAlloc(GetProcessHeap(), 0, lLength); if(lpszFileA == NULL) { goto end; diff --git a/dlls/shell32/tests/shellole.c b/dlls/shell32/tests/shellole.c index 308134a..71ba477 100644 --- a/dlls/shell32/tests/shellole.c +++ b/dlls/shell32/tests/shellole.c @@ -760,7 +760,7 @@ static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA num = DragQueryFileA(hDrop, 0xffffffff, NULL, 0); ok(num == 1, "expected 1, got %u\n", num); num = DragQueryFileA(hDrop, 0xffffffff, (char*)0xdeadbeef, 0xffffffff); - todo_wine ok(num == 1, "expected 1, got %u\n", num); + ok(num == 1, "expected 1, got %u\n", num); num = DragQueryFileA(hDrop, 0, filename, sizeof(filename)); ok(num == strlen(DROPTEST_FILENAME), "got %u\n", num); ok(!strcmp(filename, DROPTEST_FILENAME), "got %s\n", filename);
participants (1)
-
Alexandre Julliard