comctl32/treeview: Fix possible crash in TVS_SINGELEXPAND helper (Coverity).
This commit is contained in:
parent
c678bdd718
commit
279677b7d8
|
@ -1255,6 +1255,13 @@ static void test_TVS_SINGLEEXPAND(void)
|
|||
ok(ret, "got %d\n", ret);
|
||||
ok_sequence(sequences, PARENT_SEQ_INDEX, parent_singleexpand_seq, "singleexpand notifications", FALSE);
|
||||
|
||||
/* a workaround for NT4 that sends expanding notification when nothing is about to expand */
|
||||
ret = SendMessageA(hTree, TVM_DELETEITEM, 0, (LPARAM)hRoot);
|
||||
ok(ret, "got %d\n", ret);
|
||||
fill_tree(hTree);
|
||||
ret = SendMessageA(hTree, TVM_SELECTITEM, TVGN_CARET, 0);
|
||||
ok(ret, "got %d\n", ret);
|
||||
|
||||
DestroyWindow(hTree);
|
||||
}
|
||||
|
||||
|
|
|
@ -3426,7 +3426,7 @@ static void TREEVIEW_SingleExpand(TREEVIEW_INFO *infoPtr,
|
|||
{
|
||||
TREEVIEW_ITEM *SelItem;
|
||||
|
||||
if ((infoPtr->dwStyle & TVS_SINGLEEXPAND) == 0 || infoPtr->hwndEdit) return;
|
||||
if ((infoPtr->dwStyle & TVS_SINGLEEXPAND) == 0 || infoPtr->hwndEdit || !item) return;
|
||||
|
||||
TREEVIEW_SendTreeviewNotify(infoPtr, TVN_SINGLEEXPAND, TVC_UNKNOWN, TVIF_HANDLE | TVIF_PARAM, item, 0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue