ReactOS 0.4.15-dev-8002-gbbb3b00
cliprgn.c File Reference
#include <win32k.h>
#include <debug.h>
Include dependency graph for cliprgn.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID FASTCALL IntGdiReleaseRaoRgn (PDC pDC)
 
VOID FASTCALL IntGdiReleaseVisRgn (PDC pDC)
 
VOID FASTCALL UpdateVisRgn (PDC pdc)
 
VOID FASTCALL GdiSelectVisRgn (HDC hdc, PREGION prgn)
 
 _Success_ (return!=ERROR)
 
int APIENTRY NtGdiExtSelectClipRgn (HDC hDC, HRGN hrgn, int fnMode)
 
INT APIENTRY NtGdiExcludeClipRect (_In_ HDC hdc, _In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom)
 
INT APIENTRY NtGdiIntersectClipRect (_In_ HDC hdc, _In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom)
 
INT APIENTRY NtGdiOffsetClipRgn (_In_ HDC hdc, _In_ INT xOffset, _In_ INT yOffset)
 
BOOL APIENTRY NtGdiPtVisible (HDC hDC, int X, int Y)
 
BOOL APIENTRY NtGdiRectVisible (HDC hDC, LPRECT UnsafeRect)
 
int FASTCALL IntGdiSetMetaRgn (PDC pDC)
 
int APIENTRY NtGdiSetMetaRgn (HDC hDC)
 
VOID FASTCALL CLIPPING_UpdateGCRegion (PDC pDC)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 11 of file cliprgn.c.

Function Documentation

◆ _Success_()

_Success_ ( return!  = ERROR)

Definition at line 89 of file cliprgn.c.

96{
97 int Ret = ERROR;
98 PREGION prgnNClip, prgnOrigClip = dc->dclevel.prgnClip;
99
100 //
101 // No Coping Regions and no intersecting Regions or an User calling w NULL Region or have the Original Clip Region.
102 //
103 if (fnMode != RGN_COPY && (fnMode != RGN_AND || !prgn || prgnOrigClip))
104 {
105 prgnNClip = IntSysCreateRectpRgn(0, 0, 0, 0);
106
107 // Have Original Clip Region.
108 if (prgnOrigClip)
109 {
110 // This will fail on NULL prgn.
111 Ret = IntGdiCombineRgn(prgnNClip, prgnOrigClip, prgn, fnMode);
112
113 if (Ret)
114 {
115 REGION_Delete(prgnOrigClip);
116 dc->dclevel.prgnClip = prgnNClip;
118 }
119 else
120 REGION_Delete(prgnNClip);
121 }
122 else // NULL Original Clip Region, setup a new one and process mode.
123 {
124 PREGION prgnClip;
125 RECTL rcl;
126#if 0
128
129 // See IntSetDefaultRegion.
130
131 rcl.left = 0;
132 rcl.top = 0;
133 rcl.right = dc->dclevel.sizl.cx;
134 rcl.bottom = dc->dclevel.sizl.cy;
135
136 //EngAcquireSemaphoreShared(pdc->ppdev->hsemDevLock);
137 if (dc->ppdev->flFlags & PDEV_META_DEVICE)
138 {
139 pSurface = dc->dclevel.pSurface;
140 if (pSurface && pSurface->flags & PDEV_SURFACE)
141 {
142 rcl.left += dc->ppdev->ptlOrigion.x;
143 rcl.top += dc->ppdev->ptlOrigion.y;
144 rcl.right += dc->ppdev->ptlOrigion.x;
145 rcl.bottom += dc->ppdev->ptlOrigion.y;
146 }
147 }
148 //EngReleaseSemaphore(pdc->ppdev->hsemDevLock);
149//#if 0
150 rcl.left += dc->ptlDCOrig.x;
151 rcl.top += dc->ptlDCOrig.y;
152 rcl.right += dc->ptlDCOrig.x;
153 rcl.bottom += dc->ptlDCOrig.y;
154#endif
155 REGION_GetRgnBox(dc->prgnVis, &rcl);
156
157 prgnClip = IntSysCreateRectpRgnIndirect(&rcl);
158
159 Ret = IntGdiCombineRgn(prgnNClip, prgnClip, prgn, fnMode);
160
161 if (Ret)
162 {
163 dc->dclevel.prgnClip = prgnNClip;
165 }
166 else
167 REGION_Delete(prgnNClip);
168
169 REGION_Delete(prgnClip);
170 }
171 return Ret;
172 }
173
174 // Fall through to normal RectOS mode.
175
176 //
177 // Handle NULL Region and Original Clip Region.
178 //
179 if (!prgn)
180 {
181 if (prgnOrigClip)
182 {
183 REGION_Delete(dc->dclevel.prgnClip);
184 dc->dclevel.prgnClip = NULL;
186 }
187 return SIMPLEREGION;
188 }
189
190 //
191 // Combine the new Clip region with original Clip and caller Region.
192 //
193 if ( prgnOrigClip &&
194 (Ret = IntGdiCombineRgn(prgnOrigClip, prgn, NULL, RGN_COPY)) ) // Clip could fail.
195 {
197 }
198 else // NULL original Clip, just copy caller region to new.
199 {
200 prgnNClip = IntSysCreateRectpRgn(0, 0, 0, 0);
201 REGION_bCopy(prgnNClip, prgn);
202 Ret = REGION_Complexity(prgnNClip);
203 dc->dclevel.prgnClip = prgnNClip;
205 }
206 return Ret;
207}
VOID FASTCALL IntGdiReleaseRaoRgn(PDC pDC)
Definition: cliprgn.c:16
BOOL FASTCALL REGION_bCopy(PREGION, PREGION)
Definition: region.c:1828
#define NULL
Definition: types.h:112
#define ERROR(name)
Definition: error_private.h:53
static const WCHAR dc[]
@ PDEV_META_DEVICE
Definition: pdevobj.h:20
#define IntSysCreateRectpRgnIndirect(prc)
Definition: region.h:93
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
Definition: region.h:8
@ PDEV_SURFACE
Definition: surface.h:81
INT FASTCALL REGION_Complexity(PREGION prgn)
Definition: region.c:554
VOID FASTCALL REGION_Delete(PREGION pRgn)
Definition: region.c:2449
INT FASTCALL REGION_GetRgnBox(PREGION Rgn, PRECTL pRect)
Definition: region.c:2543
PREGION FASTCALL IntSysCreateRectpRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
Definition: region.c:2407
INT FASTCALL IntGdiCombineRgn(PREGION prgnDest, PREGION prgnSrc1, PREGION prgnSrc2, INT iCombineMode)
Definition: region.c:2487
_In_ DD_SURFACE_LOCAL * pSurface
Definition: winddi.h:3481
#define RGN_COPY
Definition: wingdi.h:357
#define RGN_AND
Definition: wingdi.h:356
#define SIMPLEREGION
Definition: wingdi.h:362

◆ CLIPPING_UpdateGCRegion()

VOID FASTCALL CLIPPING_UpdateGCRegion ( PDC  pDC)

Definition at line 739 of file cliprgn.c.

740{
741 // Moved from Release Rao. Though it still gets over written.
742 RECTL_vSetEmptyRect(&pDC->erclClip);
743
744 /* Must have VisRgn set to a valid state! */
745 ASSERT (pDC->prgnVis);
746#if 0 // (w2k3) This works with limitations. (w7u) ReactOS relies on Rao.
747 if ( !pDC->dclevel.prgnClip &&
748 !pDC->dclevel.prgnMeta &&
749 !pDC->prgnAPI)
750 {
751 if (pDC->prgnRao)
752 REGION_Delete(pDC->prgnRao);
753 pDC->prgnRao = NULL;
754
755 REGION_bOffsetRgn(pDC->prgnVis, pDC->ptlDCOrig.x, pDC->ptlDCOrig.y);
756
757 RtlCopyMemory(&pDC->erclClip,
758 &pDC->prgnVis->rdh.rcBound,
759 sizeof(RECTL));
760
761 IntEngUpdateClipRegion(&pDC->co,
762 pDC->prgnVis->rdh.nCount,
763 pDC->prgnVis->Buffer,
764 &pDC->erclClip);
765
766 REGION_bOffsetRgn(pDC->prgnVis, -pDC->ptlDCOrig.x, -pDC->ptlDCOrig.y);
767
768 pDC->fs &= ~DC_DIRTY_RAO;
769 UpdateVisRgn(pDC);
770 return;
771 }
772#endif
773 if (pDC->prgnAPI)
774 {
775 REGION_Delete(pDC->prgnAPI);
776 pDC->prgnAPI = NULL;
777 }
778
779 if (pDC->prgnRao)
780 REGION_Delete(pDC->prgnRao);
781
782 pDC->prgnRao = IntSysCreateRectpRgn(0,0,0,0);
783
784 ASSERT(pDC->prgnRao);
785
786 if (pDC->dclevel.prgnMeta || pDC->dclevel.prgnClip)
787 {
788 pDC->prgnAPI = IntSysCreateRectpRgn(0,0,0,0);
789 if (!pDC->dclevel.prgnMeta)
790 {
791 REGION_bCopy(pDC->prgnAPI,
792 pDC->dclevel.prgnClip);
793 }
794 else if (!pDC->dclevel.prgnClip)
795 {
796 REGION_bCopy(pDC->prgnAPI,
797 pDC->dclevel.prgnMeta);
798 }
799 else
800 {
801 REGION_bIntersectRegion(pDC->prgnAPI,
802 pDC->dclevel.prgnClip,
803 pDC->dclevel.prgnMeta);
804 }
805 }
806
807 if (pDC->prgnAPI)
808 {
809 REGION_bIntersectRegion(pDC->prgnRao,
810 pDC->prgnVis,
811 pDC->prgnAPI);
812 }
813 else
814 {
815 REGION_bCopy(pDC->prgnRao,
816 pDC->prgnVis);
817 }
818
819
820 REGION_bOffsetRgn(pDC->prgnRao, pDC->ptlDCOrig.x, pDC->ptlDCOrig.y);
821
822 RtlCopyMemory(&pDC->erclClip,
823 &pDC->prgnRao->rdh.rcBound,
824 sizeof(RECTL));
825
826 pDC->fs &= ~DC_DIRTY_RAO;
827 UpdateVisRgn(pDC);
828
829 // pDC->co should be used. Example, CLIPOBJ_cEnumStart uses XCLIPOBJ to build
830 // the rects from region objects rects in pClipRgn->Buffer.
831 // With pDC->co.pClipRgn->Buffer,
832 // pDC->co.pClipRgn = pDC->prgnRao ? pDC->prgnRao : pDC->prgnVis;
833
834 IntEngUpdateClipRegion(&pDC->co,
835 pDC->prgnRao->rdh.nCount,
836 pDC->prgnRao->Buffer,
837 &pDC->erclClip);
838
839 REGION_bOffsetRgn(pDC->prgnRao, -pDC->ptlDCOrig.x, -pDC->ptlDCOrig.y);
840}
VOID FASTCALL UpdateVisRgn(PDC pdc)
Definition: cliprgn.c:39
BOOL FASTCALL REGION_bIntersectRegion(PREGION, PREGION, PREGION)
Definition: region.c:1838
#define ASSERT(a)
Definition: mode.c:44
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
VOID FASTCALL IntEngUpdateClipRegion(XCLIPOBJ *Clip, ULONG count, const RECTL *pRect, const RECTL *rcBounds)
Definition: clip.c:173
FORCEINLINE VOID RECTL_vSetEmptyRect(_Out_ RECTL *prcl)
Definition: rect.h:20
BOOL FASTCALL REGION_bOffsetRgn(_Inout_ PREGION prgn, _In_ INT cx, _In_ INT cy)
Definition: region.c:2707

Referenced by DC_vPrepareDCsForBlit(), NtGdiGetBoundsRect(), NtGdiGetRandomRgn(), and NtGdiRectVisible().

◆ GdiSelectVisRgn()

VOID FASTCALL GdiSelectVisRgn ( HDC  hdc,
PREGION  prgn 
)

Definition at line 57 of file cliprgn.c.

60{
61 DC *dc;
62
63 if (!(dc = DC_LockDc(hdc)))
64 {
66 return;
67 }
68
69 if (!prgn)
70 {
71 DPRINT1("SVR: Setting NULL Region\n");
75 return;
76 }
77
78 dc->fs |= DC_DIRTY_RAO;
79
80 ASSERT(dc->prgnVis != NULL);
81 ASSERT(prgn != NULL);
82
83 REGION_bCopy(dc->prgnVis, prgn);
84 REGION_bOffsetRgn(dc->prgnVis, -dc->ptlDCOrig.x, -dc->ptlDCOrig.y);
85
87}
#define DPRINT1
Definition: precomp.h:8
VOID FASTCALL IntGdiReleaseVisRgn(PDC pDC)
Definition: cliprgn.c:26
BOOL FASTCALL IntSetDefaultRegion(PDC)
Definition: dcutil.c:350
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:238
@ DC_DIRTY_RAO
Definition: dc.h:23
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:220
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
HDC hdc
Definition: main.c:9
Definition: polytest.cpp:41
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:22

Referenced by DC_vUpdateDC(), and DceUpdateVisRgn().

◆ IntGdiReleaseRaoRgn()

VOID FASTCALL IntGdiReleaseRaoRgn ( PDC  pDC)

Definition at line 16 of file cliprgn.c.

17{
18 INT Index = GDI_HANDLE_GET_INDEX(pDC->BaseObject.hHmgr);
20 pDC->fs |= DC_DIRTY_RAO;
21 Entry->Flags |= GDI_ENTRY_VALIDATE_VIS; // Need to validate Vis.
22}
#define GDI_HANDLE_GET_INDEX(h)
Definition: gdi.h:28
#define GDI_ENTRY_VALIDATE_VIS
Definition: ntgdihdl.h:40
base of all file and directory entries
Definition: entries.h:83
Definition: gdi.h:2
int32_t INT
Definition: typedefs.h:58
_In_ WDFCOLLECTION _In_ ULONG Index
#define GdiHandleTable
Definition: win32nt.h:37

Referenced by _Success_(), IntGdiReleaseVisRgn(), IntGdiSetMetaRgn(), IntSetDefaultRegion(), and NtGdiOffsetClipRgn().

◆ IntGdiReleaseVisRgn()

VOID FASTCALL IntGdiReleaseVisRgn ( PDC  pDC)

Definition at line 26 of file cliprgn.c.

27{
29 REGION_Delete(pDC->prgnVis);
30 pDC->prgnVis = prgnDefault; // Vis can not be NULL!!!
31}
PREGION prgnDefault
Definition: region.c:129

Referenced by GdiSelectVisRgn().

◆ IntGdiSetMetaRgn()

int FASTCALL IntGdiSetMetaRgn ( PDC  pDC)

Definition at line 675 of file cliprgn.c.

676{
677 INT Ret = ERROR;
678
679 if ( pDC->dclevel.prgnMeta )
680 {
681 if ( pDC->dclevel.prgnClip )
682 {
683 PREGION prgn = IntSysCreateRectpRgn(0,0,0,0);
684 if ( prgn )
685 {
686 if (REGION_bIntersectRegion(prgn, pDC->dclevel.prgnMeta, pDC->dclevel.prgnClip))
687 {
688 // See Restore/SaveDC
689 REGION_Delete(pDC->dclevel.prgnMeta);
690 pDC->dclevel.prgnMeta = prgn;
691
692 REGION_Delete(pDC->dclevel.prgnClip);
693 pDC->dclevel.prgnClip = NULL;
695
696 Ret = REGION_Complexity(pDC->dclevel.prgnMeta);
697 }
698 else
699 REGION_Delete(prgn);
700 }
701 }
702 else
703 Ret = REGION_Complexity(pDC->dclevel.prgnMeta);
704 }
705 else
706 {
707 if ( pDC->dclevel.prgnClip )
708 {
709 Ret = REGION_Complexity(pDC->dclevel.prgnClip);
710 pDC->dclevel.prgnMeta = pDC->dclevel.prgnClip;
711 pDC->dclevel.prgnClip = NULL;
712 }
713 else
714 Ret = SIMPLEREGION;
715 }
716
717 return Ret;
718}

Referenced by NtGdiSetMetaRgn().

◆ NtGdiExcludeClipRect()

INT APIENTRY NtGdiExcludeClipRect ( _In_ HDC  hdc,
_In_ INT  xLeft,
_In_ INT  yTop,
_In_ INT  xRight,
_In_ INT  yBottom 
)

Definition at line 438 of file cliprgn.c.

444{
445 INT iComplexity = ERROR;
446 RECTL rect;
447 PDC pdc;
448 PREGION prgn;
449
450 /* Lock the DC */
451 pdc = DC_LockDc(hdc);
452 if (pdc == NULL)
453 {
455 return ERROR;
456 }
457
458 /* Convert coordinates to device space */
459 rect.left = xLeft;
460 rect.top = yTop;
461 rect.right = xRight;
462 rect.bottom = yBottom;
464 IntLPtoDP(pdc, (LPPOINT)&rect, 2);
465
467 if ( prgn )
468 {
469 iComplexity = IntSelectClipRgn( pdc, prgn, RGN_DIFF );
470
471 REGION_Delete(prgn);
472 }
473
474 /* Emulate Windows behavior */
475 if (iComplexity == SIMPLEREGION)
476 iComplexity = COMPLEXREGION;
477
478 /* Unlock the DC */
479 DC_UnlockDc(pdc);
480
481 return iComplexity;
482}
static BOOLEAN IntLPtoDP(DC *pdc, PPOINTL ppt, UINT count)
Definition: coord.h:182
& rect
Definition: startmenu.cpp:1413
VOID FASTCALL RECTL_vMakeWellOrdered(_Inout_ RECTL *prcl)
Definition: rect.c:81
#define COMPLEXREGION
Definition: wingdi.h:363
#define RGN_DIFF
Definition: wingdi.h:358

Referenced by ExcludeClipRect(), and START_TEST().

◆ NtGdiExtSelectClipRgn()

int APIENTRY NtGdiExtSelectClipRgn ( HDC  hDC,
HRGN  hrgn,
int  fnMode 
)

Definition at line 310 of file cliprgn.c.

314{
315 int retval;
316 DC *dc;
317 PREGION prgn;
318
319 if ( fnMode < RGN_AND || fnMode > RGN_COPY )
320 {
322 return ERROR;
323 }
324
325 if (!(dc = DC_LockDc(hDC)))
326 {
328 return ERROR;
329 }
330
331 prgn = REGION_LockRgn(hrgn);
332
333 if ((prgn == NULL) && (fnMode != RGN_COPY))
334 {
335 //EngSetLastError(ERROR_INVALID_HANDLE); doesn't set this.
336 retval = ERROR;
337 }
338 else
339 {
340#if 0 // Testing GDI Batch.
341 {
342 RECTL rcl;
343 if (prgn)
344 REGION_GetRgnBox(prgn, &rcl);
345 else
346 fnMode |= GDIBS_NORECT;
347 retval = IntGdiExtSelectClipRect(dc, &rcl, fnMode);
348 }
349#else
350 retval = IntGdiExtSelectClipRgn(dc, prgn, fnMode);
351#endif
352 }
353
354 if (prgn)
355 REGION_UnlockRgn(prgn);
356
358 return retval;
359}
static HDC hDC
Definition: 3dtext.c:33
static HRGN hrgn
int FASTCALL IntGdiExtSelectClipRect(PDC, PRECTL, int)
INT FASTCALL IntGdiExtSelectClipRgn(PDC dc, PREGION prgn, int fnMode)
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define GDIBS_NORECT
Definition: ntgdityp.h:507
PREGION FASTCALL REGION_LockRgn(_In_ HRGN hrgn)
Definition: region.c:2358
VOID FASTCALL REGION_UnlockRgn(_In_ PREGION prgn)
Definition: region.c:2373

◆ NtGdiIntersectClipRect()

INT APIENTRY NtGdiIntersectClipRect ( _In_ HDC  hdc,
_In_ INT  xLeft,
_In_ INT  yTop,
_In_ INT  xRight,
_In_ INT  yBottom 
)

Definition at line 486 of file cliprgn.c.

492{
493 INT iComplexity = ERROR;
494 RECTL rect;
495 PDC pdc;
496 PREGION prgn;
497
498 DPRINT("NtGdiIntersectClipRect(%p, %d,%d-%d,%d)\n",
499 hdc, xLeft, yTop, xRight, yBottom);
500
501 /* Lock the DC */
502 pdc = DC_LockDc(hdc);
503 if (!pdc)
504 {
506 return ERROR;
507 }
508
509 /* Convert coordinates to device space */
510 rect.left = xLeft;
511 rect.top = yTop;
512 rect.right = xRight;
513 rect.bottom = yBottom;
515 IntLPtoDP(pdc, (LPPOINT)&rect, 2);
516
518 if ( prgn )
519 {
520 iComplexity = IntSelectClipRgn( pdc, prgn, RGN_AND );
521
522 REGION_Delete(prgn);
523 }
524
525 /* Emulate Windows behavior */
526 if ( iComplexity == SIMPLEREGION )
527 iComplexity = COMPLEXREGION;
528
529 /* Unlock the DC */
530 DC_UnlockDc(pdc);
531
532 return iComplexity;
533}
#define DPRINT
Definition: sndvol32.h:71

Referenced by co_IntDrawCaret(), co_UserExcludeUpdateRgn(), DrawTextExWorker(), IntersectClipRect(), and START_TEST().

◆ NtGdiOffsetClipRgn()

INT APIENTRY NtGdiOffsetClipRgn ( _In_ HDC  hdc,
_In_ INT  xOffset,
_In_ INT  yOffset 
)

Definition at line 537 of file cliprgn.c.

541{
542 INT iComplexity;
543 PDC pdc;
544 POINTL apt[2];
545
546 /* Lock the DC */
547 pdc = DC_LockDc(hdc);
548 if (pdc == NULL)
549 {
551 return ERROR;
552 }
553
554 /* Check if we have a clip region */
555 if (pdc->dclevel.prgnClip != NULL)
556 {
557 /* Convert coordinates into device space. Note that we need to convert
558 2 coordinates to account for rotation / shear / offset */
559 apt[0].x = 0;
560 apt[0].y = 0;
561 apt[1].x = xOffset;
562 apt[1].y = yOffset;
563 IntLPtoDP(pdc, apt, 2);
564
565 /* Offset the clip region */
566 if (!REGION_bOffsetRgn(pdc->dclevel.prgnClip,
567 apt[1].x - apt[0].x,
568 apt[1].y - apt[0].y))
569 {
570 iComplexity = ERROR;
571 }
572 else
573 {
575 UpdateVisRgn(pdc);
576 iComplexity = REGION_Complexity(pdc->dclevel.prgnClip);
577 }
578
579 /* Mark the RAO region as dirty */
580 pdc->fs |= DC_DIRTY_RAO;
581 }
582 else
583 {
584 /* NULL means no clipping, i.e. the "whole" region */
585 iComplexity = SIMPLEREGION;
586 }
587
588 /* Unlock the DC and return the complexity */
589 DC_UnlockDc(pdc);
590 return iComplexity;
591}
int yOffset
Definition: appswitch.c:59
int xOffset
Definition: appswitch.c:59
LONG y
Definition: windef.h:330
LONG x
Definition: windef.h:329

Referenced by OffsetClipRgn(), and START_TEST().

◆ NtGdiPtVisible()

BOOL APIENTRY NtGdiPtVisible ( HDC  hDC,
int  X,
int  Y 
)

Definition at line 593 of file cliprgn.c.

596{
597 BOOL ret = FALSE;
598 PDC dc;
599 PREGION prgn;
600
601 if(!(dc = DC_LockDc(hDC)))
602 {
604 return FALSE;
605 }
606
607 prgn = dc->prgnRao ? dc->prgnRao : dc->prgnVis;
608
609 if (prgn)
610 {
611 POINT pt = {X, Y};
612 IntLPtoDP(dc, &pt, 1);
613 ret = REGION_PtInRegion(prgn, pt.x, pt.y);
614 }
615
617
618 return ret;
619}
#define FALSE
Definition: types.h:117
#define Y(I)
#define pt(x, y)
Definition: drawing.c:79
unsigned int BOOL
Definition: ntddk_ex.h:94
#define X(b, s)
int ret
BOOL FASTCALL REGION_PtInRegion(PREGION prgn, INT X, INT Y)
Definition: region.c:2582

◆ NtGdiRectVisible()

BOOL APIENTRY NtGdiRectVisible ( HDC  hDC,
LPRECT  UnsafeRect 
)

Definition at line 623 of file cliprgn.c.

626{
628 PDC dc = DC_LockDc(hDC);
629 BOOL Result = FALSE;
630 RECTL Rect;
631 PREGION prgn;
632
633 if (!dc)
634 {
636 return FALSE;
637 }
638
640 {
641 ProbeForRead(UnsafeRect,
642 sizeof(RECT),
643 1);
644 Rect = *UnsafeRect;
645 }
647 {
649 }
650 _SEH2_END;
651
652 if(!NT_SUCCESS(Status))
653 {
656 return FALSE;
657 }
658
659 if (dc->fs & DC_DIRTY_RAO)
661
662 prgn = dc->prgnRao ? dc->prgnRao : dc->prgnVis;
663 if (prgn)
664 {
665 IntLPtoDP(dc, (LPPOINT)&Rect, 2);
667 }
669
670 return Result;
671}
LONG NTSTATUS
Definition: precomp.h:26
VOID FASTCALL CLIPPING_UpdateGCRegion(PDC pDC)
Definition: cliprgn.c:739
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
Status
Definition: gdiplustypes.h:25
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:159
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:34
#define STATUS_SUCCESS
Definition: shellext.h:65
VOID FASTCALL SetLastNtError(_In_ NTSTATUS Status)
Definition: error.c:31
BOOL FASTCALL REGION_RectInRegion(PREGION Rgn, const RECTL *rect)
Definition: region.c:2605
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

◆ NtGdiSetMetaRgn()

int APIENTRY NtGdiSetMetaRgn ( HDC  hDC)

Definition at line 721 of file cliprgn.c.

722{
723 INT Ret;
724 PDC pDC = DC_LockDc(hDC);
725
726 if (!pDC)
727 {
729 return ERROR;
730 }
731 Ret = IntGdiSetMetaRgn(pDC);
732
733 DC_UnlockDc(pDC);
734 return Ret;
735}
int FASTCALL IntGdiSetMetaRgn(PDC pDC)
Definition: cliprgn.c:675

◆ UpdateVisRgn()

VOID FASTCALL UpdateVisRgn ( PDC  pdc)

Definition at line 39 of file cliprgn.c.

41{
42 INT Index = GDI_HANDLE_GET_INDEX(pdc->BaseObject.hHmgr);
44
45 /* Setup Vis Region Attribute information to User side */
47 pdc->pdcattr->VisRectRegion.iComplexity = REGION_GetRgnBox(pdc->prgnVis, &pdc->pdcattr->VisRectRegion.Rect);
48 pdc->pdcattr->VisRectRegion.AttrFlags = ATTR_RGN_VALID;
49 pEntry->Flags &= ~GDI_ENTRY_VALIDATE_VIS;
50}
PLIST_ENTRY pEntry
Definition: fxioqueue.cpp:4484
#define ATTR_RGN_VALID
Definition: ntgdihdl.h:195

Referenced by CLIPPING_UpdateGCRegion(), DC_vInitDc(), and NtGdiOffsetClipRgn().