[ros-dev] [ros-diffs] [jimtabor] 73475: [Win32SS|RTL] - Fix clipping for Draw Text. Inspired by Katayama Hirofumi MZ patch and ComCtl32/RichEd20/UxThmems. See CORE-2201.

Thomas Faber thomas.faber at reactos.org
Sun Dec 25 16:35:00 UTC 2016


On 2016-12-22 11:39, jimtabor at svn.reactos.org wrote:
> +#ifndef _WIN32K_ ///// Fix CORE-2201.
> +    if (!(flags & DT_NOCLIP) )
> +    {
> +       int hasClip;
> +       hrgn = CreateRectRgn(0,0,0,0);
> +       if (hrgn)
> +       {
> +          hasClip = GetClipRgn(hdc, hrgn);
> +          // If the region to be retrieved is NULL, the return value is 0.
> +          if (hasClip != 1)
> +          {
> +             DeleteObject(hrgn);
> +             hrgn = NULL;
> +          }
> +          IntersectClipRect(hdc, rect->left, rect->top, rect->right, rect->bottom);
> +       }
> +    }
> +#else
> +    if (!(flags & DT_NOCLIP) )
> +    {
> +       int hasClip;
> +       hrgn = NtGdiCreateRectRgn(0,0,0,0);
> +       if (hrgn)
> +       {
> +          hasClip = NtGdiGetRandomRgn(hdc, hrgn, CLIPRGN);
> +          if (hasClip != 1)
> +          {
> +             GreDeleteObject(hrgn);
> +             hrgn = NULL;
> +          }
> +          NtGdiIntersectClipRect(hdc, rect->left, rect->top, rect->right, rect->bottom);
> +       }
> +    }
> +#endif /////

Any particular reason not to simply do the NtGdi call in both user
and kernel? Looks like they should be doing the exact same thing.



More information about the Ros-dev mailing list