=?UTF-8?Q?Gabriel=20Iv=C4=83ncescu=20?=: user32/listbox: Make SetCount fail if LBS_NODATA is not set.

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


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

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

user32/listbox: Make SetCount fail if LBS_NODATA is not set.

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 | 4 ----
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/dlls/user32/listbox.c b/dlls/user32/listbox.c
index 2fcd735..b5b7dc6 100644
--- a/dlls/user32/listbox.c
+++ b/dlls/user32/listbox.c
@@ -1757,7 +1757,7 @@ static LRESULT LISTBOX_SetCount( LB_DESCR *descr, INT count )
 {
     LRESULT ret;
 
-    if (HAS_STRINGS(descr))
+    if (!(descr->style & LBS_NODATA))
     {
         SetLastError(ERROR_SETCOUNT_ON_BAD_LB);
         return LB_ERR;
diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c
index 776e3f3..813968f 100644
--- a/dlls/user32/tests/listbox.c
+++ b/dlls/user32/tests/listbox.c
@@ -264,7 +264,6 @@ static LRESULT WINAPI main_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA
         }
         else
         {
-        todo_wine_if((style & LBS_NODATA) && strings[mi->itemID])
             ok((void*)mi->itemData == strings[mi->itemID],
                     "mi->itemData = %08lx, expected %p\n", mi->itemData, strings[mi->itemID]);
         }
@@ -1765,9 +1764,7 @@ static void test_set_count( void )
 
         SetLastError( 0xdeadbeef );
         ret = SendMessageA( listbox, LB_SETCOUNT, 100, 0 );
-    todo_wine_if(i == 0)
         ok( ret == LB_ERR, "expected %d, got %d\n", LB_ERR, ret );
-    todo_wine_if(i == 0)
         ok( GetLastError() == ERROR_SETCOUNT_ON_BAD_LB, "Unexpected error %d.\n", GetLastError() );
 
         DestroyWindow( listbox );
@@ -2137,7 +2134,6 @@ todo_wine
         style = GetWindowLongA(listbox, GWL_STYLE);
         ok((style & invalid_styles[i]) == invalid_styles[i], "%u: unexpected window styles %#x.\n", i, style);
         ret = SendMessageA(listbox, LB_SETCOUNT, 100, 0);
-    todo_wine_if(i == 1 || i == 4)
         ok(ret == LB_ERR, "%u: unexpected return value %d.\n", i, ret);
         DestroyWindow(listbox);
     }




More information about the wine-cvs mailing list