ReactOS 0.4.16-dev-258-g81860b4
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

 DBG_DEFAULT_CHANNEL (GdiClipRgn)
 
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 91 of file cliprgn.c.

98{
99 int Ret = ERROR;
100 PREGION prgnNClip, prgnOrigClip = dc->dclevel.prgnClip;
101
102 //
103 // No Coping Regions and no intersecting Regions or an User calling w NULL Region or have the Original Clip Region.
104 //
105 if (fnMode != RGN_COPY && (fnMode != RGN_AND || !prgn || prgnOrigClip))
106 {
107 prgnNClip = IntSysCreateRectpRgn(0, 0, 0, 0);
108
109 // Have Original Clip Region.
110 if (prgnOrigClip)
111 {
112 // This will fail on NULL prgn.
113 Ret = IntGdiCombineRgn(prgnNClip, prgnOrigClip, prgn, fnMode);
114
115 if (Ret)
116 {
117 REGION_Delete(prgnOrigClip);
118 dc->dclevel.prgnClip = prgnNClip;
120 }
121 else
122 REGION_Delete(prgnNClip);
123 }
124 else // NULL Original Clip Region, setup a new one and process mode.
125 {
126 PREGION prgnClip;
127 RECTL rcl;
128#if 0
130
131 // See IntSetDefaultRegion.
132
133 rcl.left = 0;
134 rcl.top = 0;
135 rcl.right = dc->dclevel.sizl.cx;
136 rcl.bottom = dc->dclevel.sizl.cy;
137
138 //EngAcquireSemaphoreShared(pdc->ppdev->hsemDevLock);
139 if (dc->ppdev->flFlags & PDEV_META_DEVICE)
140 {
141 pSurface = dc->dclevel.pSurface;
142 if (pSurface && pSurface->flags & PDEV_SURFACE)
143 {
144 rcl.left += dc->ppdev->ptlOrigion.x;
145 rcl.top += dc->ppdev->ptlOrigion.y;
146 rcl.right += dc->ppdev->ptlOrigion.x;
147 rcl.bottom += dc->ppdev->ptlOrigion.y;
148 }
149 }
150 //EngReleaseSemaphore(pdc->ppdev->hsemDevLock);
151//#if 0
152 rcl.left += dc->ptlDCOrig.x;
153 rcl.top += dc->ptlDCOrig.y;
154 rcl.right += dc->ptlDCOrig.x;
155 rcl.bottom += dc->ptlDCOrig.y;
156#endif
157 REGION_GetRgnBox(dc->prgnVis, &rcl);
158
159 prgnClip = IntSysCreateRectpRgnIndirect(&rcl);
160
161 Ret = IntGdiCombineRgn(prgnNClip, prgnClip, prgn, fnMode);
162
163 if (Ret)
164 {
165 dc->dclevel.prgnClip = prgnNClip;
167 }
168 else
169 REGION_Delete(prgnNClip);
170
171 REGION_Delete(prgnClip);
172 }
173 return Ret;
174 }
175
176 // Fall through to normal RectOS mode.
177
178 //
179 // Handle NULL Region and Original Clip Region.
180 //
181 if (!prgn)
182 {
183 if (prgnOrigClip)
184 {
185 REGION_Delete(dc->dclevel.prgnClip);
186 dc->dclevel.prgnClip = NULL;
188 }
189 return SIMPLEREGION;
190 }
191
192 //
193 // Combine the new Clip region with original Clip and caller Region.
194 //
195 if ( prgnOrigClip &&
196 (Ret = IntGdiCombineRgn(prgnOrigClip, prgn, NULL, RGN_COPY)) ) // Clip could fail.
197 {
199 }
200 else // NULL original Clip, just copy caller region to new.
201 {
202 prgnNClip = IntSysCreateRectpRgn(0, 0, 0, 0);
203 REGION_bCopy(prgnNClip, prgn);
204 Ret = REGION_Complexity(prgnNClip);
205 dc->dclevel.prgnClip = prgnNClip;
207 }
208 return Ret;
209}
VOID FASTCALL IntGdiReleaseRaoRgn(PDC pDC)
Definition: cliprgn.c:18
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 741 of file cliprgn.c.

742{
743 // Moved from Release Rao. Though it still gets over written.
744 RECTL_vSetEmptyRect(&pDC->erclClip);
745
746 /* Must have VisRgn set to a valid state! */
747 ASSERT (pDC->prgnVis);
748#if 0 // (w2k3) This works with limitations. (w7u) ReactOS relies on Rao.
749 if ( !pDC->dclevel.prgnClip &&
750 !pDC->dclevel.prgnMeta &&
751 !pDC->prgnAPI)
752 {
753 if (pDC->prgnRao)
754 REGION_Delete(pDC->prgnRao);
755 pDC->prgnRao = NULL;
756
757 REGION_bOffsetRgn(pDC->prgnVis, pDC->ptlDCOrig.x, pDC->ptlDCOrig.y);
758
759 RtlCopyMemory(&pDC->erclClip,
760 &pDC->prgnVis->rdh.rcBound,
761 sizeof(RECTL));
762
763 IntEngUpdateClipRegion(&pDC->co,
764 pDC->prgnVis->rdh.nCount,
765 pDC->prgnVis->Buffer,
766 &pDC->erclClip);
767
768 REGION_bOffsetRgn(pDC->prgnVis, -pDC->ptlDCOrig.x, -pDC->ptlDCOrig.y);
769
770 pDC->fs &= ~DC_DIRTY_RAO;
771 UpdateVisRgn(pDC);
772 return;
773 }
774#endif
775 if (pDC->prgnAPI)
776 {
777 REGION_Delete(pDC->prgnAPI);
778 pDC->prgnAPI = NULL;
779 }
780
781 if (pDC->dclevel.prgnMeta || pDC->dclevel.prgnClip)
782 {
783 pDC->prgnAPI = IntSysCreateRectpRgn(0,0,0,0);
784 if (!pDC->prgnAPI)
785 {
786 /* Best we can do here. Better than crashing. */
787 ERR("Failed to allocate prgnAPI! Expect drawing issues!\n");
788 return;
789 }
790
791 if (!pDC->dclevel.prgnMeta)
792 {
793 REGION_bCopy(pDC->prgnAPI,
794 pDC->dclevel.prgnClip);
795 }
796 else if (!pDC->dclevel.prgnClip)
797 {
798 REGION_bCopy(pDC->prgnAPI,
799 pDC->dclevel.prgnMeta);
800 }
801 else
802 {
803 REGION_bIntersectRegion(pDC->prgnAPI,
804 pDC->dclevel.prgnClip,
805 pDC->dclevel.prgnMeta);
806 }
807 }
808
809 if (pDC->prgnRao)
810 REGION_Delete(pDC->prgnRao);
811
812 pDC->prgnRao = IntSysCreateRectpRgn(0,0,0,0);
813 if (!pDC->prgnRao)
814 {
815 /* Best we can do here. Better than crashing. */
816 ERR("Failed to allocate prgnRao! Expect drawing issues!\n");
817 return;
818 }
819
820 if (pDC->prgnAPI)
821 {
822 REGION_bIntersectRegion(pDC->prgnRao,
823 pDC->prgnVis,
824 pDC->prgnAPI);
825 }
826 else
827 {
828 REGION_bCopy(pDC->prgnRao,
829 pDC->prgnVis);
830 }
831
832
833 REGION_bOffsetRgn(pDC->prgnRao, pDC->ptlDCOrig.x, pDC->ptlDCOrig.y);
834
835 RtlCopyMemory(&pDC->erclClip,
836 &pDC->prgnRao->rdh.rcBound,
837 sizeof(RECTL));
838
839 pDC->fs &= ~DC_DIRTY_RAO;
840 UpdateVisRgn(pDC);
841
842 // pDC->co should be used. Example, CLIPOBJ_cEnumStart uses XCLIPOBJ to build
843 // the rects from region objects rects in pClipRgn->Buffer.
844 // With pDC->co.pClipRgn->Buffer,
845 // pDC->co.pClipRgn = pDC->prgnRao ? pDC->prgnRao : pDC->prgnVis;
846
847 IntEngUpdateClipRegion(&pDC->co,
848 pDC->prgnRao->rdh.nCount,
849 pDC->prgnRao->Buffer,
850 &pDC->erclClip);
851
852 REGION_bOffsetRgn(pDC->prgnRao, -pDC->ptlDCOrig.x, -pDC->ptlDCOrig.y);
853}
#define ERR(fmt,...)
Definition: precomp.h:57
VOID FASTCALL UpdateVisRgn(PDC pdc)
Definition: cliprgn.c:41
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().

◆ DBG_DEFAULT_CHANNEL()

DBG_DEFAULT_CHANNEL ( GdiClipRgn  )

◆ GdiSelectVisRgn()

VOID FASTCALL GdiSelectVisRgn ( HDC  hdc,
PREGION  prgn 
)

Definition at line 59 of file cliprgn.c.

62{
63 DC *dc;
64
65 if (!(dc = DC_LockDc(hdc)))
66 {
68 return;
69 }
70
71 if (!prgn)
72 {
73 DPRINT1("SVR: Setting NULL Region\n");
77 return;
78 }
79
80 dc->fs |= DC_DIRTY_RAO;
81
82 ASSERT(dc->prgnVis != NULL);
83 ASSERT(prgn != NULL);
84
85 REGION_bCopy(dc->prgnVis, prgn);
86 REGION_bOffsetRgn(dc->prgnVis, -dc->ptlDCOrig.x, -dc->ptlDCOrig.y);
87
89}
#define DPRINT1
Definition: precomp.h:8
VOID FASTCALL IntGdiReleaseVisRgn(PDC pDC)
Definition: cliprgn.c:28
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 18 of file cliprgn.c.

19{
20 INT Index = GDI_HANDLE_GET_INDEX(pDC->BaseObject.hHmgr);
22 pDC->fs |= DC_DIRTY_RAO;
23 Entry->Flags |= GDI_ENTRY_VALIDATE_VIS; // Need to validate Vis.
24}
#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 28 of file cliprgn.c.

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

Referenced by GdiSelectVisRgn().

◆ IntGdiSetMetaRgn()

int FASTCALL IntGdiSetMetaRgn ( PDC  pDC)

Definition at line 677 of file cliprgn.c.

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

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 440 of file cliprgn.c.

446{
447 INT iComplexity = ERROR;
448 RECTL rect;
449 PDC pdc;
450 PREGION prgn;
451
452 /* Lock the DC */
453 pdc = DC_LockDc(hdc);
454 if (pdc == NULL)
455 {
457 return ERROR;
458 }
459
460 /* Convert coordinates to device space */
461 rect.left = xLeft;
462 rect.top = yTop;
463 rect.right = xRight;
464 rect.bottom = yBottom;
466 IntLPtoDP(pdc, (LPPOINT)&rect, 2);
467
469 if ( prgn )
470 {
471 iComplexity = IntSelectClipRgn( pdc, prgn, RGN_DIFF );
472
473 REGION_Delete(prgn);
474 }
475
476 /* Emulate Windows behavior */
477 if (iComplexity == SIMPLEREGION)
478 iComplexity = COMPLEXREGION;
479
480 /* Unlock the DC */
481 DC_UnlockDc(pdc);
482
483 return iComplexity;
484}
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 312 of file cliprgn.c.

316{
317 int retval;
318 DC *dc;
319 PREGION prgn;
320
321 if ( fnMode < RGN_AND || fnMode > RGN_COPY )
322 {
324 return ERROR;
325 }
326
327 if (!(dc = DC_LockDc(hDC)))
328 {
330 return ERROR;
331 }
332
333 prgn = REGION_LockRgn(hrgn);
334
335 if ((prgn == NULL) && (fnMode != RGN_COPY))
336 {
337 //EngSetLastError(ERROR_INVALID_HANDLE); doesn't set this.
338 retval = ERROR;
339 }
340 else
341 {
342#if 0 // Testing GDI Batch.
343 {
344 RECTL rcl;
345 if (prgn)
346 REGION_GetRgnBox(prgn, &rcl);
347 else
348 fnMode |= GDIBS_NORECT;
349 retval = IntGdiExtSelectClipRect(dc, &rcl, fnMode);
350 }
351#else
352 retval = IntGdiExtSelectClipRgn(dc, prgn, fnMode);
353#endif
354 }
355
356 if (prgn)
357 REGION_UnlockRgn(prgn);
358
360 return retval;
361}
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 488 of file cliprgn.c.

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

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 539 of file cliprgn.c.

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

598{
599 BOOL ret = FALSE;
600 PDC dc;
601 PREGION prgn;
602
603 if(!(dc = DC_LockDc(hDC)))
604 {
606 return FALSE;
607 }
608
609 prgn = dc->prgnRao ? dc->prgnRao : dc->prgnVis;
610
611 if (prgn)
612 {
613 POINT pt = {X, Y};
614 IntLPtoDP(dc, &pt, 1);
615 ret = REGION_PtInRegion(prgn, pt.x, pt.y);
616 }
617
619
620 return ret;
621}
#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 625 of file cliprgn.c.

628{
630 PDC dc = DC_LockDc(hDC);
631 BOOL Result = FALSE;
632 RECTL Rect;
633 PREGION prgn;
634
635 if (!dc)
636 {
638 return FALSE;
639 }
640
642 {
643 ProbeForRead(UnsafeRect,
644 sizeof(RECT),
645 1);
646 Rect = *UnsafeRect;
647 }
649 {
651 }
652 _SEH2_END;
653
654 if(!NT_SUCCESS(Status))
655 {
658 return FALSE;
659 }
660
661 if (dc->fs & DC_DIRTY_RAO)
663
664 prgn = dc->prgnRao ? dc->prgnRao : dc->prgnVis;
665 if (prgn)
666 {
667 IntLPtoDP(dc, (LPPOINT)&Rect, 2);
669 }
671
672 return Result;
673}
LONG NTSTATUS
Definition: precomp.h:26
VOID FASTCALL CLIPPING_UpdateGCRegion(PDC pDC)
Definition: cliprgn.c:741
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
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:165
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:66
#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 723 of file cliprgn.c.

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

◆ UpdateVisRgn()

VOID FASTCALL UpdateVisRgn ( PDC  pdc)

Definition at line 41 of file cliprgn.c.

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

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