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
a47e2a5e
Commit
a47e2a5e
authored
Dec 19, 2023
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Dec 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add more display DC tests.
Test that passing the bitmap object from display DCs to GetDIBits() should succeed. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=54381
parent
69b335b5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
monitor.c
dlls/user32/tests/monitor.c
+16
-0
No files found.
dlls/user32/tests/monitor.c
View file @
a47e2a5e
...
...
@@ -2227,6 +2227,9 @@ static void test_handles(void)
#define check_display_dc(a, b, c) _check_display_dc(__LINE__, a, b, c)
static
void
_check_display_dc
(
INT
line
,
HDC
hdc
,
const
DEVMODEA
*
dm
,
BOOL
allow_todo
)
{
unsigned
char
buffer
[
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
])]
=
{
0
};
BITMAPINFO
*
bmi
=
(
BITMAPINFO
*
)
buffer
;
DIBSECTION
dib
;
BITMAP
bitmap
;
HBITMAP
hbmp
;
INT
value
;
...
...
@@ -2265,6 +2268,19 @@ static void _check_display_dc(INT line, HDC hdc, const DEVMODEA *dm, BOOL allow_
hbmp
=
GetCurrentObject
(
hdc
,
OBJ_BITMAP
);
ok_
(
__FILE__
,
line
)(
!!
hbmp
,
"GetCurrentObject failed, error %#lx.
\n
"
,
GetLastError
());
/* Expect hbmp to be a bitmap, not a DIB when GetObjectA() succeeds */
value
=
GetObjectA
(
hbmp
,
sizeof
(
dib
),
&
dib
);
ok
(
!
value
||
value
==
sizeof
(
BITMAP
),
"GetObjectA failed, value %d.
\n
"
,
value
);
/* Expect GetDIBits() to succeed */
bmi
->
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
value
=
GetDIBits
(
hdc
,
hbmp
,
0
,
0
,
NULL
,
(
LPBITMAPINFO
)
bmi
,
DIB_RGB_COLORS
);
todo_wine
ok
(
value
,
"GetDIBits failed, error %#lx.
\n
"
,
GetLastError
());
todo_wine
ok
(
bmi
->
bmiHeader
.
biCompression
==
BI_BITFIELDS
,
"Got unexpected biCompression %lu.
\n
"
,
bmi
->
bmiHeader
.
biCompression
);
ret
=
GetObjectA
(
hbmp
,
sizeof
(
bitmap
),
&
bitmap
);
/* GetObjectA fails on Win7 and older */
if
(
ret
)
...
...
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