ReactOS  0.4.14-dev-838-g99f979d
cliprgn.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: GNU GPL, See COPYING in the top level directory
3  * PROJECT: ReactOS Win32k subsystem
4  * PURPOSE: Clip region functions
5  * FILE: win32ss/gdi/ntgdi/cliprgn.c
6  * PROGRAMER: Unknown
7  */
8 
9 #include <win32k.h>
10 
11 #define NDEBUG
12 #include <debug.h>
13 
14 VOID
17 {
18  INT Index = GDI_HANDLE_GET_INDEX(pDC->BaseObject.hHmgr);
20  pDC->fs |= DC_FLAG_DIRTY_RAO;
21  Entry->Flags |= GDI_ENTRY_VALIDATE_VIS; // Need to validate Vis.
22 }
23 
24 VOID
27 {
29  REGION_Delete(pDC->prgnVis);
30  pDC->prgnVis = prgnDefault; // Vis can not be NULL!!!
31 }
32 
33 //
34 // Updating Vis Region Attribute for DC Attributes.
35 // BTW: This system region has an user attribute for it.
36 //
37 VOID
40  PDC pdc)
41 {
42  INT Index = GDI_HANDLE_GET_INDEX(pdc->BaseObject.hHmgr);
43  PGDI_TABLE_ENTRY pEntry = &GdiHandleTable->Entries[Index];
44 
45  /* Setup Vis Region Attribute information to User side */
46  pEntry->Flags |= GDI_ENTRY_VALIDATE_VIS;
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 }
51 
52 //
53 // Selecting Vis Region.
54 //
55 VOID
58  HDC hdc,
59  PREGION prgn)
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");
74  DC_UnlockDc(dc);
75  return;
76  }
77 
78  dc->fs |= DC_FLAG_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 
86  DC_UnlockDc(dc);
87 }
88 
89 _Success_(return!=ERROR)
90 int
92 IntSelectClipRgn(
93  _In_ PDC dc,
94  _In_ PREGION prgn,
95  _In_ int fnMode)
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;
127 
128  // See IntSetDefaultRegion.
129 
130  rcl.left = 0;
131  rcl.top = 0;
132  rcl.right = dc->dclevel.sizl.cx;
133  rcl.bottom = dc->dclevel.sizl.cy;
134 
135  //EngAcquireSemaphoreShared(pdc->ppdev->hsemDevLock);
136  if (dc->ppdev->flFlags & PDEV_META_DEVICE)
137  {
138  pSurface = dc->dclevel.pSurface;
139  if (pSurface && pSurface->flags & PDEV_SURFACE)
140  {
141  rcl.left += dc->ppdev->ptlOrigion.x;
142  rcl.top += dc->ppdev->ptlOrigion.y;
143  rcl.right += dc->ppdev->ptlOrigion.x;
144  rcl.bottom += dc->ppdev->ptlOrigion.y;
145  }
146  }
147  //EngReleaseSemaphore(pdc->ppdev->hsemDevLock);
148 #if 0
149  rcl.left += dc->ptlDCOrig.x;
150  rcl.top += dc->ptlDCOrig.y;
151  rcl.right += dc->ptlDCOrig.x;
152  rcl.bottom += dc->ptlDCOrig.y;
153 #endif
154  prgnClip = IntSysCreateRectpRgnIndirect(&rcl);
155 
156  Ret = IntGdiCombineRgn(prgnNClip, prgnClip, prgn, fnMode);
157 
158  if (Ret)
159  {
160  dc->dclevel.prgnClip = prgnNClip;
162  }
163  else
164  REGION_Delete(prgnNClip);
165 
166  REGION_Delete(prgnClip);
167  }
168  return Ret;
169  }
170 
171  // Fall through to normal RectOS mode.
172 
173  //
174  // Handle NULL Region and Original Clip Region.
175  //
176  if (!prgn)
177  {
178  if (prgnOrigClip)
179  {
180  REGION_Delete(dc->dclevel.prgnClip);
181  dc->dclevel.prgnClip = NULL;
183  }
184  return SIMPLEREGION;
185  }
186 
187  //
188  // Combine the new Clip region with original Clip and caller Region.
189  //
190  if ( prgnOrigClip &&
191  (Ret = IntGdiCombineRgn(prgnOrigClip, prgn, NULL, RGN_COPY)) ) // Clip could fail.
192  {
194  }
195  else // NULL original Clip, just copy caller region to new.
196  {
197  prgnNClip = IntSysCreateRectpRgn(0, 0, 0, 0);
198  REGION_bCopy(prgnNClip, prgn);
199  Ret = REGION_Complexity(prgnNClip);
200  dc->dclevel.prgnClip = prgnNClip;
202  }
203  return Ret;
204 }
205 
206 //
207 // Call from Gdi Batch Subsystem.
208 //
209 // Was setup to just handle RGN_COPY only and return VOID, since this was called from Gdi32.
210 // Tested in place of the other, complexity aside.
211 //
212 
213 _Success_(return!=ERROR)
214 int
215 FASTCALL
217  _In_ PDC dc,
218  _In_ PRECTL prcl,
219  _In_ int fnMode)
220 {
221  int Ret = ERROR;
222  PREGION prgn;
223  RECTL rect;
224  BOOL NoRegion = fnMode & GDIBS_NORECT;
225 
226  fnMode &= ~GDIBS_NORECT;
227 
228  if (NoRegion) // NULL Region.
229  {
230  if (fnMode == RGN_COPY)
231  {
232  Ret = IntSelectClipRgn( dc, NULL, RGN_COPY);
233 
234  if (dc->fs & DC_FLAG_DIRTY_RAO)
236 
237  if (Ret) // Copy? Return Vis complexity.
238  Ret = REGION_Complexity(dc->prgnVis);
239  }
240  }
241  else // Have a box to build a region with.
242  { // See CORE-16246 : Needs to be a one box Clip Region.
243  if ( dc->dclevel.prgnClip && (REGION_Complexity(dc->dclevel.prgnClip) == SIMPLEREGION) )
244  {
245  REGION_GetRgnBox(dc->dclevel.prgnClip, &rect);
246 
247  if (prcl->left == rect.left &&
248  prcl->top == rect.top &&
249  prcl->right == rect.right &&
250  prcl->bottom == rect.bottom)
251  {
252  return REGION_Complexity( dc->prgnRao ? dc->prgnRao : dc->prgnVis );
253  }
254  }
255 
257 
258  Ret = IntSelectClipRgn( dc, prgn, fnMode);
259 
260  if (dc->fs & DC_FLAG_DIRTY_RAO)
262 
263  if (Ret) // In this case NtGdiExtSelectClipRgn tests pass.
264  Ret = REGION_Complexity( dc->prgnRao ? dc->prgnRao : dc->prgnVis );
265 
266  REGION_Delete(prgn);
267  }
268  return Ret;
269 }
270 
271 _Success_(return!=ERROR)
272 int
273 FASTCALL
275  _In_ PDC dc,
276  _In_ PREGION prgn,
277  _In_ int fnMode)
278 {
279  int Ret = ERROR;
280 
281  if (!prgn)
282  {
283  if (fnMode == RGN_COPY)
284  {
285  if ((Ret = IntSelectClipRgn( dc, NULL, RGN_COPY)))
286  Ret = REGION_Complexity(dc->prgnVis);
287  }
288  }
289  else
290  {
291  if ((Ret = IntSelectClipRgn( dc, prgn, fnMode)))
292  {
293  DPRINT("IntGdiExtSelectClipRgn A %d\n",Ret);
294  // Update the Rao, it must be this way for now.
295  if (dc->fs & DC_FLAG_DIRTY_RAO)
297 
298  Ret = REGION_Complexity( dc->prgnRao ? dc->prgnRao : dc->prgnVis );
299  DPRINT("IntGdiExtSelectClipRgn B %d\n",Ret);
300  }
301  }
302  return Ret;
303 }
304 
305 int
306 APIENTRY
308  HDC hDC,
309  HRGN hrgn,
310  int fnMode)
311 {
312  int retval;
313  DC *dc;
314  PREGION prgn;
315 
316  if ( fnMode < RGN_AND || fnMode > RGN_COPY )
317  {
319  return ERROR;
320  }
321 
322  if (!(dc = DC_LockDc(hDC)))
323  {
325  return ERROR;
326  }
327 
328  prgn = REGION_LockRgn(hrgn);
329 
330  if ((prgn == NULL) && (fnMode != RGN_COPY))
331  {
332  //EngSetLastError(ERROR_INVALID_HANDLE); doesn't set this.
333  retval = ERROR;
334  }
335  else
336  {
337 #if 0 // Testing GDI Batch.
338  {
339  RECTL rcl;
340  if (prgn)
341  REGION_GetRgnBox(prgn, &rcl);
342  else
343  fnMode |= GDIBS_NORECT;
344  retval = IntGdiExtSelectClipRect(dc, &rcl, fnMode);
345  }
346 #else
347  retval = IntGdiExtSelectClipRgn(dc, prgn, fnMode);
348 #endif
349  }
350 
351  if (prgn)
352  REGION_UnlockRgn(prgn);
353 
354  DC_UnlockDc(dc);
355  return retval;
356 }
357 
358 _Success_(return!=ERROR)
359 INT
360 FASTCALL
361 GdiGetClipBox(
362  _In_ HDC hdc,
363  _Out_ LPRECT prc)
364 {
365  PDC pdc;
366  INT iComplexity;
367 
368  /* Lock the DC */
369  pdc = DC_LockDc(hdc);
370  if (!pdc)
371  {
372  return ERROR;
373  }
374 
375  /* Update RAO region if necessary */
376  if (pdc->fs & DC_FLAG_DIRTY_RAO)
378 
379  /* Check if we have a RAO region (intersection of API and VIS region) */
380  if (pdc->prgnRao)
381  {
382  /* We have a RAO region, use it */
383  iComplexity = REGION_GetRgnBox(pdc->prgnRao, prc);
384  }
385  else
386  {
387  /* No RAO region means no API region, so use the VIS region */
388  ASSERT(pdc->prgnVis);
389  iComplexity = REGION_GetRgnBox(pdc->prgnVis, prc);
390  }
391 
392  /* Unlock the DC */
393  DC_UnlockDc(pdc);
394 
395  /* Convert the rect to logical coordinates */
396  IntDPtoLP(pdc, (LPPOINT)prc, 2);
397 
398  /* Return the complexity */
399  return iComplexity;
400 }
401 
402 _Success_(return!=ERROR)
403 INT
404 APIENTRY
405 NtGdiGetAppClipBox(
406  _In_ HDC hdc,
407  _Out_ LPRECT prc)
408 {
409  RECT rect;
410  INT iComplexity;
411 
412  /* Call the internal function */
413  iComplexity = GdiGetClipBox(hdc, &rect);
414 
415  if (iComplexity != ERROR)
416  {
417  _SEH2_TRY
418  {
419  ProbeForWrite(prc, sizeof(RECT), 1);
420  *prc = rect;
421  }
423  {
424  iComplexity = ERROR;
425  }
426  _SEH2_END
427  }
428 
429  /* Return the complexity */
430  return iComplexity;
431 }
432 
433 INT
434 APIENTRY
436  _In_ HDC hdc,
437  _In_ INT xLeft,
438  _In_ INT yTop,
439  _In_ INT xRight,
440  _In_ INT yBottom)
441 {
442  INT iComplexity = ERROR;
443  RECTL rect;
444  PDC pdc;
445  PREGION prgn;
446 
447  /* Lock the DC */
448  pdc = DC_LockDc(hdc);
449  if (pdc == NULL)
450  {
452  return ERROR;
453  }
454 
455  /* Convert coordinates to device space */
456  rect.left = xLeft;
457  rect.top = yTop;
458  rect.right = xRight;
459  rect.bottom = yBottom;
461  IntLPtoDP(pdc, (LPPOINT)&rect, 2);
462 
464  if ( prgn )
465  {
466  iComplexity = IntSelectClipRgn( pdc, prgn, RGN_DIFF );
467 
468  REGION_Delete(prgn);
469  }
470 
471  /* Emulate Windows behavior */
472  if (iComplexity == SIMPLEREGION)
473  iComplexity = COMPLEXREGION;
474 
475  /* Unlock the DC */
476  DC_UnlockDc(pdc);
477 
478  return iComplexity;
479 }
480 
481 INT
482 APIENTRY
484  _In_ HDC hdc,
485  _In_ INT xLeft,
486  _In_ INT yTop,
487  _In_ INT xRight,
488  _In_ INT yBottom)
489 {
490  INT iComplexity = ERROR;
491  RECTL rect;
492  PDC pdc;
493  PREGION prgn;
494 
495  DPRINT("NtGdiIntersectClipRect(%p, %d,%d-%d,%d)\n",
496  hdc, xLeft, yTop, xRight, yBottom);
497 
498  /* Lock the DC */
499  pdc = DC_LockDc(hdc);
500  if (!pdc)
501  {
503  return ERROR;
504  }
505 
506  /* Convert coordinates to device space */
507  rect.left = xLeft;
508  rect.top = yTop;
509  rect.right = xRight;
510  rect.bottom = yBottom;
512  IntLPtoDP(pdc, (LPPOINT)&rect, 2);
513 
515  if ( prgn )
516  {
517  iComplexity = IntSelectClipRgn( pdc, prgn, RGN_AND );
518 
519  REGION_Delete(prgn);
520  }
521 
522  /* Emulate Windows behavior */
523  if ( iComplexity == SIMPLEREGION )
524  iComplexity = COMPLEXREGION;
525 
526  /* Unlock the DC */
527  DC_UnlockDc(pdc);
528 
529  return iComplexity;
530 }
531 
532 INT
533 APIENTRY
535  _In_ HDC hdc,
536  _In_ INT xOffset,
537  _In_ INT yOffset)
538 {
539  INT iComplexity;
540  PDC pdc;
541  POINTL apt[2];
542 
543  /* Lock the DC */
544  pdc = DC_LockDc(hdc);
545  if (pdc == NULL)
546  {
548  return ERROR;
549  }
550 
551  /* Check if we have a clip region */
552  if (pdc->dclevel.prgnClip != NULL)
553  {
554  /* Convert coordinates into device space. Note that we need to convert
555  2 coordinates to account for rotation / shear / offset */
556  apt[0].x = 0;
557  apt[0].y = 0;
558  apt[1].x = xOffset;
559  apt[1].y = yOffset;
560  IntLPtoDP(pdc, &apt, 2);
561 
562  /* Offset the clip region */
563  if (!REGION_bOffsetRgn(pdc->dclevel.prgnClip,
564  apt[1].x - apt[0].x,
565  apt[1].y - apt[0].y))
566  {
567  iComplexity = ERROR;
568  }
569  else
570  {
571  IntGdiReleaseRaoRgn(pdc);
572  UpdateVisRgn(pdc);
573  iComplexity = REGION_Complexity(pdc->dclevel.prgnClip);
574  }
575 
576  /* Mark the RAO region as dirty */
577  pdc->fs |= DC_FLAG_DIRTY_RAO;
578  }
579  else
580  {
581  /* NULL means no clipping, i.e. the "whole" region */
582  iComplexity = SIMPLEREGION;
583  }
584 
585  /* Unlock the DC and return the complexity */
586  DC_UnlockDc(pdc);
587  return iComplexity;
588 }
589 
591  int X,
592  int Y)
593 {
594  BOOL ret = FALSE;
595  PDC dc;
596  PREGION prgn;
597 
598  if(!(dc = DC_LockDc(hDC)))
599  {
601  return FALSE;
602  }
603 
604  prgn = dc->prgnRao ? dc->prgnRao : dc->prgnVis;
605 
606  if (prgn)
607  {
608  POINT pt = {X, Y};
609  IntLPtoDP(dc, &pt, 1);
610  ret = REGION_PtInRegion(prgn, pt.x, pt.y);
611  }
612 
613  DC_UnlockDc(dc);
614 
615  return ret;
616 }
617 
618 BOOL
619 APIENTRY
621  HDC hDC,
622  LPRECT UnsafeRect)
623 {
625  PDC dc = DC_LockDc(hDC);
626  BOOL Result = FALSE;
627  RECTL Rect;
628  PREGION prgn;
629 
630  if (!dc)
631  {
633  return FALSE;
634  }
635 
636  _SEH2_TRY
637  {
638  ProbeForRead(UnsafeRect,
639  sizeof(RECT),
640  1);
641  Rect = *UnsafeRect;
642  }
644  {
646  }
647  _SEH2_END;
648 
649  if(!NT_SUCCESS(Status))
650  {
651  DC_UnlockDc(dc);
653  return FALSE;
654  }
655 
656  if (dc->fs & DC_FLAG_DIRTY_RAO)
658 
659  prgn = dc->prgnRao ? dc->prgnRao : dc->prgnVis;
660  if (prgn)
661  {
662  IntLPtoDP(dc, (LPPOINT)&Rect, 2);
663  Result = REGION_RectInRegion(prgn, &Rect);
664  }
665  DC_UnlockDc(dc);
666 
667  return Result;
668 }
669 
670 int
671 FASTCALL
673 {
674  INT Ret = ERROR;
675 
676  if ( pDC->dclevel.prgnMeta )
677  {
678  if ( pDC->dclevel.prgnClip )
679  {
680  PREGION prgn = IntSysCreateRectpRgn(0,0,0,0);
681  if ( prgn )
682  {
683  if (REGION_bIntersectRegion(prgn, pDC->dclevel.prgnMeta, pDC->dclevel.prgnClip))
684  {
685  // See Restore/SaveDC
686  REGION_Delete(pDC->dclevel.prgnMeta);
687  pDC->dclevel.prgnMeta = prgn;
688 
689  REGION_Delete(pDC->dclevel.prgnClip);
690  pDC->dclevel.prgnClip = NULL;
691  IntGdiReleaseRaoRgn(pDC);
692 
693  Ret = REGION_Complexity(pDC->dclevel.prgnMeta);
694  }
695  else
696  REGION_Delete(prgn);
697  }
698  }
699  else
700  Ret = REGION_Complexity(pDC->dclevel.prgnMeta);
701  }
702  else
703  {
704  if ( pDC->dclevel.prgnClip )
705  {
706  Ret = REGION_Complexity(pDC->dclevel.prgnClip);
707  pDC->dclevel.prgnMeta = pDC->dclevel.prgnClip;
708  pDC->dclevel.prgnClip = NULL;
709  }
710  else
711  Ret = SIMPLEREGION;
712  }
713 
714  return Ret;
715 }
716 
717 
719 {
720  INT Ret;
721  PDC pDC = DC_LockDc(hDC);
722 
723  if (!pDC)
724  {
726  return ERROR;
727  }
728  Ret = IntGdiSetMetaRgn(pDC);
729 
730  DC_UnlockDc(pDC);
731  return Ret;
732 }
733 
734 VOID
735 FASTCALL
737 {
738  // Moved from Release Rao. Though it still gets over written.
739  RECTL_vSetEmptyRect(&pDC->erclClip);
740 
741  /* Must have VisRgn set to a valid state! */
742  ASSERT (pDC->prgnVis);
743 #if 0 // (w2k3) This works with limitations. (w7u) ReactOS relies on Rao.
744  if ( !pDC->dclevel.prgnClip &&
745  !pDC->dclevel.prgnMeta &&
746  !pDC->prgnAPI)
747  {
748  if (pDC->prgnRao)
749  REGION_Delete(pDC->prgnRao);
750  pDC->prgnRao = NULL;
751 
752  REGION_bOffsetRgn(pDC->prgnVis, pDC->ptlDCOrig.x, pDC->ptlDCOrig.y);
753 
754  RtlCopyMemory(&pDC->erclClip,
755  &pDC->prgnVis->rdh.rcBound,
756  sizeof(RECTL));
757 
758  IntEngUpdateClipRegion(&pDC->co,
759  pDC->prgnVis->rdh.nCount,
760  pDC->prgnVis->Buffer,
761  &pDC->erclClip);
762 
763  REGION_bOffsetRgn(pDC->prgnVis, -pDC->ptlDCOrig.x, -pDC->ptlDCOrig.y);
764 
765  pDC->fs &= ~DC_FLAG_DIRTY_RAO;
766  UpdateVisRgn(pDC);
767  return;
768  }
769 #endif
770  if (pDC->prgnAPI)
771  {
772  REGION_Delete(pDC->prgnAPI);
773  pDC->prgnAPI = NULL;
774  }
775 
776  if (pDC->prgnRao)
777  REGION_Delete(pDC->prgnRao);
778 
779  pDC->prgnRao = IntSysCreateRectpRgn(0,0,0,0);
780 
781  ASSERT(pDC->prgnRao);
782 
783  if (pDC->dclevel.prgnMeta || pDC->dclevel.prgnClip)
784  {
785  pDC->prgnAPI = IntSysCreateRectpRgn(0,0,0,0);
786  if (!pDC->dclevel.prgnMeta)
787  {
788  REGION_bCopy(pDC->prgnAPI,
789  pDC->dclevel.prgnClip);
790  }
791  else if (!pDC->dclevel.prgnClip)
792  {
793  REGION_bCopy(pDC->prgnAPI,
794  pDC->dclevel.prgnMeta);
795  }
796  else
797  {
798  REGION_bIntersectRegion(pDC->prgnAPI,
799  pDC->dclevel.prgnClip,
800  pDC->dclevel.prgnMeta);
801  }
802  }
803 
804  if (pDC->prgnAPI)
805  {
806  REGION_bIntersectRegion(pDC->prgnRao,
807  pDC->prgnVis,
808  pDC->prgnAPI);
809  }
810  else
811  {
812  REGION_bCopy(pDC->prgnRao,
813  pDC->prgnVis);
814  }
815 
816 
817  REGION_bOffsetRgn(pDC->prgnRao, pDC->ptlDCOrig.x, pDC->ptlDCOrig.y);
818 
819  RtlCopyMemory(&pDC->erclClip,
820  &pDC->prgnRao->rdh.rcBound,
821  sizeof(RECTL));
822 
823  pDC->fs &= ~DC_FLAG_DIRTY_RAO;
824  UpdateVisRgn(pDC);
825 
826  // pDC->co should be used. Example, CLIPOBJ_cEnumStart uses XCLIPOBJ to build
827  // the rects from region objects rects in pClipRgn->Buffer.
828  // With pDC->co.pClipRgn->Buffer,
829  // pDC->co.pClipRgn = pDC->prgnRao ? pDC->prgnRao : pDC->prgnVis;
830 
831  IntEngUpdateClipRegion(&pDC->co,
832  pDC->prgnRao->rdh.nCount,
833  pDC->prgnRao->Buffer,
834  &pDC->erclClip);
835 
836  REGION_bOffsetRgn(pDC->prgnRao, -pDC->ptlDCOrig.x, -pDC->ptlDCOrig.y);
837 }
838 
839 /* EOF */
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define GDI_HANDLE_GET_INDEX(h)
Definition: gdi.h:28
#define IntDPtoLP(pdc, ppt, count)
Definition: coord.h:13
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
BOOL FASTCALL REGION_bIntersectRegion(PREGION, PREGION, PREGION)
Definition: region.c:1854
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
VOID FASTCALL GdiSelectVisRgn(HDC hdc, PREGION prgn)
Definition: cliprgn.c:57
FORCEINLINE VOID RECTL_vSetEmptyRect(_Out_ RECTL *prcl)
Definition: rect.h:20
#define Y(I)
#define pt(x, y)
Definition: drawing.c:79
#define ERROR(name)
Definition: error_private.h:53
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
LONG NTSTATUS
Definition: precomp.h:26
static HDC
Definition: imagelist.c:92
VOID FASTCALL UpdateVisRgn(PDC pdc)
Definition: cliprgn.c:39
#define COMPLEXREGION
Definition: wingdi.h:362
VOID FASTCALL IntGdiReleaseVisRgn(PDC pDC)
Definition: cliprgn.c:26
long bottom
Definition: polytest.cpp:53
BOOL FASTCALL REGION_bOffsetRgn(_Inout_ PREGION prgn, _In_ INT cx, _In_ INT cy)
Definition: region.c:2727
INT APIENTRY NtGdiOffsetClipRgn(_In_ HDC hdc, _In_ INT xOffset, _In_ INT yOffset)
Definition: cliprgn.c:534
INT APIENTRY NtGdiIntersectClipRect(_In_ HDC hdc, _In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom)
Definition: cliprgn.c:483
PREGION FASTCALL REGION_LockRgn(_In_ HRGN hrgn)
Definition: region.c:2377
#define FASTCALL
Definition: nt_native.h:50
int32_t INT
Definition: typedefs.h:56
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
& rect
Definition: startmenu.cpp:1413
int FASTCALL IntGdiExtSelectClipRect(PDC, PRECTL, int)
LONG y
Definition: windef.h:330
_SEH2_TRY
Definition: create.c:4250
#define ATTR_RGN_VALID
Definition: ntgdihdl.h:210
INT FASTCALL IntGdiExtSelectClipRgn(PDC dc, PREGION prgn, int fnMode)
#define RGN_AND
Definition: wingdi.h:355
VOID FASTCALL IntGdiReleaseRaoRgn(PDC pDC)
Definition: cliprgn.c:16
long right
Definition: polytest.cpp:53
PREGION FASTCALL IntSysCreateRectpRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
Definition: region.c:2426
unsigned int BOOL
Definition: ntddk_ex.h:94
long top
Definition: polytest.cpp:53
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
_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:426
#define _Out_
Definition: no_sal2.h:323
BOOL FASTCALL REGION_RectInRegion(PREGION Rgn, const RECTL *rect)
Definition: region.c:2625
void DPRINT(...)
Definition: polytest.cpp:61
Definition: region.h:7
long left
Definition: polytest.cpp:53
INT FASTCALL IntGdiCombineRgn(PREGION prgnDest, PREGION prgnSrc1, PREGION prgnSrc2, INT iCombineMode)
Definition: region.c:2506
#define IntSysCreateRectpRgnIndirect(prc)
Definition: region.h:93
#define GdiHandleTable
Definition: win32nt.h:35
Definition: polytest.cpp:40
PREGION prgnDefault
Definition: region.c:130
_In_ DD_SURFACE_LOCAL * pSurface
Definition: winddi.h:3481
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
BOOL FASTCALL REGION_bCopy(PREGION, PREGION)
Definition: region.c:1844
static const UCHAR Index[8]
Definition: usbohci.c:18
#define DC_FLAG_DIRTY_RAO
Definition: ntgdihdl.h:132
int APIENTRY NtGdiSetMetaRgn(HDC hDC)
Definition: cliprgn.c:718
VOID FASTCALL CLIPPING_UpdateGCRegion(PDC pDC)
Definition: cliprgn.c:736
LONG x
Definition: windef.h:329
#define GDIBS_NORECT
Definition: ntgdityp.h:506
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
BOOL APIENTRY NtGdiPtVisible(HDC hDC, int X, int Y)
Definition: cliprgn.c:590
#define IntLPtoDP(pdc, ppt, count)
Definition: coord.h:7
int ret
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
HDC hdc
Definition: main.c:9
static HRGN hrgn
Definition: win.c:55
INT APIENTRY NtGdiExcludeClipRect(_In_ HDC hdc, _In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom)
Definition: cliprgn.c:435
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:36
BOOL FASTCALL IntSetDefaultRegion(PDC)
Definition: dcutil.c:350
Status
Definition: gdiplustypes.h:24
#define RGN_COPY
Definition: wingdi.h:356
#define SIMPLEREGION
Definition: wingdi.h:361
BOOL APIENTRY NtGdiRectVisible(HDC hDC, LPRECT UnsafeRect)
Definition: cliprgn.c:620
#define _In_
Definition: no_sal2.h:204
Definition: gdi.h:1
static HDC hDC
Definition: 3dtext.c:33
UCHAR Flags
Definition: ntgdihdl.h:225
_SEH2_END
Definition: create.c:4424
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
#define GDI_ENTRY_VALIDATE_VIS
Definition: ntgdihdl.h:40
#define RGN_DIFF
Definition: wingdi.h:357
int xOffset
Definition: appswitch.c:59
#define DPRINT1
Definition: precomp.h:8
_In_ ULONG _In_ CLIPOBJ _In_ RECTL * prcl
Definition: winddi.h:3529
VOID FASTCALL REGION_UnlockRgn(_In_ PREGION prgn)
Definition: region.c:2392
VOID FASTCALL IntEngUpdateClipRegion(XCLIPOBJ *Clip, ULONG count, const RECTL *pRect, const RECTL *rcBounds)
Definition: clip.c:173
int APIENTRY NtGdiExtSelectClipRgn(HDC hDC, HRGN hrgn, int fnMode)
Definition: cliprgn.c:307
static const WCHAR dc[]
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
int yOffset
Definition: appswitch.c:59
INT FASTCALL REGION_Complexity(PREGION prgn)
Definition: region.c:567
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:12
INT FASTCALL REGION_GetRgnBox(PREGION Rgn, PRECTL pRect)
Definition: region.c:2562
return STATUS_SUCCESS
Definition: btrfs.c:2938
_Out_ LPRECT prc
Definition: ntgdi.h:1658
_Success_(return!=ERROR)
Definition: cliprgn.c:89
VOID FASTCALL REGION_Delete(PREGION pRgn)
Definition: region.c:2468
int FASTCALL IntGdiSetMetaRgn(PDC pDC)
Definition: cliprgn.c:672
VOID FASTCALL RECTL_vMakeWellOrdered(_Inout_ RECTL *prcl)
Definition: rect.c:81
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
base of all file and directory entries
Definition: entries.h:82
#define APIENTRY
Definition: api.h:79
struct Rect Rect
#define X(b, s)
BOOL FASTCALL REGION_PtInRegion(PREGION prgn, INT X, INT Y)
Definition: region.c:2602