Here's a patch for dlls/comctl32/toolbar.c
It corrects a potential crash and removes the one pixel of garbage
that's appearing at the bottom of the toolbar.
--- /devel/corelwineVirgin/corelwine/dlls/comctl32/toolbar.c    Mon May 15 10:47:35 
2000
+++ toolbar.c   Thu Jun  1 16:03:39 2000
@@ -952,9 +952,9 @@
     if (!(infoPtr->himlDef)) {
        /* create new default image list */
        TRACE ("creating default image list!\n");
-       /* It seems that the image list created is 1 pixel taller than the bitmap 
height */
+
        infoPtr->himlDef =
-           ImageList_Create (infoPtr->nBitmapWidth, infoPtr->nBitmapHeight + 1,
+         ImageList_Create (infoPtr->nBitmapWidth, infoPtr->nBitmapHeight,// + 1,
                              ILC_COLOR | ILC_MASK, nButtons, 2);
        infoPtr->himlInt = infoPtr->himlDef;
     }
@@ -1687,13 +1688,16 @@
        lpTbInfo->fsState = btnPtr->fsState;
     if (lpTbInfo->dwMask & TBIF_STYLE)
        lpTbInfo->fsStyle = btnPtr->fsStyle;
-    if (lpTbInfo->dwMask & TBIF_TEXT) {
-       if ((btnPtr->iString >= 0) || (btnPtr->iString < infoPtr->nNumStrings))
-           lstrcpynWtoA (lpTbInfo->pszText,
+     if (lpTbInfo->dwMask & TBIF_TEXT) {
+       
+               /*make sure infoPtr->strings has been allocated before dereferencing 
+it! */
+               if ( infoPtr->strings && ((btnPtr->iString >= 0) || (btnPtr->iString < 
+infoPtr->nNumStrings)))
+               {       
+                       lstrcpynWtoA (lpTbInfo->pszText,
                          (LPWSTR)infoPtr->strings[btnPtr->iString],
                         lpTbInfo->cchText);
+               }
     }
-
     return nIndex;
 }

Reply via email to