Pass NTSTATUS return code from NtUser functions and use MmCopyFromCaller

to access pointer parameter

svn path=/trunk/; revision=4339
This commit is contained in:
Gé van Geldorp 2003-03-18 09:16:44 +00:00
parent 32f822eab5
commit c306d43c24
3 changed files with 32 additions and 7 deletions

View file

@ -1087,7 +1087,7 @@ NtUserRealChildWindowFromPoint(
DWORD Unknown1,
DWORD Unknown2);
BOOL STDCALL
NTSTATUS STDCALL
NtUserRedrawWindow(HWND hWnd, CONST RECT *lprcUpdate, HRGN hrgnUpdate, UINT flags);

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: paint.c,v 1.9 2003/03/18 07:19:17 rcampbell Exp $
/* $Id: paint.c,v 1.10 2003/03/18 09:16:44 gvg Exp $
*
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/input.c
@ -30,6 +30,7 @@
#include <windows.h>
#include <user32.h>
#define NDEBUG
#include <debug.h>
/* FUNCTIONS *****************************************************************/
@ -96,6 +97,7 @@ InvalidateRgn(
{
return FALSE;
}
WINBOOL
STDCALL
RedrawWindow(
@ -104,8 +106,17 @@ RedrawWindow(
HRGN hrgnUpdate,
UINT flags)
{
return NtUserRedrawWindow(hWnd, lprcUpdate, hrgnUpdate, flags);
NTSTATUS Status;
Status = NtUserRedrawWindow(hWnd, lprcUpdate, hrgnUpdate, flags);
if (! NT_SUCCESS(Status))
{
SetLastError(RtlNtStatusToDosError(Status));
}
return NT_SUCCESS(Status);
}
WINBOOL
STDCALL
ScrollDC(

View file

@ -1,4 +1,4 @@
/* $Id: window.c,v 1.33 2003/03/18 07:19:17 rcampbell Exp $
/* $Id: window.c,v 1.34 2003/03/18 09:16:44 gvg Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@ -24,7 +24,7 @@
#include <include/msgqueue.h>
#include <include/rect.h>
//#define NDEBUG
#define NDEBUG
#include <win32k/debug1.h>
#include <debug.h>
@ -897,10 +897,24 @@ NtUserRealChildWindowFromPoint(DWORD Unknown0,
return 0;
}
BOOL STDCALL
NTSTATUS STDCALL
NtUserRedrawWindow(HWND hWnd, CONST RECT *lprcUpdate, HRGN hrgnUpdate, UINT flags)
{
return PaintRedrawWindow(hWnd, lprcUpdate, hrgnUpdate, flags);
RECT SafeUpdateRect;
NTSTATUS Status;
if (NULL != lprcUpdate)
{
Status = MmCopyFromCaller(&SafeUpdateRect, lprcUpdate, sizeof(RECT));
if (! NT_SUCCESS(Status))
{
return Status;
}
}
return PaintRedrawWindow(hWnd, NULL == lprcUpdate ? NULL : &SafeUpdateRect, hrgnUpdate,
flags, 0) ? STATUS_SUCCESS : STATUS_INVALID_PARAMETER;
;
}
UINT STDCALL