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
d8867fa7
Commit
d8867fa7
authored
Jun 17, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Expand the DCX_NORESETATTR test to make sure we check the correct DC.
parent
d4762873
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
20 deletions
+55
-20
dce.c
dlls/user32/tests/dce.c
+55
-20
No files found.
dlls/user32/tests/dce.c
View file @
d8867fa7
...
...
@@ -40,7 +40,8 @@ static HWND hwnd_cache, hwnd_owndc, hwnd_classdc, hwnd_classdc2;
static
void
test_dc_attributes
(
void
)
{
HDC
hdc
,
old_hdc
;
INT
rop
,
def_rop
;
HDC
hdcs
[
20
];
INT
i
,
rop
,
def_rop
,
found_dc
;
/* test cache DC */
...
...
@@ -57,26 +58,60 @@ static void test_dc_attributes(void)
ok
(
rop
==
def_rop
,
"wrong ROP2 %d after release
\n
"
,
rop
);
SetROP2
(
hdc
,
R2_WHITE
);
ReleaseDC
(
hwnd_cache
,
hdc
);
old_hdc
=
hdc
;
hdc
=
GetDCEx
(
hwnd_cache
,
0
,
DCX_USESTYLE
|
DCX_NORESETATTRS
);
rop
=
GetROP2
(
hdc
);
/* Win9x seems to silently ignore DCX_NORESETATTRS */
ok
(
rop
==
def_rop
||
rop
==
R2_WHITE
,
"wrong ROP2 %d
\n
"
,
rop
);
SetROP2
(
hdc
,
R2_WHITE
);
rop
=
GetROP2
(
hdc
);
ok
(
rop
==
R2_WHITE
,
"wrong ROP2 %d
\n
"
,
rop
);
ReleaseDC
(
hwnd_cache
,
hdc
);
hdc
=
GetDCEx
(
hwnd_cache
,
0
,
DCX_USESTYLE
|
DCX_NORESETATTRS
);
rop
=
GetROP2
(
hdc
);
ok
(
rop
==
def_rop
||
rop
==
R2_WHITE
,
"wrong ROP2 %d after release
\n
"
,
rop
);
ReleaseDC
(
hwnd_cache
,
hdc
);
hdc
=
GetDCEx
(
hwnd_cache
,
0
,
DCX_USESTYLE
);
rop
=
GetROP2
(
hdc
);
ok
(
rop
==
def_rop
,
"wrong ROP2 %d after release
\n
"
,
rop
);
ReleaseDC
(
hwnd_cache
,
hdc
);
found_dc
=
0
;
for
(
i
=
0
;
i
<
20
;
i
++
)
{
hdc
=
hdcs
[
i
]
=
GetDCEx
(
hwnd_cache
,
0
,
DCX_USESTYLE
|
DCX_NORESETATTRS
);
if
(
!
hdc
)
break
;
rop
=
GetROP2
(
hdc
);
if
(
hdc
==
old_hdc
)
todo_wine
ok
(
rop
==
def_rop
,
"wrong ROP2 %d after release %p/%p
\n
"
,
rop
,
old_hdc
,
hdc
);
else
ok
(
rop
==
def_rop
,
"wrong ROP2 %d after release %p/%p
\n
"
,
rop
,
old_hdc
,
hdc
);
if
(
hdc
==
old_hdc
)
{
found_dc
=
1
;
SetROP2
(
hdc
,
R2_WHITE
);
}
}
if
(
!
found_dc
)
{
trace
(
"hdc %p not found in cache using %p
\n
"
,
old_hdc
,
hdcs
[
0
]
);
old_hdc
=
hdcs
[
0
];
SetROP2
(
old_hdc
,
R2_WHITE
);
}
while
(
i
>=
0
)
ReleaseDC
(
hwnd_cache
,
hdcs
[
--
i
]
);
for
(
i
=
0
;
i
<
20
;
i
++
)
{
hdc
=
hdcs
[
i
]
=
GetDCEx
(
hwnd_cache
,
0
,
DCX_USESTYLE
|
DCX_NORESETATTRS
);
if
(
!
hdc
)
break
;
rop
=
GetROP2
(
hdc
);
if
(
hdc
==
old_hdc
)
ok
(
rop
==
R2_WHITE
||
broken
(
rop
==
def_rop
),
/* win9x doesn't support DCX_NORESETATTRS */
"wrong ROP2 %d after release %p/%p
\n
"
,
rop
,
old_hdc
,
hdc
);
else
ok
(
rop
==
def_rop
,
"wrong ROP2 %d after release %p/%p
\n
"
,
rop
,
old_hdc
,
hdc
);
}
while
(
i
>=
0
)
ReleaseDC
(
hwnd_cache
,
hdcs
[
--
i
]
);
for
(
i
=
0
;
i
<
20
;
i
++
)
{
hdc
=
hdcs
[
i
]
=
GetDCEx
(
hwnd_cache
,
0
,
DCX_USESTYLE
);
if
(
!
hdc
)
break
;
rop
=
GetROP2
(
hdc
);
if
(
hdc
==
old_hdc
)
{
todo_wine
ok
(
rop
==
R2_WHITE
||
broken
(
rop
==
def_rop
),
"wrong ROP2 %d after release %p/%p
\n
"
,
rop
,
old_hdc
,
hdc
);
SetROP2
(
old_hdc
,
def_rop
);
}
else
ok
(
rop
==
def_rop
,
"wrong ROP2 %d after release %p/%p
\n
"
,
rop
,
old_hdc
,
hdc
);
}
while
(
i
>=
0
)
ReleaseDC
(
hwnd_cache
,
hdcs
[
--
i
]
);
/* test own DC */
...
...
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