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
ab2cac48
Commit
ab2cac48
authored
Nov 27, 2012
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Fix handling of NULL paint struct in BeginPaint.
parent
c1157b79
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
8 deletions
+36
-8
painting.c
dlls/user32/painting.c
+16
-8
msg.c
dlls/user32/tests/msg.c
+20
-0
No files found.
dlls/user32/painting.c
View file @
ab2cac48
...
...
@@ -893,20 +893,28 @@ static HWND fix_caret(HWND hWnd, const RECT *scroll_rect, INT dx, INT dy,
HDC
WINAPI
BeginPaint
(
HWND
hwnd
,
PAINTSTRUCT
*
lps
)
{
HRGN
hrgn
;
HDC
hdc
;
BOOL
erase
;
RECT
rect
;
UINT
flags
=
UPDATE_NONCLIENT
|
UPDATE_ERASE
|
UPDATE_PAINT
|
UPDATE_INTERNALPAINT
|
UPDATE_NOCHILDREN
;
if
(
!
lps
)
return
0
;
HideCaret
(
hwnd
);
if
(
!
(
hrgn
=
send_ncpaint
(
hwnd
,
NULL
,
&
flags
)))
return
0
;
lps
->
fErase
=
send_erase
(
hwnd
,
flags
,
hrgn
,
&
lps
->
rcPaint
,
&
lps
->
hdc
);
erase
=
send_erase
(
hwnd
,
flags
,
hrgn
,
&
rect
,
&
hdc
);
TRACE
(
"hdc = %p box = (%s), fErase = %d
\n
"
,
lps
->
hdc
,
wine_dbgstr_rect
(
&
lps
->
rcPaint
),
lps
->
fErase
);
TRACE
(
"hdc = %p box = (%s), fErase = %d
\n
"
,
hdc
,
wine_dbgstr_rect
(
&
rect
),
erase
);
return
lps
->
hdc
;
if
(
!
lps
)
{
release_dc
(
hwnd
,
hdc
,
TRUE
);
return
0
;
}
lps
->
fErase
=
erase
;
lps
->
rcPaint
=
rect
;
lps
->
hdc
=
hdc
;
return
hdc
;
}
...
...
@@ -915,10 +923,10 @@ HDC WINAPI BeginPaint( HWND hwnd, PAINTSTRUCT *lps )
*/
BOOL
WINAPI
EndPaint
(
HWND
hwnd
,
const
PAINTSTRUCT
*
lps
)
{
if
(
!
lps
)
return
FALSE
;
release_dc
(
hwnd
,
lps
->
hdc
,
TRUE
);
ShowCaret
(
hwnd
);
flush_window_surfaces
(
FALSE
);
if
(
!
lps
)
return
FALSE
;
release_dc
(
hwnd
,
lps
->
hdc
,
TRUE
);
return
TRUE
;
}
...
...
dlls/user32/tests/msg.c
View file @
ab2cac48
...
...
@@ -9093,6 +9093,26 @@ static void test_DispatchMessage(void)
if
(
++
count
>
10
)
break
;
}
}
flush_sequence
();
RedrawWindow
(
hwnd
,
&
rect
,
0
,
RDW_INVALIDATE
|
RDW_ERASE
|
RDW_FRAME
);
count
=
0
;
while
(
PeekMessage
(
&
msg
,
0
,
0
,
0
,
PM_REMOVE
))
{
if
(
msg
.
message
!=
WM_PAINT
)
DispatchMessage
(
&
msg
);
else
{
HDC
hdc
;
flush_sequence
();
hdc
=
BeginPaint
(
hwnd
,
NULL
);
ok
(
!
hdc
,
"got valid hdc %p from BeginPaint
\n
"
,
hdc
);
ok
(
!
EndPaint
(
hwnd
,
NULL
),
"EndPaint succeeded
\n
"
);
ok_sequence
(
WmDispatchPaint
,
"WmDispatchPaint"
,
FALSE
);
ok
(
!
count
,
"Got multiple WM_PAINTs
\n
"
);
if
(
++
count
>
10
)
break
;
}
}
DestroyWindow
(
hwnd
);
}
...
...
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