Commit 585c3abb authored by Giuseppe Bilotta's avatar Giuseppe Bilotta Committed by Alexandre Julliard

comctl32/toolbar: When a null lParam is passed to TB_GETBUTTONTEXTA, we should…

comctl32/toolbar: When a null lParam is passed to TB_GETBUTTONTEXTA, we should not return -1 but the string size.
parent fcc9b57c
...@@ -3435,9 +3435,6 @@ TOOLBAR_GetButtonTextA (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -3435,9 +3435,6 @@ TOOLBAR_GetButtonTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
INT nIndex; INT nIndex;
LPWSTR lpText; LPWSTR lpText;
if (lParam == 0)
return -1;
nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, FALSE); nIndex = TOOLBAR_GetButtonIndex (infoPtr, (INT)wParam, FALSE);
if (nIndex == -1) if (nIndex == -1)
return -1; return -1;
...@@ -3445,7 +3442,7 @@ TOOLBAR_GetButtonTextA (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -3445,7 +3442,7 @@ TOOLBAR_GetButtonTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
lpText = TOOLBAR_GetText(infoPtr,&infoPtr->buttons[nIndex]); lpText = TOOLBAR_GetText(infoPtr,&infoPtr->buttons[nIndex]);
return WideCharToMultiByte( CP_ACP, 0, lpText, -1, return WideCharToMultiByte( CP_ACP, 0, lpText, -1,
(LPSTR)lParam, 0x7fffffff, NULL, NULL ) - 1; (LPSTR)lParam, lParam ? 0x7fffffff : 0, NULL, NULL ) - 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment