[PATCH v5 4/5] comctl32/listbox: Don't set any data for LBS_NODATA listboxes
Gabriel Ivăncescu
gabrielopcode at gmail.com
Wed Nov 14 04:00:19 CST 2018
Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---
dlls/comctl32/listbox.c | 2 +-
dlls/comctl32/tests/listbox.c | 3 ---
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c
index 03afc5e..479f6a6 100644
--- a/dlls/comctl32/listbox.c
+++ b/dlls/comctl32/listbox.c
@@ -2638,7 +2638,7 @@ static LRESULT CALLBACK LISTBOX_WindowProc( HWND hwnd, UINT msg, WPARAM wParam,
SetLastError(ERROR_INVALID_INDEX);
return LB_ERR;
}
- descr->items[wParam].data = lParam;
+ if (!(descr->style & LBS_NODATA)) descr->items[wParam].data = lParam;
/* undocumented: returns TRUE, not LB_OKAY (0) */
return TRUE;
diff --git a/dlls/comctl32/tests/listbox.c b/dlls/comctl32/tests/listbox.c
index e507688..271cbca 100644
--- a/dlls/comctl32/tests/listbox.c
+++ b/dlls/comctl32/tests/listbox.c
@@ -2310,13 +2310,10 @@ static void test_LBS_NODATA(void)
/* More messages that don't work with LBS_NODATA. */
ret = SendMessageA(listbox, LB_FINDSTRING, 1, 42);
-todo_wine
ok(ret == LB_ERR, "Unexpected return value %d.\n", ret);
ret = SendMessageA(listbox, LB_FINDSTRINGEXACT, 1, 42);
-todo_wine
ok(ret == LB_ERR, "Unexpected return value %d.\n", ret);
ret = SendMessageA(listbox, LB_SELECTSTRING, 1, 42);
-todo_wine
ok(ret == LB_ERR, "Unexpected return value %d.\n", ret);
DestroyWindow(listbox);
--
2.19.1
More information about the wine-devel
mailing list