Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
95fdf165
Commit
95fdf165
authored
Jan 17, 2007
by
Mike McCormack
Committed by
Alexandre Julliard
Jan 18, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Add a test showing WM_GETTEXT doesn't crash with bad pointers.
parent
ce21d918
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
win.c
dlls/user32/tests/win.c
+34
-0
No files found.
dlls/user32/tests/win.c
View file @
95fdf165
...
@@ -4084,6 +4084,39 @@ static void test_ShowWindow(void)
...
@@ -4084,6 +4084,39 @@ static void test_ShowWindow(void)
ok
(
!
IsWindow
(
hwnd
),
"window should not exist
\n
"
);
ok
(
!
IsWindow
(
hwnd
),
"window should not exist
\n
"
);
}
}
void
test_gettext
(
void
)
{
WNDCLASS
cls
;
LPCSTR
clsname
=
"gettexttest"
;
HWND
hwnd
;
LRESULT
r
;
memset
(
&
cls
,
0
,
sizeof
cls
);
cls
.
lpfnWndProc
=
DefWindowProc
;
cls
.
lpszClassName
=
clsname
;
cls
.
hInstance
=
GetModuleHandle
(
NULL
);
if
(
!
RegisterClass
(
&
cls
))
return
;
hwnd
=
CreateWindow
(
clsname
,
"test text"
,
WS_OVERLAPPED
,
0
,
0
,
10
,
10
,
0
,
NULL
,
NULL
,
NULL
);
ok
(
hwnd
!=
NULL
,
"window was null
\n
"
);
r
=
SendMessage
(
hwnd
,
WM_GETTEXT
,
0x10
,
0x1000
);
ok
(
r
==
0
,
"settext should return zero
\n
"
);
r
=
SendMessage
(
hwnd
,
WM_GETTEXT
,
0x10000
,
0
);
ok
(
r
==
0
,
"settext should return zero (%ld)
\n
"
,
r
);
r
=
SendMessage
(
hwnd
,
WM_GETTEXT
,
0xff000000
,
0x1000
);
ok
(
r
==
0
,
"settext should return zero (%ld)
\n
"
,
r
);
r
=
SendMessage
(
hwnd
,
WM_GETTEXT
,
0x1000
,
0xff000000
);
ok
(
r
==
0
,
"settext should return zero (%ld)
\n
"
,
r
);
DestroyWindow
(
hwnd
);
UnregisterClass
(
clsname
,
NULL
);
}
START_TEST
(
win
)
START_TEST
(
win
)
{
{
pGetAncestor
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"user32.dll"
),
"GetAncestor"
);
pGetAncestor
=
(
void
*
)
GetProcAddress
(
GetModuleHandleA
(
"user32.dll"
),
"GetAncestor"
);
...
@@ -4161,6 +4194,7 @@ START_TEST(win)
...
@@ -4161,6 +4194,7 @@ START_TEST(win)
test_csparentdc
();
test_csparentdc
();
test_SetWindowLong
();
test_SetWindowLong
();
test_ShowWindow
();
test_ShowWindow
();
test_gettext
();
/* add the tests above this line */
/* add the tests above this line */
UnhookWindowsHookEx
(
hhook
);
UnhookWindowsHookEx
(
hhook
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment