=?UTF-8?Q?Gabriel=20Iv=C4=83ncescu=20?=: comctl32/listbox: Always retrieve zeros in LB_GETTEXT for LBS_NODATA listboxes.

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


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

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

comctl32/listbox: Always retrieve zeros in LB_GETTEXT 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       | 3 ++-
 dlls/comctl32/tests/listbox.c | 1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c
index 76b09aa..aa42c3a 100644
--- a/dlls/comctl32/listbox.c
+++ b/dlls/comctl32/listbox.c
@@ -762,7 +762,8 @@ static LRESULT LISTBOX_GetText( LB_DESCR *descr, INT index, LPWSTR buffer, BOOL
     } else
     {
         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);
     }
     return len;
diff --git a/dlls/comctl32/tests/listbox.c b/dlls/comctl32/tests/listbox.c
index 802dd98..8620ca3 100644
--- a/dlls/comctl32/tests/listbox.c
+++ b/dlls/comctl32/tests/listbox.c
@@ -2302,7 +2302,6 @@ static void test_LBS_NODATA(void)
         memset(&data, 0xee, sizeof(data));
         ret = SendMessageA(listbox, LB_GETTEXT, valid_idx[i], (LPARAM)&data);
         ok(ret == sizeof(data), "Unexpected return value %d.\n", ret);
-    todo_wine
         ok(!memcmp(&data, &zero_data, sizeof(data)), "Unexpected item data.\n");
 
         ret = SendMessageA(listbox, LB_GETITEMDATA, valid_idx[i], 0);




More information about the wine-cvs mailing list