Fixed crash of WinZip 8.0 due to invalid image list handle.
diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c
index 2b0e02f..fd04115 100644
--- a/dlls/comctl32/header.c
+++ b/dlls/comctl32/header.c
@@ -144,6 +144,8 @@
RECT r;
INT oldBkMode;
+ TRACE("DrawItem(iItem %d bHotTrack %d)\n", iItem, bHotTrack);
+
if (!infoPtr->bRectsValid)
HEADER_SetItemBounds(hwnd);
@@ -275,7 +277,7 @@
DeleteDC (hdcBitmap);
}
- if (phdi->fmt & HDF_IMAGE) {
+ if ((phdi->fmt & HDF_IMAGE) && (infoPtr->himl)) {
r.left +=3;
/* FIXME: (r.bottom- (infoPtr->himl->cy))/2 should horicontal center the image
It looks like it doesn't work as expected*/
@@ -1025,13 +1027,14 @@
static LRESULT
-HEADER_SetImageList (HWND hwnd, WPARAM wParam, LPARAM lParam)
+HEADER_SetImageList (HWND hwnd, HIMAGELIST himl)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HIMAGELIST himlOld;
+ TRACE("(himl 0x%x)\n", (int)himl);
himlOld = infoPtr->himl;
- infoPtr->himl = (HIMAGELIST)lParam;
+ infoPtr->himl = himl;
/* FIXME: Refresh needed??? */
@@ -1395,7 +1398,9 @@
HEADER_DrawTrackLine (hwnd, hdc, infoPtr->xOldTrack);
ReleaseDC (hwnd, hdc);
if (HEADER_SendHeaderNotify(hwnd, HDN_ITEMCHANGINGA, infoPtr->iMoveItem, HDI_WIDTH))
+ {
infoPtr->items[infoPtr->iMoveItem].cxy = infoPtr->nOldWidth;
+ }
else {
nWidth = pt.x - infoPtr->items[infoPtr->iMoveItem].rect.left + infoPtr->xTrackOffset;
if (nWidth < 0)
@@ -1667,7 +1672,7 @@
/* case HDM_SETHOTDIVIDER: */
case HDM_SETIMAGELIST:
- return HEADER_SetImageList (hwnd, wParam, lParam);
+ return HEADER_SetImageList (hwnd, (HIMAGELIST)lParam);
case HDM_SETITEMA:
return HEADER_SetItemA (hwnd, wParam, lParam);