comctl32/listview: Hit test data pointer is never NULL when sending LVN_ITEMACTIVATE.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-05-16 22:03:55 +03:00 committed by Alexandre Julliard
parent a3a572beb0
commit 3febb46237
1 changed files with 23 additions and 24 deletions

View File

@ -844,31 +844,30 @@ static inline void notify_itemactivate(const LISTVIEW_INFO *infoPtr, const LVHIT
NMITEMACTIVATE nmia; NMITEMACTIVATE nmia;
LVITEMW item; LVITEMW item;
if (htInfo) { nmia.uNewState = 0;
nmia.uNewState = 0; nmia.uOldState = 0;
nmia.uOldState = 0; nmia.uChanged = 0;
nmia.uChanged = 0; nmia.uKeyFlags = 0;
nmia.uKeyFlags = 0;
item.mask = LVIF_PARAM|LVIF_STATE;
item.mask = LVIF_PARAM|LVIF_STATE; item.iItem = htInfo->iItem;
item.iItem = htInfo->iItem; item.iSubItem = 0;
item.iSubItem = 0; item.stateMask = (UINT)-1;
item.stateMask = (UINT)-1; if (LISTVIEW_GetItemT(infoPtr, &item, TRUE)) {
if (LISTVIEW_GetItemT(infoPtr, &item, TRUE)) { nmia.lParam = item.lParam;
nmia.lParam = item.lParam; nmia.uOldState = item.state;
nmia.uOldState = item.state; nmia.uNewState = item.state | LVIS_ACTIVATING;
nmia.uNewState = item.state | LVIS_ACTIVATING; nmia.uChanged = LVIF_STATE;
nmia.uChanged = LVIF_STATE;
}
nmia.iItem = htInfo->iItem;
nmia.iSubItem = htInfo->iSubItem;
nmia.ptAction = htInfo->pt;
if (GetKeyState(VK_SHIFT) & 0x8000) nmia.uKeyFlags |= LVKF_SHIFT;
if (GetKeyState(VK_CONTROL) & 0x8000) nmia.uKeyFlags |= LVKF_CONTROL;
if (GetKeyState(VK_MENU) & 0x8000) nmia.uKeyFlags |= LVKF_ALT;
} }
nmia.iItem = htInfo->iItem;
nmia.iSubItem = htInfo->iSubItem;
nmia.ptAction = htInfo->pt;
if (GetKeyState(VK_SHIFT) & 0x8000) nmia.uKeyFlags |= LVKF_SHIFT;
if (GetKeyState(VK_CONTROL) & 0x8000) nmia.uKeyFlags |= LVKF_CONTROL;
if (GetKeyState(VK_MENU) & 0x8000) nmia.uKeyFlags |= LVKF_ALT;
notify_hdr(infoPtr, LVN_ITEMACTIVATE, (LPNMHDR)&nmia); notify_hdr(infoPtr, LVN_ITEMACTIVATE, (LPNMHDR)&nmia);
} }