Commit d2e9856a authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

shell32: Skip buffer allocation when querying drop file numbers.

parent 37d7d6f8
...@@ -578,7 +578,7 @@ UINT WINAPI DragQueryFileA( ...@@ -578,7 +578,7 @@ UINT WINAPI DragQueryFileA(
if(lpDropFileStruct->fWide) { if(lpDropFileStruct->fWide) {
LPWSTR lpszFileW = NULL; LPWSTR lpszFileW = NULL;
if(lpszFile) { if(lpszFile && lFile != 0xFFFFFFFF) {
lpszFileW = HeapAlloc(GetProcessHeap(), 0, lLength*sizeof(WCHAR)); lpszFileW = HeapAlloc(GetProcessHeap(), 0, lLength*sizeof(WCHAR));
if(lpszFileW == NULL) { if(lpszFileW == NULL) {
goto end; goto end;
...@@ -633,7 +633,7 @@ UINT WINAPI DragQueryFileW( ...@@ -633,7 +633,7 @@ UINT WINAPI DragQueryFileW(
if(lpDropFileStruct->fWide == FALSE) { if(lpDropFileStruct->fWide == FALSE) {
LPSTR lpszFileA = NULL; LPSTR lpszFileA = NULL;
if(lpszwFile) { if(lpszwFile && lFile != 0xFFFFFFFF) {
lpszFileA = HeapAlloc(GetProcessHeap(), 0, lLength); lpszFileA = HeapAlloc(GetProcessHeap(), 0, lLength);
if(lpszFileA == NULL) { if(lpszFileA == NULL) {
goto end; goto end;
......
...@@ -760,7 +760,7 @@ static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA ...@@ -760,7 +760,7 @@ static LRESULT WINAPI drop_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA
num = DragQueryFileA(hDrop, 0xffffffff, NULL, 0); num = DragQueryFileA(hDrop, 0xffffffff, NULL, 0);
ok(num == 1, "expected 1, got %u\n", num); ok(num == 1, "expected 1, got %u\n", num);
num = DragQueryFileA(hDrop, 0xffffffff, (char*)0xdeadbeef, 0xffffffff); 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)); num = DragQueryFileA(hDrop, 0, filename, sizeof(filename));
ok(num == strlen(DROPTEST_FILENAME), "got %u\n", num); ok(num == strlen(DROPTEST_FILENAME), "got %u\n", num);
ok(!strcmp(filename, DROPTEST_FILENAME), "got %s\n", filename); ok(!strcmp(filename, DROPTEST_FILENAME), "got %s\n", filename);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment