From bbee7ec7111208840860d4b390f89232face00ca Mon Sep 17 00:00:00 2001 From: Sander van Leeuwen Date: Wed, 29 May 2002 19:08:18 +0000 Subject: [PATCH] - Check for valid part nr in STATUSBAR_GetTextLength. - TRACE fix in STATUSBAR_SetTextT; SBT_OWNERDRAW pointer isn't always a string pointer. --- dlls/comctl32/status.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/comctl32/status.c b/dlls/comctl32/status.c index e9d3c7aa4c3..2df03ad8fbc 100644 --- a/dlls/comctl32/status.c +++ b/dlls/comctl32/status.c @@ -426,6 +426,10 @@ STATUSBAR_GetTextLength (STATUSWINDOWINFO *infoPtr, INT nPart) DWORD result; TRACE("part %d\n", nPart); + + /* MSDN says: "simple parts use index of 0", so this check is ok. */ + if (nPart < 0 || nPart >= infoPtr->numParts) return 0; + if (infoPtr->simple) part = &infoPtr->part0; else @@ -627,7 +631,10 @@ STATUSBAR_SetTextT (STATUSWINDOWINFO *infoPtr, INT nPart, WORD style, STATUSWINDOWPART *part=NULL; BOOL changed = FALSE; - TRACE("part %d, text %s\n", nPart, debugstr_t(text, isW)); + if (style & SBT_OWNERDRAW) { + TRACE("part %d, text %x\n",nPart,text); + } + else TRACE("part %d, text %s\n", nPart, debugstr_t(text, isW)); /* MSDN says: "If the parameter is set to SB_SIMPLEID (255), the status * window is assumed to be a simple window */