diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 2a57aeac888..ddc5074dc7a 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -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; diff --git a/include/commctrl.h b/include/commctrl.h index f5d29f2b863..e6ea70737b4 100644 --- a/include/commctrl.h +++ b/include/commctrl.h @@ -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