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
a504867a
Commit
a504867a
authored
Feb 16, 2010
by
Andrew Nguyen
Committed by
Alexandre Julliard
Feb 16, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Check the region handle in GetClipRgn later.
parent
aa25fcde
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
89 additions
and
1 deletion
+89
-1
clipping.c
dlls/gdi32/clipping.c
+1
-1
clipping.c
dlls/gdi32/tests/clipping.c
+88
-0
No files found.
dlls/gdi32/clipping.c
View file @
a504867a
...
...
@@ -385,7 +385,7 @@ INT WINAPI GetClipRgn( HDC hdc, HRGN hRgn )
{
INT
ret
=
-
1
;
DC
*
dc
;
if
(
hRgn
&&
(
dc
=
get_dc_ptr
(
hdc
)))
if
((
dc
=
get_dc_ptr
(
hdc
)))
{
if
(
dc
->
hClipRgn
)
{
...
...
dlls/gdi32/tests/clipping.c
View file @
a504867a
...
...
@@ -265,8 +265,96 @@ static void test_ExtCreateRegion(void)
DeleteObject
(
hrgn
);
}
static
void
test_GetClipRgn
(
void
)
{
HDC
hdc
;
HRGN
hrgn
,
hrgn2
,
hrgn3
,
hrgn4
;
int
ret
;
/* Test calling GetClipRgn with NULL device context and region handles. */
ret
=
GetClipRgn
(
NULL
,
NULL
);
ok
(
ret
==
-
1
,
"Expected GetClipRgn to return -1, got %d
\n
"
,
ret
);
hdc
=
GetDC
(
NULL
);
ok
(
hdc
!=
NULL
,
"Expected GetDC to return a valid device context handle
\n
"
);
/* Test calling GetClipRgn with a valid device context and NULL region. */
ret
=
GetClipRgn
(
hdc
,
NULL
);
ok
(
ret
==
0
||
ret
==
-
1
/* Win9x */
,
"Expected GetClipRgn to return 0, got %d
\n
"
,
ret
);
/* Initialize the test regions. */
hrgn
=
CreateRectRgn
(
100
,
100
,
100
,
100
);
ok
(
hrgn
!=
NULL
,
"Expected CreateRectRgn to return a handle to a new rectangular region
\n
"
);
hrgn2
=
CreateRectRgn
(
1
,
2
,
3
,
4
);
ok
(
hrgn2
!=
NULL
,
"Expected CreateRectRgn to return a handle to a new rectangular region
\n
"
);
hrgn3
=
CreateRectRgn
(
1
,
2
,
3
,
4
);
ok
(
hrgn3
!=
NULL
,
"Expected CreateRectRgn to return a handle to a new rectangular region
\n
"
);
hrgn4
=
CreateRectRgn
(
1
,
2
,
3
,
4
);
ok
(
hrgn4
!=
NULL
,
"Expected CreateRectRgn to return a handle to a new rectangular region
\n
"
);
/* Try getting a clipping region from the device context
* when the device context's clipping region isn't set. */
ret
=
GetClipRgn
(
hdc
,
hrgn2
);
ok
(
ret
==
0
,
"Expected GetClipRgn to return 0, got %d
\n
"
,
ret
);
/* The region passed to GetClipRgn should be unchanged. */
ret
=
EqualRgn
(
hrgn2
,
hrgn3
);
ok
(
ret
==
1
,
"Expected EqualRgn to compare the two regions as equal, got %d
\n
"
,
ret
);
/* Try setting and getting back a clipping region. */
ret
=
SelectClipRgn
(
hdc
,
hrgn
);
ok
(
ret
==
NULLREGION
,
"Expected SelectClipRgn to return NULLREGION, got %d
\n
"
,
ret
);
/* Passing a NULL region handle when the device context
* has a clipping region results in an error. */
ret
=
GetClipRgn
(
hdc
,
NULL
);
ok
(
ret
==
-
1
,
"Expected GetClipRgn to return -1, got %d
\n
"
,
ret
);
ret
=
GetClipRgn
(
hdc
,
hrgn2
);
ok
(
ret
==
1
,
"Expected GetClipRgn to return 1, got %d
\n
"
,
ret
);
ret
=
EqualRgn
(
hrgn
,
hrgn2
);
ok
(
ret
==
1
,
"Expected EqualRgn to compare the two regions as equal, got %d
\n
"
,
ret
);
/* Try unsetting and then query the clipping region. */
ret
=
SelectClipRgn
(
hdc
,
NULL
);
ok
(
ret
==
SIMPLEREGION
,
"Expected SelectClipRgn to return SIMPLEREGION, got %d
\n
"
,
ret
);
ret
=
GetClipRgn
(
hdc
,
NULL
);
ok
(
ret
==
0
||
ret
==
-
1
/* Win9x */
,
"Expected GetClipRgn to return 0, got %d
\n
"
,
ret
);
ret
=
GetClipRgn
(
hdc
,
hrgn3
);
ok
(
ret
==
0
,
"Expected GetClipRgn to return 0, got %d
\n
"
,
ret
);
ret
=
EqualRgn
(
hrgn3
,
hrgn4
);
ok
(
ret
==
1
,
"Expected EqualRgn to compare the two regions as equal, got %d
\n
"
,
ret
);
DeleteObject
(
hrgn4
);
DeleteObject
(
hrgn3
);
DeleteObject
(
hrgn2
);
DeleteObject
(
hrgn
);
ReleaseDC
(
NULL
,
hdc
);
}
START_TEST
(
clipping
)
{
test_GetRandomRgn
();
test_ExtCreateRegion
();
test_GetClipRgn
();
}
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