mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
Implement ExtCreateRegion.
svn path=/trunk/; revision=12730
This commit is contained in:
parent
59aa5bd203
commit
7581cc7fb9
3 changed files with 56 additions and 11 deletions
|
@ -79,9 +79,9 @@ NtGdiEqualRgn(HRGN hSrcRgn1,
|
|||
|
||||
HRGN
|
||||
STDCALL
|
||||
NtGdiExtCreateRegion(CONST PXFORM Xform,
|
||||
DWORD Count,
|
||||
CONST PROSRGNDATA RgnData);
|
||||
NtGdiExtCreateRegion(CONST XFORM *Xform,
|
||||
DWORD Count,
|
||||
CONST RGNDATA *RgnData);
|
||||
|
||||
BOOL
|
||||
STDCALL
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; $Id: gdi32.def,v 1.13 2004/12/30 02:32:23 navaraf Exp $
|
||||
; $Id$
|
||||
;
|
||||
; gdi32.def
|
||||
;
|
||||
|
@ -168,7 +168,7 @@ EudcLoadLinkW@16
|
|||
EudcUnloadLinkW@8
|
||||
ExcludeClipRect@20=NtGdiExcludeClipRect@20
|
||||
ExtCreatePen@20=NtGdiExtCreatePen@20
|
||||
ExtCreateRegion@12
|
||||
ExtCreateRegion@12=NtGdiExtCreateRegion@12
|
||||
ExtEscape@24=NtGdiExtEscape@24
|
||||
ExtFloodFill@20=NtGdiExtFloodFill@20
|
||||
ExtSelectClipRgn@12=NtGdiExtSelectClipRgn@12
|
||||
|
|
|
@ -113,7 +113,7 @@ SOFTWARE.
|
|||
* the y-x-banding that's so nice to have...
|
||||
*/
|
||||
|
||||
/* $Id: region.c,v 1.64 2004/12/12 01:40:38 weiden Exp $ */
|
||||
/* $Id$ */
|
||||
#include <w32k.h>
|
||||
#include <win32k/float.h>
|
||||
|
||||
|
@ -2224,12 +2224,57 @@ exit:
|
|||
|
||||
HRGN
|
||||
STDCALL
|
||||
NtGdiExtCreateRegion(CONST PXFORM Xform,
|
||||
DWORD Count,
|
||||
CONST PROSRGNDATA RgnData)
|
||||
NtGdiExtCreateRegion(CONST XFORM *Xform,
|
||||
DWORD Count,
|
||||
CONST RGNDATA *RgnData)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return 0;
|
||||
HRGN hRgn;
|
||||
RGNDATA SafeRgnData;
|
||||
PROSRGNDATA Region;
|
||||
NTSTATUS Status;
|
||||
|
||||
if (Count < FIELD_OFFSET(RGNDATA, Buffer))
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Status = MmCopyFromCaller(&SafeRgnData, RgnData, min(Count, sizeof(RGNDATA)));
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
hRgn = RGNDATA_AllocRgn(SafeRgnData.rdh.nCount);
|
||||
if (hRgn == NULL)
|
||||
{
|
||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Region = RGNDATA_LockRgn(hRgn);
|
||||
if (Region == NULL)
|
||||
{
|
||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
RtlCopyMemory(&Region->rdh, &SafeRgnData, FIELD_OFFSET(RGNDATA, Buffer));
|
||||
|
||||
Status = MmCopyFromCaller(Region->Buffer, RgnData->Buffer,
|
||||
Count - FIELD_OFFSET(RGNDATA, Buffer));
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
RGNDATA_UnlockRgn(hRgn);
|
||||
NtGdiDeleteObject(hRgn);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
RGNDATA_UnlockRgn(hRgn);
|
||||
|
||||
return hRgn;
|
||||
}
|
||||
|
||||
BOOL
|
||||
|
|
Loading…
Reference in a new issue