- Coding for PrintWindow support for bug 5609. This does not fix the export, which should be a direct call to win32k.

svn path=/trunk/; revision=48853
This commit is contained in:
James Tabor 2010-09-23 17:51:10 +00:00
parent 29f98a6645
commit 81730f239d
2 changed files with 88 additions and 11 deletions

View file

@ -866,17 +866,6 @@ NtUserNotifyProcessCreate(
return 0;
}
BOOL
APIENTRY
NtUserPrintWindow(
HWND hwnd,
HDC hdcBlt,
UINT nFlags)
{
UNIMPLEMENTED;
return 0;
}
NTSTATUS
APIENTRY
NtUserProcessConnect(

View file

@ -750,6 +750,64 @@ co_IntFixCaret(PWINDOW_OBJECT Window, RECTL *lprc, UINT flags)
return 0;
}
BOOL
FASTCALL
IntPrintWindow(
PWINDOW_OBJECT Window,
HDC hdcBlt,
UINT nFlags)
{
PWND pwnd;
HDC hdcSrc;
INT cx, cy, xSrc, ySrc;
pwnd = Window->Wnd;
if (!pwnd)
return FALSE;
if ( nFlags & PW_CLIENTONLY)
{
cx = pwnd->rcClient.right - pwnd->rcClient.left;
cy = pwnd->rcClient.bottom - pwnd->rcClient.top;
xSrc = pwnd->rcClient.left - pwnd->rcWindow.left;
ySrc = pwnd->rcClient.top - pwnd->rcWindow.top;
}
else
{
cx = pwnd->rcWindow.right - pwnd->rcWindow.left;
cy = pwnd->rcWindow.bottom - pwnd->rcWindow.top;
xSrc = 0;
ySrc = 0;
}
// TODO: Setup Redirection for Print.
return FALSE;
/* Update the window just incase. */
co_IntPaintWindows( Window, RDW_ERASENOW|RDW_UPDATENOW, FALSE);
hdcSrc = UserGetDCEx( Window, NULL, DCX_CACHE|DCX_WINDOW);
/* Print window to printer context. */
NtGdiBitBlt( hdcBlt,
0,
0,
cx,
cy,
hdcSrc,
xSrc,
ySrc,
SRCCOPY,
0,
0);
UserReleaseDC( Window, hdcSrc, FALSE);
// TODO: Release Redirection from Print.
return TRUE;
}
/* PUBLIC FUNCTIONS ***********************************************************/
/*
@ -2028,6 +2086,36 @@ NtUserInvalidateRgn(
return NtUserRedrawWindow(hWnd, NULL, hRgn, RDW_INVALIDATE | (bErase? RDW_ERASE : 0));
}
BOOL
APIENTRY
NtUserPrintWindow(
HWND hwnd,
HDC hdcBlt,
UINT nFlags)
{
PWINDOW_OBJECT Window;
BOOL Ret = FALSE;
UserEnterExclusive();
if (hwnd)
{
Window = UserGetWindowObject(hwnd);
// TODO: Add Desktop and MessageBox check via FNID's.
if ( Window )
{
/* Validate flags and check it as a mask for 0 or 1. */
if ( (nFlags & PW_CLIENTONLY) == nFlags)
Ret = IntPrintWindow( Window, hdcBlt, nFlags);
else
SetLastWin32Error(ERROR_INVALID_PARAMETER);
}
}
UserLeave();
return Ret;
}
/* ValidateRect gets redirected to NtUserValidateRect:
http://blog.csdn.net/ntdll/archive/2005/10/19/509299.aspx */
BOOL