[PATCH 06/11] user32/listbox: Make SetCount fail if LBS_NODATA is not set

Gabriel Ivăncescu gabrielopcode at gmail.com
Thu Nov 15 03:46:17 CST 2018


Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---
 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);
     }
-- 
2.19.1




More information about the wine-devel mailing list