=?UTF-8?Q?Gabriel=20Iv=C4=83ncescu=20?=: comctl32/listbox: Return 0 from LB_GETITEMDATA for LBS_NODATA listboxes.

Alexandre Julliard julliard at winehq.org
Wed Nov 14 16:18:59 CST 2018


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

Author: Gabriel Iv─âncescu <gabrielopcode at gmail.com>
Date:   Wed Nov 14 12:00:18 2018 +0200

comctl32/listbox: Return 0 from LB_GETITEMDATA 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/comctl32/listbox.c       | 2 +-
 dlls/comctl32/tests/listbox.c | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c
index aa42c3a..03afc5e 100644
--- a/dlls/comctl32/listbox.c
+++ b/dlls/comctl32/listbox.c
@@ -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))
diff --git a/dlls/comctl32/tests/listbox.c b/dlls/comctl32/tests/listbox.c
index 8620ca3..e507688 100644
--- a/dlls/comctl32/tests/listbox.c
+++ b/dlls/comctl32/tests/listbox.c
@@ -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);
     }
 




More information about the wine-cvs mailing list