Commit 06d610ec authored by Adam Gundy's avatar Adam Gundy Committed by Alexandre Julliard

Check the mask flags in the item structure to determine how much

memory to read/write.
parent e2ae56e0
......@@ -4911,7 +4911,21 @@ static BOOL LISTVIEW_GetItemT(LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, BOOL i
dispInfo.item.stateMask = lpLVItem->stateMask & infoPtr->uCallbackMask;
notify_dispinfoT(infoPtr, LVN_GETDISPINFOW, &dispInfo, isW);
dispInfo.item.stateMask = lpLVItem->stateMask;
*lpLVItem = dispInfo.item;
if (lpLVItem->mask & (LVIF_GROUPID|LVIF_COLUMNS))
{
/* full size structure expected - _WIN32IE >= 0x560 */
*lpLVItem = dispInfo.item;
}
else if (lpLVItem->mask & LVIF_INDENT)
{
/* indent member expected - _WIN32IE >= 0x300 */
memcpy(lpLVItem, &dispInfo.item, offsetof( LVITEMW, iGroupId ));
}
else
{
/* minimal structure expected */
memcpy(lpLVItem, &dispInfo.item, offsetof( LVITEMW, iIndent ));
}
TRACE(" getdispinfo(1):lpLVItem=%s\n", debuglvitem_t(lpLVItem, isW));
}
......@@ -5910,9 +5924,23 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
nItem = DPA_InsertPtr( infoPtr->hdpaItems, nItem, hdpaSubItems );
if (nItem == -1) goto fail;
infoPtr->nItemCount++;
/* set the item attributes */
item = *lpLVItem;
/* set the item attributes */
if (lpLVItem->mask & (LVIF_GROUPID|LVIF_COLUMNS))
{
/* full size structure expected - _WIN32IE >= 0x560 */
item = *lpLVItem;
}
else if (lpLVItem->mask & LVIF_INDENT)
{
/* indent member expected - _WIN32IE >= 0x300 */
memcpy(&item, lpLVItem, offsetof( LVITEMW, iGroupId ));
}
else
{
/* minimal structure expected */
memcpy(&item, lpLVItem, offsetof( LVITEMW, iIndent ));
}
item.iItem = nItem;
item.state &= ~LVIS_STATEIMAGEMASK;
if (!set_main_item(infoPtr, &item, TRUE, isW, &has_changed)) goto undo;
......
......@@ -2716,6 +2716,8 @@ static const WCHAR WC_LISTVIEWW[] = { 'S','y','s',
#define LVIF_PARAM 0x0004
#define LVIF_STATE 0x0008
#define LVIF_INDENT 0x0010
#define LVIF_GROUPID 0x0100
#define LVIF_COLUMNS 0x0200
#define LVIF_NORECOMPUTE 0x0800
#define LVIF_DI_SETITEM 0x1000
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment