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
2999123f
Commit
2999123f
authored
Jul 18, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Also disable the DC if the window is destroyed without a ReleaseDC.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
02eda5cc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
painting.c
dlls/user32/painting.c
+7
-3
dce.c
dlls/user32/tests/dce.c
+5
-5
No files found.
dlls/user32/painting.c
View file @
2999123f
...
...
@@ -367,9 +367,13 @@ void free_dce( struct dce *dce, HWND hwnd )
if
(
dce
->
hwnd
!=
hwnd
)
continue
;
if
(
!
(
dce
->
flags
&
DCX_CACHE
))
break
;
if
(
dce
->
count
)
WARN
(
"GetDC() without ReleaseDC() for window %p
\n
"
,
hwnd
);
dce
->
count
=
0
;
release_dce
(
dce
);
if
(
dce
->
count
)
{
WARN
(
"GetDC() without ReleaseDC() for window %p
\n
"
,
hwnd
);
dce
->
count
=
0
;
SetHookFlags
(
dce
->
hdc
,
DCHF_DISABLEDC
);
}
}
}
...
...
@@ -472,7 +476,7 @@ static INT release_dc( HWND hwnd, HDC hdc, BOOL end_paint )
USER_Lock
();
dce
=
(
struct
dce
*
)
GetDCHook
(
hdc
,
NULL
);
if
(
dce
&&
dce
->
count
)
if
(
dce
&&
dce
->
count
&&
dce
->
hwnd
)
{
if
(
!
(
dce
->
flags
&
DCX_NORESETATTRS
))
SetHookFlags
(
dce
->
hdc
,
DCHF_RESETDC
);
if
(
end_paint
||
(
dce
->
flags
&
DCX_CACHE
))
delete_clip_rgn
(
dce
);
...
...
dlls/user32/tests/dce.c
View file @
2999123f
...
...
@@ -623,7 +623,7 @@ static void test_destroyed_window(void)
DestroyWindow
(
hwnd_cache
);
rop
=
GetROP2
(
dc
);
todo_wine
ok
(
rop
==
0
,
"wrong ROP2 %d
\n
"
,
rop
);
ok
(
rop
==
0
,
"wrong ROP2 %d
\n
"
,
rop
);
ok
(
WindowFromDC
(
dc
)
==
0
,
"wrong window
\n
"
);
ok
(
!
ReleaseDC
(
hwnd_cache
,
dc
),
"ReleaseDC succeeded
\n
"
);
dc
=
GetDC
(
hwnd_cache
);
...
...
@@ -654,21 +654,21 @@ static void test_destroyed_window(void)
rop
=
GetROP2
(
dc
);
ok
(
rop
==
R2_WHITE
,
"wrong ROP2 %d
\n
"
,
rop
);
ok
(
WindowFromDC
(
dc
)
==
0
,
"wrong window
\n
"
);
todo_wine
ok
(
!
ReleaseDC
(
hwnd_classdc2
,
dc
),
"ReleaseDC succeeded
\n
"
);
ok
(
!
ReleaseDC
(
hwnd_classdc2
,
dc
),
"ReleaseDC succeeded
\n
"
);
dc
=
GetDC
(
hwnd_classdc2
);
ok
(
!
dc
,
"Got a non-NULL DC (%p) for a destroyed window
\n
"
,
dc
);
dc
=
GetDC
(
hwnd_classdc
);
ok
(
dc
!=
0
,
"Got NULL DC
\n
"
);
rop
=
GetROP2
(
dc
);
todo_wine
ok
(
rop
==
R2_WHITE
,
"wrong ROP2 %d
\n
"
,
rop
);
ok
(
rop
==
R2_WHITE
,
"wrong ROP2 %d
\n
"
,
rop
);
ok
(
WindowFromDC
(
dc
)
==
hwnd_classdc
,
"wrong window
\n
"
);
DestroyWindow
(
hwnd_classdc
);
rop
=
GetROP2
(
dc
);
todo_wine
ok
(
rop
==
R2_WHITE
,
"wrong ROP2 %d
\n
"
,
rop
);
ok
(
rop
==
R2_WHITE
,
"wrong ROP2 %d
\n
"
,
rop
);
ok
(
WindowFromDC
(
dc
)
==
0
,
"wrong window
\n
"
);
todo_wine
ok
(
!
ReleaseDC
(
hwnd_classdc
,
dc
),
"ReleaseDC succeeded
\n
"
);
ok
(
!
ReleaseDC
(
hwnd_classdc
,
dc
),
"ReleaseDC succeeded
\n
"
);
dc
=
GetDC
(
hwnd_classdc
);
ok
(
!
dc
,
"Got a non-NULL DC (%p) for a destroyed window
\n
"
,
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