comctl32/listbox: Always retrieve zeros in LB_GETTEXT 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:17 +02:00 committed by Alexandre Julliard
parent ac174f4cf4
commit ebe99b92d4
2 changed files with 2 additions and 2 deletions

View File

@ -762,7 +762,8 @@ static LRESULT LISTBOX_GetText( LB_DESCR *descr, INT index, LPWSTR buffer, BOOL
} else } else
{ {
if (buffer) if (buffer)
*((ULONG_PTR *)buffer) = descr->items[index].data; *((ULONG_PTR *)buffer) = (descr->style & LBS_NODATA)
? 0 : descr->items[index].data;
len = sizeof(ULONG_PTR); len = sizeof(ULONG_PTR);
} }
return len; return len;

View File

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