mirror of
https://github.com/reactos/reactos.git
synced 2024-06-29 01:12:06 +00:00
probe and copy hdc from usermode PAINTSTRUCT using SEH
svn path=/trunk/; revision=28028
This commit is contained in:
parent
7f423ecbdb
commit
0aa1be9e3f
|
@ -870,11 +870,13 @@ CLEANUP:
|
|||
*/
|
||||
|
||||
BOOL STDCALL
|
||||
NtUserEndPaint(HWND hWnd, CONST PAINTSTRUCT* lPs)
|
||||
NtUserEndPaint(HWND hWnd, CONST PAINTSTRUCT* pUnsafePs)
|
||||
{
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
PWINDOW_OBJECT Window;
|
||||
DECLARE_RETURN(BOOL);
|
||||
USER_REFERENCE_ENTRY Ref;
|
||||
HDC hdc = NULL;
|
||||
|
||||
DPRINT("Enter NtUserEndPaint\n");
|
||||
UserEnterExclusive();
|
||||
|
@ -884,7 +886,22 @@ NtUserEndPaint(HWND hWnd, CONST PAINTSTRUCT* lPs)
|
|||
RETURN(FALSE);
|
||||
}
|
||||
|
||||
UserReleaseDC(Window, lPs->hdc, TRUE);
|
||||
_SEH_TRY
|
||||
{
|
||||
ProbeForRead(pUnsafePs, sizeof(*pUnsafePs), 1);
|
||||
hdc = pUnsafePs->hdc;
|
||||
}
|
||||
_SEH_HANDLE
|
||||
{
|
||||
Status = _SEH_GetExceptionCode();
|
||||
}
|
||||
_SEH_END
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
RETURN(FALSE);
|
||||
}
|
||||
|
||||
UserReleaseDC(Window, hdc, TRUE);
|
||||
|
||||
UserRefObjectCo(Window, &Ref);
|
||||
co_UserShowCaret(Window);
|
||||
|
|
Loading…
Reference in a new issue