mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:54:13 +00:00
In STATUSBAR_GetTipText{a,W, always put a terminating '\0' in the
buffer. Pass a buffer of sufficient size to TTM_GETTEXTA.
This commit is contained in:
parent
ba3c18df69
commit
72828e0080
1 changed files with 26 additions and 17 deletions
|
@ -457,18 +457,22 @@ static LRESULT
|
|||
STATUSBAR_GetTipTextA (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
|
||||
LPSTR tip = (LPSTR)lParam;
|
||||
|
||||
if (infoPtr->hwndToolTip) {
|
||||
TTTOOLINFOA ti;
|
||||
ti.cbSize = sizeof(TTTOOLINFOA);
|
||||
ti.hwnd = hwnd;
|
||||
ti.uId = LOWORD(wParam);
|
||||
SendMessageA (infoPtr->hwndToolTip, TTM_GETTEXTA, 0, (LPARAM)&ti);
|
||||
if (tip) {
|
||||
CHAR buf[INFOTIPSIZE];
|
||||
buf[0]='\0';
|
||||
|
||||
if (ti.lpszText)
|
||||
lstrcpynA ((LPSTR)lParam, ti.lpszText, HIWORD(wParam));
|
||||
if (infoPtr->hwndToolTip) {
|
||||
TTTOOLINFOA ti;
|
||||
ti.cbSize = sizeof(TTTOOLINFOA);
|
||||
ti.hwnd = hwnd;
|
||||
ti.uId = LOWORD(wParam);
|
||||
ti.lpszText = buf;
|
||||
SendMessageA(infoPtr->hwndToolTip, TTM_GETTEXTA, 0, (LPARAM)&ti);
|
||||
}
|
||||
lstrcpynA(tip, buf, HIWORD(wParam));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -477,16 +481,21 @@ static LRESULT
|
|||
STATUSBAR_GetTipTextW (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
STATUSWINDOWINFO *infoPtr = STATUSBAR_GetInfoPtr (hwnd);
|
||||
LPWSTR tip = (LPWSTR)lParam;
|
||||
|
||||
if (infoPtr->hwndToolTip) {
|
||||
TTTOOLINFOW ti;
|
||||
ti.cbSize = sizeof(TTTOOLINFOW);
|
||||
ti.hwnd = hwnd;
|
||||
ti.uId = LOWORD(wParam);
|
||||
SendMessageW (infoPtr->hwndToolTip, TTM_GETTEXTW, 0, (LPARAM)&ti);
|
||||
if (tip) {
|
||||
WCHAR buf[INFOTIPSIZE];
|
||||
buf[0]=0;
|
||||
|
||||
if (ti.lpszText)
|
||||
lstrcpynW ((LPWSTR)lParam, ti.lpszText, HIWORD(wParam));
|
||||
if (infoPtr->hwndToolTip) {
|
||||
TTTOOLINFOW ti;
|
||||
ti.cbSize = sizeof(TTTOOLINFOW);
|
||||
ti.hwnd = hwnd;
|
||||
ti.uId = LOWORD(wParam);
|
||||
ti.lpszText = buf;
|
||||
SendMessageW(infoPtr->hwndToolTip, TTM_GETTEXTW, 0, (LPARAM)&ti);
|
||||
}
|
||||
lstrcpynW(tip, buf, HIWORD(wParam));
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue