PATCH: Starbase StarTeam 4.2 crash fixed

Stefan Haller Stefan.Haller at ascom.ch
Wed Feb 26 08:12:27 CST 2003


Hi all

I got StarTeam 4.2 from Starbase (Borland nowadays) running with wine
snapshot 2003-02-19 with modifications mentioned below in this email.

Problem location: dlls/comctl32/listview.c

In function static inline COLUMN_INFO *
LISTVIEW_GetColumnInfo(LISTVIEW_INFO
*infoPtr, INT nSubItem)   (listview.c:1237) ... assert (nSubItem >= 0 &&
nSubItem < infoPtr->hdpaColumns->nItemCount); ... the assert statement
sometimes fails because sometimes nSubItem is -1 and  nItemCount is 0
(nSubItem is an index, nItemCount the number of elements).

Unfortunately this happens everytime you try to open a project in StarTeam.

So far, I found only one spot where LISTVIEW_GetColumnInfo is called with
wrong parameters: LISTVIEW_ScrollColumns: static void
LISTVIEW_ScrollColumns(LISTVIEW_INFO *infoPtr, INT nColumn,
INT dx) (listview.c:4006) ... lpColumnInfo =
LISTVIEW_GetColumnInfo(infoPtr, min(nColumn,
infoPtr->hdpaColumns->nItemCount - 1)); ...

The error happens because of the min thing in case nItemCount is 0 (no
columns...) and therfore decremented to -1. Maybe the Windows
implementation is more reclutant about this, though I have not windows to
test this on. I now return immediately from LISTVIEW_ScrollColumns if the
nColumn is < 0 or  nItemCount is < 1.

This little change made StarTeam 4.2 runnable on my Linux Box.

Attached you'll find a diff based on wine snapshot 2003-02-19.

Changelog:
    Stefan Haller <stefan.haller at ascom.ch>
    Ignoring requests to scroll non-existent columns
(LISTVIEW_ScrollColumns).


(See attached file: patch.diff)

Keep up the great work, folks!

Cheers
 Stefan

--
Stefan Haller
Software Development
Ascom Transport Revenue
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: application/octet-stream
Size: 574 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20030226/26b3eb4f/patch.obj


More information about the wine-patches mailing list