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
a6df5e7e
Commit
a6df5e7e
authored
May 28, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Check for wraparound in the initial window coordinates.
parent
ca34eb16
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
win.c
dlls/user32/tests/win.c
+25
-0
win.c
dlls/user32/win.c
+3
-0
No files found.
dlls/user32/tests/win.c
View file @
a6df5e7e
...
@@ -4230,6 +4230,31 @@ static void test_CreateWindow(void)
...
@@ -4230,6 +4230,31 @@ static void test_CreateWindow(void)
ok
(
rc
.
bottom
==
0
,
"invalid rect bottom %u
\n
"
,
rc
.
bottom
);
ok
(
rc
.
bottom
==
0
,
"invalid rect bottom %u
\n
"
,
rc
.
bottom
);
DestroyWindow
(
hwnd
);
DestroyWindow
(
hwnd
);
/* we need a parent at 0,0 so that child coordinates match */
DestroyWindow
(
parent
);
parent
=
CreateWindowEx
(
0
,
"MinMax_WndClass"
,
NULL
,
WS_POPUP
,
0
,
0
,
100
,
100
,
0
,
0
,
0
,
NULL
);
ok
(
parent
!=
0
,
"CreateWindowEx error %d
\n
"
,
GetLastError
());
expected_cx
=
100
;
expected_cy
=
0x7fffffff
;
SetRect
(
&
expected_rect
,
10
,
10
,
110
,
0x7fffffff
);
hwnd
=
CreateWindowExA
(
0
,
"Sizes_WndClass"
,
NULL
,
WS_CHILD
,
10
,
10
,
100
,
0x7fffffff
,
parent
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"creation failed err %u
\n
"
,
GetLastError
());
GetClientRect
(
hwnd
,
&
rc
);
ok
(
rc
.
right
==
100
,
"invalid rect right %u
\n
"
,
rc
.
right
);
ok
(
rc
.
bottom
==
0x7fffffff
-
10
,
"invalid rect bottom %u
\n
"
,
rc
.
bottom
);
DestroyWindow
(
hwnd
);
expected_cx
=
0x7fffffff
;
expected_cy
=
0x7fffffff
;
SetRect
(
&
expected_rect
,
20
,
10
,
0x7fffffff
,
0x7fffffff
);
hwnd
=
CreateWindowExA
(
0
,
"Sizes_WndClass"
,
NULL
,
WS_CHILD
,
20
,
10
,
0x7fffffff
,
0x7fffffff
,
parent
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"creation failed err %u
\n
"
,
GetLastError
());
GetClientRect
(
hwnd
,
&
rc
);
ok
(
rc
.
right
==
0x7fffffff
-
20
,
"invalid rect right %u
\n
"
,
rc
.
right
);
ok
(
rc
.
bottom
==
0x7fffffff
-
10
,
"invalid rect bottom %u
\n
"
,
rc
.
bottom
);
DestroyWindow
(
hwnd
);
/* top level window */
/* top level window */
expected_cx
=
expected_cy
=
200000
;
expected_cx
=
expected_cy
=
200000
;
SetRect
(
&
expected_rect
,
0
,
0
,
GetSystemMetrics
(
SM_CXMAXTRACK
),
GetSystemMetrics
(
SM_CYMAXTRACK
)
);
SetRect
(
&
expected_rect
,
0
,
0
,
GetSystemMetrics
(
SM_CXMAXTRACK
),
GetSystemMetrics
(
SM_CYMAXTRACK
)
);
...
...
dlls/user32/win.c
View file @
a6df5e7e
...
@@ -1119,6 +1119,9 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, LPCWSTR className, UINT flags
...
@@ -1119,6 +1119,9 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, LPCWSTR className, UINT flags
if
(
cx
<
0
)
cx
=
0
;
if
(
cx
<
0
)
cx
=
0
;
if
(
cy
<
0
)
cy
=
0
;
if
(
cy
<
0
)
cy
=
0
;
SetRect
(
&
rect
,
cs
->
x
,
cs
->
y
,
cs
->
x
+
cx
,
cs
->
y
+
cy
);
SetRect
(
&
rect
,
cs
->
x
,
cs
->
y
,
cs
->
x
+
cx
,
cs
->
y
+
cy
);
/* check for wraparound */
if
(
cs
->
x
+
cx
<
cs
->
x
)
rect
.
right
=
0x7fffffff
;
if
(
cs
->
y
+
cy
<
cs
->
y
)
rect
.
bottom
=
0x7fffffff
;
if
(
!
set_window_pos
(
hwnd
,
0
,
SWP_NOZORDER
|
SWP_NOACTIVATE
,
&
rect
,
&
rect
,
NULL
))
goto
failed
;
if
(
!
set_window_pos
(
hwnd
,
0
,
SWP_NOZORDER
|
SWP_NOACTIVATE
,
&
rect
,
&
rect
,
NULL
))
goto
failed
;
/* send WM_NCCREATE */
/* send WM_NCCREATE */
...
...
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