Author: tkreuzer
Date: Wed Jan 2 10:54:54 2013
New Revision: 58099
URL:
http://svn.reactos.org/svn/reactos?rev=58099&view=rev
Log:
[GDI32]
Set correct last error code in GetClipRgn. Fixes regression from r58089.
Modified:
trunk/reactos/win32ss/gdi/gdi32/objects/region.c
Modified: trunk/reactos/win32ss/gdi/gdi32/objects/region.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
==============================================================================
--- trunk/reactos/win32ss/gdi/gdi32/objects/region.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/gdi32/objects/region.c [iso-8859-1] Wed Jan 2 10:54:54
2013
@@ -700,7 +700,18 @@
HRGN hrgn
)
{
- INT Ret = NtGdiGetRandomRgn(hdc, hrgn, CLIPRGN);
+ INT Ret;
+
+ /* Check if DC handle is valid */
+ if (!GdiGetDcAttr(hdc))
+ {
+ /* Last error code differs from what NtGdiGetRandomRgn returns */
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return 0;
+ }
+
+ Ret = NtGdiGetRandomRgn(hdc, hrgn, CLIPRGN);
+
// if (Ret)
// {
// if(GetLayout(hdc) & LAYOUT_RTL) MirrorRgnDC(hdc,(HRGN)Ret, NULL);