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
1ca6ed77
Commit
1ca6ed77
authored
Apr 09, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Fix GetClipBox return value for non-memory DCs.
parent
8abb0ffa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
clipping.c
dlls/gdi32/clipping.c
+5
-1
dc.c
dlls/gdi32/tests/dc.c
+21
-2
No files found.
dlls/gdi32/clipping.c
View file @
1ca6ed77
...
...
@@ -409,7 +409,11 @@ INT WINAPI GetClipBox( HDC hdc, LPRECT rect )
if
(
get_dc_visrect
(
dc
,
&
visrect
)
&&
!
intersect_rect
(
rect
,
rect
,
&
visrect
))
ret
=
NULLREGION
;
}
else
ret
=
get_dc_visrect
(
dc
,
rect
)
?
SIMPLEREGION
:
NULLREGION
;
else
{
ret
=
is_rect_empty
(
&
dc
->
vis_rect
)
?
ERROR
:
SIMPLEREGION
;
*
rect
=
dc
->
vis_rect
;
}
if
(
dc
->
layout
&
LAYOUT_RTL
)
{
...
...
dlls/gdi32/tests/dc.c
View file @
1ca6ed77
...
...
@@ -345,6 +345,8 @@ static void test_device_caps( HDC hdc, HDC ref_dc, const char *descr )
unsigned
int
i
;
WORD
ramp
[
3
][
256
];
BOOL
ret
;
RECT
clip
;
UINT
type
;
if
(
GetObjectType
(
hdc
)
==
OBJ_METADC
)
{
...
...
@@ -358,6 +360,8 @@ static void test_device_caps( HDC hdc, HDC ref_dc, const char *descr )
ok
(
!
ret
,
"GetDeviceGammaRamp succeeded on %s
\n
"
,
descr
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
||
broken
(
GetLastError
()
==
0xdeadbeef
),
/* nt4 */
"wrong error %u on %s
\n
"
,
GetLastError
(),
descr
);
type
=
GetClipBox
(
hdc
,
&
clip
);
ok
(
type
==
ERROR
,
"GetClipBox returned %d on %s
\n
"
,
type
,
descr
);
}
else
{
...
...
@@ -371,8 +375,17 @@ static void test_device_caps( HDC hdc, HDC ref_dc, const char *descr )
ok
(
!
ret
,
"GetDeviceGammaRamp succeeded on %s
\n
"
,
descr
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
||
broken
(
GetLastError
()
==
0xdeadbeef
),
/* nt4 */
"wrong error %u on %s
\n
"
,
GetLastError
(),
descr
);
type
=
GetClipBox
(
hdc
,
&
clip
);
ok
(
type
==
SIMPLEREGION
,
"GetClipBox returned %d on memdc for %s
\n
"
,
type
,
descr
);
}
type
=
GetClipBox
(
ref_dc
,
&
clip
);
ok
(
type
==
SIMPLEREGION
,
"GetClipBox returned %d on %s
\n
"
,
type
,
descr
);
ok
(
clip
.
left
==
0
&&
clip
.
top
==
0
&&
clip
.
right
==
GetDeviceCaps
(
ref_dc
,
DESKTOPHORZRES
)
&&
clip
.
bottom
==
GetDeviceCaps
(
ref_dc
,
DESKTOPVERTRES
),
"GetClipBox returned %d,%d,%d,%d on %s
\n
"
,
clip
.
left
,
clip
.
top
,
clip
.
right
,
clip
.
bottom
,
descr
);
if
(
GetObjectType
(
hdc
)
==
OBJ_MEMDC
)
{
char
buffer
[
sizeof
(
BITMAPINFOHEADER
)
+
256
*
sizeof
(
RGBQUAD
)];
...
...
@@ -400,6 +413,12 @@ static void test_device_caps( HDC hdc, HDC ref_dc, const char *descr )
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
||
broken
(
GetLastError
()
==
0xdeadbeef
),
/* nt4 */
"wrong error %u on %s
\n
"
,
GetLastError
(),
descr
);
type
=
GetClipBox
(
hdc
,
&
clip
);
ok
(
type
==
SIMPLEREGION
,
"GetClipBox returned %d on memdc for %s
\n
"
,
type
,
descr
);
ok
(
clip
.
left
==
0
&&
clip
.
top
==
0
&&
clip
.
right
==
16
&&
clip
.
bottom
==
16
,
"GetClipBox returned %d,%d,%d,%d on memdc for %s
\n
"
,
clip
.
left
,
clip
.
top
,
clip
.
right
,
clip
.
bottom
,
descr
);
SelectObject
(
hdc
,
old
);
DeleteObject
(
dib
);
}
...
...
@@ -412,7 +431,7 @@ static void test_CreateCompatibleDC(void)
HBITMAP
bitmap
;
INT
caps
;
screen_dc
=
GetDC
(
0
);
screen_dc
=
CreateDC
(
"DISPLAY"
,
NULL
,
NULL
,
NULL
);
bitmap
=
CreateBitmap
(
10
,
10
,
1
,
1
,
NULL
);
/* Create a DC compatible with the screen */
...
...
@@ -456,7 +475,7 @@ static void test_CreateCompatibleDC(void)
DeleteMetaFile
(
CloseMetaFile
(
hdcMetafile
));
DeleteObject
(
bitmap
);
ReleaseDC
(
0
,
screen_dc
);
DeleteDC
(
screen_dc
);
}
static
void
test_DC_bitmap
(
void
)
...
...
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