comctl32/toolbar: When a null lParam is passed to TB_GETBUTTONTEXTA, we should not return -1 but the string size.

This commit is contained in:
Giuseppe Bilotta 2009-05-07 11:13:16 +02:00 committed by Alexandre Julliard
parent fcc9b57c7a
commit 585c3abb6b

View file

@ -3435,9 +3435,6 @@ TOOLBAR_GetButtonTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
INT nIndex;
LPWSTR lpText;
if (lParam == 0)
return -1;
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, FALSE);
if (nIndex == -1)
return -1;
@ -3445,7 +3442,7 @@ TOOLBAR_GetButtonTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
lpText = TOOLBAR_GetText(infoPtr,&infoPtr->buttons[nIndex]);
return WideCharToMultiByte( CP_ACP, 0, lpText, -1,
(LPSTR)lParam, 0x7fffffff, NULL, NULL ) - 1;
(LPSTR)lParam, lParam ? 0x7fffffff : 0, NULL, NULL ) - 1;
}