Hallo,

some application ( AvrStudio.exe version 3 from www.atmel.com) uses
many Commctrl features. Present CVS delivers somehow btnPtr->iString
== -1 and that makes wine crash either in 
        TRACE ("lpText: \"%s\"\n", debugstr_w(lpText));
or later in some of the 
            DrawTextW (hdc, lpText, -1, ...);
calls.


Question 1: Should debugstr_xx cope with invalid arguments

Question 2: What should be done with btnPtr->iString == -1?

This argument seems to have some special meaning in Comctl.

Is something like appended patch enough?

Bye

Uwe Bonnes                [EMAIL PROTECTED]

Free Software: If you contribute nothing, expect nothing
--


Index: wine/dlls/comctl32/toolbar.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/toolbar.c,v
retrieving revision 1.47
diff -u -r1.47 toolbar.c
--- wine/dlls/comctl32/toolbar.c        2000/06/04 01:46:27     1.47
+++ wine/dlls/comctl32/toolbar.c        2000/06/04 18:01:05
@@ -82,7 +82,7 @@
     TRACE ("iString: %lx\n", btnPtr->iString);
 
     /* get a pointer to the text */
-    if (HIWORD(btnPtr->iString) != 0)
+    if ((HIWORD(btnPtr->iString) != 0) && (btnPtr->iString!=-1))
        lpText = (LPWSTR)btnPtr->iString;
     else if ((btnPtr->iString >= 0) && (btnPtr->iString < infoPtr->nNumStrings))
        lpText = infoPtr->strings[btnPtr->iString];

Reply via email to