=?UTF-8?Q?Gabriel=20Iv=C4=83ncescu=20?=: user32/listbox: Don' t set any data for LBS_NODATA listboxes.

Alexandre Julliard julliard at winehq.org
Fri Nov 16 14:38:19 CST 2018


Module: wine
Branch: master
Commit: d30aadd3e12aefc46ffa88e70711e643cee41aff
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=d30aadd3e12aefc46ffa88e70711e643cee41aff

Author: Gabriel Iv─âncescu <gabrielopcode at gmail.com>
Date:   Thu Nov 15 11:46:21 2018 +0200

user32/listbox: Don't set any data for LBS_NODATA listboxes.

Signed-off-by: Gabriel Iv─âncescu <gabrielopcode at gmail.com>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user32/listbox.c       | 2 +-
 dlls/user32/tests/listbox.c | 3 ---
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c
index d46f685..7fc724c 100644
--- a/dlls/user32/listbox.c
+++ b/dlls/user32/listbox.c
@@ -2692,7 +2692,7 @@ LRESULT ListBoxWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
             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/user32/tests/listbox.c b/dlls/user32/tests/listbox.c
index 2115ee4..d0eb731 100644
--- a/dlls/user32/tests/listbox.c
+++ b/dlls/user32/tests/listbox.c
@@ -2104,13 +2104,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);




More information about the wine-cvs mailing list