mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:02:56 +00:00
- NtGdiCreateRectRgn should accept negative width and height. It's supposed to be handled just like in NtGdiSetRectRgn.
svn path=/trunk/; revision=9384
This commit is contained in:
parent
3f9294eaee
commit
394e0f648e
1 changed files with 13 additions and 39 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: region.c,v 1.51 2004/05/10 17:07:20 weiden Exp $ */
|
/* $Id: region.c,v 1.52 2004/05/14 16:56:48 navaraf Exp $ */
|
||||||
#include <w32k.h>
|
#include <w32k.h>
|
||||||
#include <win32k/float.h>
|
#include <win32k/float.h>
|
||||||
|
|
||||||
|
@ -1711,47 +1711,21 @@ NtGdiCreatePolyPolygonRgn(CONST PPOINT pt,
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRGN
|
HRGN STDCALL
|
||||||
STDCALL
|
NtGdiCreateRectRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
|
||||||
NtGdiCreateRectRgn(INT LeftRect,
|
|
||||||
INT TopRect,
|
|
||||||
INT RightRect,
|
|
||||||
INT BottomRect)
|
|
||||||
{
|
{
|
||||||
HRGN hRgn;
|
HRGN hRgn;
|
||||||
PROSRGNDATA pRgnData;
|
|
||||||
PRECT pRect;
|
|
||||||
|
|
||||||
if (RightRect < LeftRect || BottomRect < TopRect)
|
/* Allocate region data structure with space for 1 RECT */
|
||||||
{
|
if ((hRgn = RGNDATA_AllocRgn(1)))
|
||||||
DPRINT1("Invalid parameters (%d, %d) - (%d, %d)\n", LeftRect, TopRect, RightRect, BottomRect);
|
{
|
||||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
if (NtGdiSetRectRgn(hRgn, LeftRect, TopRect, RightRect, BottomRect))
|
||||||
return NULL;
|
return hRgn;
|
||||||
}
|
NtGdiDeleteObject(hRgn);
|
||||||
|
}
|
||||||
|
|
||||||
/* Allocate region data structure with space for 1 RECT */
|
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
if ((hRgn = RGNDATA_AllocRgn(1)))
|
return NULL;
|
||||||
{
|
|
||||||
if ((pRgnData = RGNDATA_LockRgn(hRgn)))
|
|
||||||
{
|
|
||||||
pRect = (PRECT)pRgnData->Buffer;
|
|
||||||
ASSERT(pRect);
|
|
||||||
|
|
||||||
/* Fill in the region data header */
|
|
||||||
pRgnData->rdh.iType = (LeftRect == RightRect || TopRect == BottomRect) ? NULLREGION : SIMPLEREGION;
|
|
||||||
NtGdiSetRect(&(pRgnData->rdh.rcBound), LeftRect, TopRect, RightRect, BottomRect);
|
|
||||||
|
|
||||||
/* use NtGdiCopyRect when implemented */
|
|
||||||
NtGdiSetRect(pRect, LeftRect, TopRect, RightRect, BottomRect);
|
|
||||||
RGNDATA_UnlockRgn(hRgn);
|
|
||||||
|
|
||||||
return hRgn;
|
|
||||||
}
|
|
||||||
NtGdiDeleteObject( hRgn );
|
|
||||||
}
|
|
||||||
|
|
||||||
DPRINT1("NtGdiCreateRectRgn: can't allocate region\n");
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HRGN STDCALL
|
HRGN STDCALL
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue