Alexandre Julliard : gdi32: Return copies of the region in InquireVisRgn16 and GetClipRgn16.

Alexandre Julliard julliard at winehq.org
Tue Nov 17 09:28:19 CST 2009


Module: wine
Branch: master
Commit: 61925b7e89f51c35b4d52c5b7050b210c9ac7186
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=61925b7e89f51c35b4d52c5b7050b210c9ac7186

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Nov 17 12:26:04 2009 +0100

gdi32: Return copies of the region in InquireVisRgn16 and GetClipRgn16.

---

 dlls/gdi32/gdi16.c |   26 ++++++++++----------------
 1 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/dlls/gdi32/gdi16.c b/dlls/gdi32/gdi16.c
index 8c4f79b..bd535d1 100644
--- a/dlls/gdi32/gdi16.c
+++ b/dlls/gdi32/gdi16.c
@@ -3659,14 +3659,11 @@ DWORD WINAPI SetDCOrg16( HDC16 hdc16, INT16 x, INT16 y )
  */
 HRGN16 WINAPI InquireVisRgn16( HDC16 hdc )
 {
-    HRGN16 ret = 0;
-    DC * dc = get_dc_ptr( HDC_32(hdc) );
-    if (dc)
-    {
-        ret = HRGN_16(dc->hVisRgn);
-        release_dc_ptr( dc );
-    }
-    return ret;
+    static HRGN hrgn;
+
+    if (!hrgn) hrgn = CreateRectRgn( 0, 0, 0, 0 );
+    GetRandomRgn( HDC_32(hdc), hrgn, SYSRGN );
+    return HRGN_16(hrgn);
 }
 
 
@@ -3760,14 +3757,11 @@ INT16 WINAPI RestoreVisRgn16( HDC16 hdc16 )
  */
 HRGN16 WINAPI GetClipRgn16( HDC16 hdc )
 {
-    HRGN16 ret = 0;
-    DC * dc = get_dc_ptr( HDC_32(hdc) );
-    if (dc)
-    {
-        ret = HRGN_16(dc->hClipRgn);
-        release_dc_ptr( dc );
-    }
-    return ret;
+    static HRGN hrgn;
+
+    if (!hrgn) hrgn = CreateRectRgn( 0, 0, 0, 0 );
+    GetClipRgn( HDC_32(hdc), hrgn );
+    return HRGN_16(hrgn);
 }
 
 




More information about the wine-cvs mailing list