make NtGdiGetRandomRgn behave more like on XP, 33/34 tests now passing in w32knapi test

svn path=/trunk/; revision=28233
This commit is contained in:
Timo Kreuzer 2007-08-08 00:28:08 +00:00
parent 8f82a2f3ed
commit 18f3bc28a0

View file

@ -2349,22 +2349,15 @@ UnsafeIntGetRgnBox(PROSRGNDATA Rgn,
INT STDCALL INT STDCALL
NtGdiGetRandomRgn(HDC hDC, HRGN hDest, INT iCode) NtGdiGetRandomRgn(HDC hDC, HRGN hDest, INT iCode)
{ {
INT ret = 0;
PDC pDC; PDC pDC;
HRGN hSrc = NULL; HRGN hSrc = NULL;
POINT org; POINT org;
if ((hDC == NULL) || (hDest == NULL))
{
return -1;
}
if ((iCode<1 ) || (iCode>4 ))
{
return -1;
}
pDC = DC_LockDc(hDC); pDC = DC_LockDc(hDC);
if (pDC == NULL) if (pDC == NULL)
{ {
SetLastWin32Error(ERROR_INVALID_HANDLE);
return -1; return -1;
} }
@ -2375,12 +2368,12 @@ NtGdiGetRandomRgn(HDC hDC, HRGN hDest, INT iCode)
break; break;
case 2: case 2:
//hSrc = dc->hMetaRgn; //hSrc = dc->hMetaRgn;
DPRINT1("hMetaRgn not implement\n"); DPRINT1("hMetaRgn not implemented\n");
DC_UnlockDc(pDC); DC_UnlockDc(pDC);
return -1; return -1;
break; break;
case 3: case 3:
DPRINT1("waring : hMetaRgn not implement\n"); DPRINT1("hMetaRgn not implemented\n");
//hSrc = dc->hMetaClipRgn; //hSrc = dc->hMetaClipRgn;
if(!hSrc) if(!hSrc)
{ {
@ -2390,10 +2383,20 @@ NtGdiGetRandomRgn(HDC hDC, HRGN hDest, INT iCode)
break; break;
case 4: case 4:
hSrc = pDC->w.hVisRgn; hSrc = pDC->w.hVisRgn;
break;
default:
hSrc = 0;
} }
if (hSrc) if (hSrc)
{ {
NtGdiCombineRgn(hDest, hSrc, 0, RGN_COPY); if(NtGdiCombineRgn(hDest, hSrc, 0, RGN_COPY) == ERROR)
{
ret = -1;
}
else
{
ret = 1;
}
} }
if (iCode == SYSRGN) if (iCode == SYSRGN)
{ {
@ -2403,7 +2406,7 @@ NtGdiGetRandomRgn(HDC hDC, HRGN hDest, INT iCode)
DC_UnlockDc(pDC); DC_UnlockDc(pDC);
return (hSrc != 0); return ret;
} }
INT STDCALL INT STDCALL