comctl32/listbox: Return 0 from LB_GETITEMDATA for LBS_NODATA listboxes.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gabriel Ivăncescu 2018-11-14 12:00:18 +02:00 committed by Alexandre Julliard
parent ebe99b92d4
commit 1b17d8c09a
2 changed files with 1 additions and 2 deletions

View File

@ -2630,7 +2630,7 @@ static LRESULT CALLBACK LISTBOX_WindowProc( HWND hwnd, UINT msg, WPARAM wParam,
SetLastError(ERROR_INVALID_INDEX);
return LB_ERR;
}
return descr->items[wParam].data;
return (descr->style & LBS_NODATA) ? 0 : descr->items[wParam].data;
case LB_SETITEMDATA:
if (((INT)wParam < 0) || ((INT)wParam >= descr->nb_items))

View File

@ -2305,7 +2305,6 @@ static void test_LBS_NODATA(void)
ok(!memcmp(&data, &zero_data, sizeof(data)), "Unexpected item data.\n");
ret = SendMessageA(listbox, LB_GETITEMDATA, valid_idx[i], 0);
todo_wine
ok(ret == 0, "Unexpected return value %d.\n", ret);
}