[2/4] comctl32/listview: Handle NULL lParam in LVM_SETITEMSTATE
Nikolay Sivov
bunglehead at gmail.com
Thu Jul 23 14:56:17 CDT 2009
Changelog:
- Handle NULL lParam in LVM_SETITEMSTATE
>From 26f71f7c8bade386bdfc902c91cee3490e74eb83 Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <bunglehead at gmail.com>
Date: Thu, 23 Jul 2009 23:46:22 +0400
Subject: Handle NULL lParam in LVM_SETITEMSTATE
---
dlls/comctl32/listview.c | 1 +
dlls/comctl32/tests/listview.c | 4 ++++
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 73781b2..05c033e 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -10653,6 +10653,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return LISTVIEW_SetItemPosition(infoPtr, (INT)wParam, *((POINT*)lParam));
case LVM_SETITEMSTATE:
+ if (lParam == 0) return FALSE;
return LISTVIEW_SetItemState(infoPtr, (INT)wParam, (LPLVITEMW)lParam);
case LVM_SETITEMTEXTA:
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 9e92202..bf87bca 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -1963,6 +1963,10 @@ static void test_multiselect(void)
item_count = (int)SendMessage(hwnd, LVM_GETITEMCOUNT, 0, 0);
expect(items,item_count);
+ /* try with NULL pointer */
+ r = SendMessageA(hwnd, LVM_SETITEMSTATE, 0, (LPARAM)NULL);
+ expect(FALSE, r);
+
/* select all, check notifications */
ListView_SetItemState(hwnd, -1, 0, LVIS_SELECTED);
--
1.5.6.5
More information about the wine-patches
mailing list