Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9d5a848d
Commit
9d5a848d
authored
Jun 01, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
Jun 01, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Fix parameter handling of GetBoundsRect.
parent
682f0dcf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
3 deletions
+70
-3
dc.c
dlls/gdi32/dc.c
+7
-3
dc.c
dlls/gdi32/tests/dc.c
+63
-0
No files found.
dlls/gdi32/dc.c
View file @
9d5a848d
...
...
@@ -1534,9 +1534,13 @@ UINT WINAPI GetBoundsRect(HDC hdc, LPRECT rect, UINT flags)
if
(
!
dc
)
return
0
;
if
(
rect
)
*
rect
=
dc
->
BoundsRect
;
ret
=
((
dc
->
flags
&
DC_BOUNDS_SET
)
?
DCB_SET
:
DCB_RESET
);
if
(
rect
)
{
*
rect
=
dc
->
BoundsRect
;
ret
=
((
dc
->
flags
&
DC_BOUNDS_SET
)
?
DCB_SET
:
DCB_RESET
);
}
else
ret
=
0
;
if
(
flags
&
DCB_RESET
)
{
...
...
dlls/gdi32/tests/dc.c
View file @
9d5a848d
...
...
@@ -494,6 +494,68 @@ todo_wine
ok
(
ret
,
"UnregisterClassA failed
\n
"
);
}
static
void
test_boundsrect_invalid
(
void
)
{
HDC
hdc
;
RECT
rect
,
expect
;
UINT
ret
;
hdc
=
GetDC
(
NULL
);
ok
(
hdc
!=
NULL
,
"GetDC failed
\n
"
);
ret
=
GetBoundsRect
(
hdc
,
NULL
,
0
);
ok
(
ret
==
0
||
broken
(
ret
==
DCB_RESET
),
/* Win9x */
"Expected GetBoundsRect to return 0, got %u
\n
"
,
ret
);
ret
=
GetBoundsRect
(
hdc
,
NULL
,
~
0U
);
ok
(
ret
==
0
||
broken
(
ret
==
DCB_RESET
),
/* Win9x */
"Expected GetBoundsRect to return 0, got %u
\n
"
,
ret
);
if
(
GetBoundsRect
(
hdc
,
NULL
,
0
)
==
DCB_RESET
)
win_skip
(
"Win9x fails catastrophically with first GetBoundsRect call
\n
"
);
else
{
/* Test parameter handling order. */
SetRect
(
&
rect
,
0
,
0
,
50
,
50
);
ret
=
SetBoundsRect
(
hdc
,
&
rect
,
DCB_SET
);
ok
(
ret
&
DCB_RESET
,
"Expected return flag DCB_RESET to be set, got %u
\n
"
,
ret
);
ret
=
GetBoundsRect
(
hdc
,
NULL
,
DCB_RESET
);
ok
(
ret
==
0
,
"Expected GetBoundsRect to return 0, got %u
\n
"
,
ret
);
ret
=
GetBoundsRect
(
hdc
,
&
rect
,
0
);
ok
(
ret
==
DCB_RESET
,
"Expected GetBoundsRect to return DCB_RESET, got %u
\n
"
,
ret
);
SetRect
(
&
expect
,
0
,
0
,
0
,
0
);
ok
(
EqualRect
(
&
rect
,
&
expect
),
"Expected output rectangle (0,0)-(0,0), got (%d,%d)-(%d,%d)
\n
"
,
rect
.
left
,
rect
.
top
,
rect
.
right
,
rect
.
bottom
);
}
if
(
GetBoundsRect
(
hdc
,
NULL
,
0
)
==
DCB_RESET
)
win_skip
(
"Win9x fails catastrophically with NULL device context parameter
\n
"
);
else
{
ret
=
GetBoundsRect
(
NULL
,
NULL
,
0
);
ok
(
ret
==
0
,
"Expected GetBoundsRect to return 0, got %u
\n
"
,
ret
);
ret
=
GetBoundsRect
(
NULL
,
NULL
,
~
0U
);
ok
(
ret
==
0
,
"Expected GetBoundsRect to return 0, got %u
\n
"
,
ret
);
ret
=
SetBoundsRect
(
NULL
,
NULL
,
0
);
ok
(
ret
==
0
,
"Expected SetBoundsRect to return 0, got %u
\n
"
,
ret
);
ret
=
SetBoundsRect
(
NULL
,
NULL
,
~
0U
);
ok
(
ret
==
0
,
"Expected SetBoundsRect to return 0, got %u
\n
"
,
ret
);
}
DeleteDC
(
hdc
);
}
START_TEST
(
dc
)
{
test_savedc
();
...
...
@@ -502,4 +564,5 @@ START_TEST(dc)
test_CreateCompatibleDC
();
test_DC_bitmap
();
test_DeleteDC
();
test_boundsrect_invalid
();
}
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