Author: greatlrd
Date: Sun Jul 29 17:12:20 2007
New Revision: 28001
URL:
http://svn.reactos.org/svn/reactos?rev=28001&view=rev
Log:
partly implement NtGdiGetRandomRgn, we do not support metadc, so we will fail on thuse
wine test for this api.
The implemetions are base partly on wine and msdn
Modified:
trunk/reactos/dll/win32/gdi32/gdi32.def
trunk/reactos/dll/win32/gdi32/misc/stubs.c
trunk/reactos/include/psdk/ntgdi.h
trunk/reactos/subsystems/win32/win32k/objects/region.c
trunk/reactos/tools/nci/w32ksvc.db
Modified: trunk/reactos/dll/win32/gdi32/gdi32.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/gdi32.def?…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/gdi32.def (original)
+++ trunk/reactos/dll/win32/gdi32/gdi32.def Sun Jul 29 17:12:20 2007
@@ -423,7 +423,7 @@
GetPixelFormat@4
GetPolyFillMode@4=NtGdiGetPolyFillMode@4
GetROP2@4=NtGdiGetROP2@4
-GetRandomRgn@12
+GetRandomRgn@12=NtGdiGetRandomRgn@12
GetRasterizerCaps@8
GetRegionData@12=NtGdiGetRegionData@12
GetRelAbs@8
Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/misc/stubs.c (original)
+++ trunk/reactos/dll/win32/gdi32/misc/stubs.c Sun Jul 29 17:12:20 2007
@@ -1295,21 +1295,6 @@
}
-/*
- * @unimplemented
- */
-INT
-STDCALL
-GetRandomRgn(
- HDC a0,
- HRGN a1,
- INT a2
- )
-{
- UNIMPLEMENTED;
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
-}
/*
Modified: trunk/reactos/include/psdk/ntgdi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntgdi.h?rev=2…
==============================================================================
--- trunk/reactos/include/psdk/ntgdi.h (original)
+++ trunk/reactos/include/psdk/ntgdi.h Sun Jul 29 17:12:20 2007
@@ -2633,6 +2633,15 @@
W32KAPI
INT
APIENTRY
+NtGdiGetRandomRgn(
+ IN HDC hDC,
+ OUT HRGN hDest,
+ IN INT iCode
+);
+
+W32KAPI
+INT
+APIENTRY
NtGdiGetRgnBox(
IN HRGN hrgn,
OUT LPRECT prcOut
Modified: trunk/reactos/subsystems/win32/win32k/objects/region.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/region.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/region.c Sun Jul 29 17:12:20 2007
@@ -2344,6 +2344,67 @@
}
+/* See wine, msdn, osr and Feng Yuan - Windows Graphics Programming Win32 Gdi And
Directdraw */
+INT STDCALL
+NtGdiGetRandomRgn(HDC hDC, HRGN hDest, INT iCode)
+{
+ PDC pDC;
+ HRGN hSrc = NULL;
+ POINT org;
+
+ if ((hDC == NULL) || (hDest == NULL))
+ {
+ return -1;
+ }
+ if ((iCode<1 ) || (iCode>4 ))
+ {
+ return -1;
+ }
+
+ pDC = DC_LockDc(hDC);
+ if (pDC == NULL)
+ {
+ return -1;
+ }
+
+ switch (iCode)
+ {
+ case 1:
+ hSrc = pDC->w.hClipRgn;
+ break;
+ case 2:
+ //hSrc = dc->hMetaRgn;
+ DPRINT1("hMetaRgn not implement\n");
+ DC_UnlockDc(pDC);
+ return -1;
+ break;
+ case 3:
+ DPRINT1("waring : hMetaRgn not implement\n");
+ //hSrc = dc->hMetaClipRgn;
+ if(!hSrc)
+ {
+ hSrc = pDC->w.hClipRgn;
+ }
+ //if(!hSrc) rgn = dc->hMetaRgn;
+ break;
+ case 4:
+ hSrc = pDC->w.hVisRgn;
+ }
+ if (hSrc)
+ {
+ NtGdiCombineRgn(hDest, hSrc, 0, RGN_COPY);
+ }
+ if (iCode == SYSRGN)
+ {
+ IntGdiGetDCOrgEx(pDC, &org);
+ NtGdiOffsetRgn(hDest, org.x, org.y );
+ }
+
+ DC_UnlockDc(pDC);
+
+ return (hSrc != 0);
+}
+
INT STDCALL
NtGdiGetRgnBox(HRGN hRgn,
LPRECT pRect)
@@ -2428,13 +2489,13 @@
DPRINT("NtGdiOffsetRgn: hRgn %d Xoffs %d Yoffs %d rgn %x\n", hRgn, XOffset,
YOffset, rgn );
if( !rgn ){
- DPRINT("NtGdiOffsetRgn: hRgn error\n");
- return ERROR;
+ DPRINT("NtGdiOffsetRgn: hRgn error\n");
+ return ERROR;
}
if(XOffset || YOffset) {
int nbox = rgn->rdh.nCount;
- PRECT pbox = (PRECT)rgn->Buffer;
+ PRECT pbox = (PRECT)rgn->Buffer;
if(nbox && pbox) {
while(nbox--) {
@@ -2475,7 +2536,7 @@
BITMAPOBJ *BitmapObj;
if( !dc )
- return FALSE;
+ return FALSE;
if(!(tmpVisRgn = NtGdiCreateRectRgn(0, 0, 0, 0)))
{
Modified: trunk/reactos/tools/nci/w32ksvc.db
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/nci/w32ksvc.db?rev=2…
==============================================================================
--- trunk/reactos/tools/nci/w32ksvc.db (original)
+++ trunk/reactos/tools/nci/w32ksvc.db Sun Jul 29 17:12:20 2007
@@ -615,3 +615,4 @@
NtGdiDdUnlockD3D 2
NtGdiDdUpdateOverlay 3
NtGdiDdWaitForVerticalBlank 2
+NtGdiGetRandomRgn 3