mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-05 18:01:34 +00:00
Check for a NULL pointer in GetWindowTextA/W.
This commit is contained in:
parent
bfec8c229d
commit
4cc3b97ec1
2 changed files with 15 additions and 0 deletions
|
@ -2771,6 +2771,15 @@ void test_scroll()
|
|||
DestroyWindow( hwnd);
|
||||
}
|
||||
|
||||
static void test_params()
|
||||
{
|
||||
INT rc;
|
||||
|
||||
/* Just a param check */
|
||||
SetLastError(0xdeadbeef);
|
||||
rc = GetWindowText(hwndMain2, NULL, 1024);
|
||||
ok( rc==0, "GetWindowText: rc=%d err=%ld\n",rc,GetLastError());
|
||||
}
|
||||
|
||||
START_TEST(win)
|
||||
{
|
||||
|
@ -2810,6 +2819,8 @@ START_TEST(win)
|
|||
assert( hwndMain );
|
||||
assert( hwndMain2 );
|
||||
|
||||
test_params();
|
||||
|
||||
test_capture_1();
|
||||
test_capture_2();
|
||||
test_capture_3(hwndMain, hwndMain2);
|
||||
|
|
|
@ -2223,6 +2223,8 @@ INT WINAPI GetWindowTextA( HWND hwnd, LPSTR lpString, INT nMaxCount )
|
|||
{
|
||||
WCHAR *buffer;
|
||||
|
||||
if (!lpString) return 0;
|
||||
|
||||
if (WIN_IsCurrentProcess( hwnd ))
|
||||
return (INT)SendMessageA( hwnd, WM_GETTEXT, nMaxCount, (LPARAM)lpString );
|
||||
|
||||
|
@ -2266,6 +2268,8 @@ INT WINAPI InternalGetWindowText(HWND hwnd,LPWSTR lpString,INT nMaxCount )
|
|||
*/
|
||||
INT WINAPI GetWindowTextW( HWND hwnd, LPWSTR lpString, INT nMaxCount )
|
||||
{
|
||||
if (!lpString) return 0;
|
||||
|
||||
if (WIN_IsCurrentProcess( hwnd ))
|
||||
return (INT)SendMessageW( hwnd, WM_GETTEXT, nMaxCount, (LPARAM)lpString );
|
||||
|
||||
|
|
Loading…
Reference in a new issue