ReactOS  0.4.13-dev-39-g8b6696f
dce.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tagDCE
 

Macros

#define DCHC_INVALIDVISRGN   0x0001
 
#define DCHC_DELETEDC   0x0002
 
#define DCHF_INVALIDATEVISRGN   0x0001
 
#define DCHF_VALIDATEVISRGN   0x0002
 
#define DCX_DCEEMPTY   0x00000800
 
#define DCX_DCEBUSY   0x00001000
 
#define DCX_DCEDIRTY   0x00002000
 
#define DCX_LAYEREDWIN   0x00004000
 
#define DCX_DCPOWNED   0x00008000
 
#define DCX_NOCLIPCHILDREN   0x00080000
 
#define DCX_NORECOMPUTE   0x00100000
 
#define DCX_INDESTROY   0x00400000
 

Typedefs

typedef enum DCE_TYPEPDCE_TYPE
 
typedef struct tagDCE DCE
 
typedef struct tagDCEPDCE
 

Enumerations

enum  DCE_TYPE { DCE_CACHE_DC, DCE_CLASS_DC, DCE_WINDOW_DC }
 

Functions

INIT_FUNCTION NTSTATUS NTAPI InitDCEImpl (VOID)
 
PDCE FASTCALL DceAllocDCE (PWND Window, DCE_TYPE Type)
 
HWND FASTCALL IntWindowFromDC (HDC hDc)
 
void FASTCALL DceFreeDCE (PDCE dce, BOOLEAN Force)
 
void FASTCALL DceEmptyCache (void)
 
VOID FASTCALL DceResetActiveDCEs (PWND Window)
 
void FASTCALL DceFreeClassDCE (PDCE)
 
HWND FASTCALL UserGethWnd (HDC, PWNDOBJ *)
 
void FASTCALL DceFreeWindowDCE (PWND)
 
void FASTCALL DceFreeThreadDCE (PTHREADINFO)
 
VOID FASTCALL DceUpdateVisRgn (DCE *Dce, PWND Window, ULONG Flags)
 
DCE *FASTCALL DceGetDceFromDC (HDC hdc)
 

Macro Definition Documentation

◆ DCHC_DELETEDC

#define DCHC_DELETEDC   0x0002

Definition at line 5 of file dce.h.

◆ DCHC_INVALIDVISRGN

#define DCHC_INVALIDVISRGN   0x0001

Definition at line 4 of file dce.h.

◆ DCHF_INVALIDATEVISRGN

#define DCHF_INVALIDATEVISRGN   0x0001

Definition at line 7 of file dce.h.

◆ DCHF_VALIDATEVISRGN

#define DCHF_VALIDATEVISRGN   0x0002

Definition at line 8 of file dce.h.

◆ DCX_DCEBUSY

#define DCX_DCEBUSY   0x00001000

Definition at line 36 of file dce.h.

◆ DCX_DCEDIRTY

#define DCX_DCEDIRTY   0x00002000

Definition at line 37 of file dce.h.

◆ DCX_DCEEMPTY

#define DCX_DCEEMPTY   0x00000800

Definition at line 35 of file dce.h.

◆ DCX_DCPOWNED

#define DCX_DCPOWNED   0x00008000

Definition at line 39 of file dce.h.

◆ DCX_INDESTROY

#define DCX_INDESTROY   0x00400000

Definition at line 42 of file dce.h.

◆ DCX_LAYEREDWIN

#define DCX_LAYEREDWIN   0x00004000

Definition at line 38 of file dce.h.

◆ DCX_NOCLIPCHILDREN

#define DCX_NOCLIPCHILDREN   0x00080000

Definition at line 40 of file dce.h.

◆ DCX_NORECOMPUTE

#define DCX_NORECOMPUTE   0x00100000

Definition at line 41 of file dce.h.

Typedef Documentation

◆ DCE

typedef struct tagDCE DCE

◆ PDCE

typedef struct tagDCE * PDCE

◆ PDCE_TYPE

typedef enum DCE_TYPE * PDCE_TYPE

Enumeration Type Documentation

◆ DCE_TYPE

Enumerator
DCE_CACHE_DC 
DCE_CLASS_DC 
DCE_WINDOW_DC 

Definition at line 10 of file dce.h.

11 {
12  DCE_CACHE_DC, /* This is a cached DC (allocated by USER) */
13  DCE_CLASS_DC, /* This is a class DC (style CS_CLASSDC) */
14  DCE_WINDOW_DC /* This is a window DC (style CS_OWNDC) */
enum DCE_TYPE * PDCE_TYPE
DCE_TYPE
Definition: dce.h:10

Function Documentation

◆ DceAllocDCE()

PDCE FASTCALL DceAllocDCE ( PWND  Window,
DCE_TYPE  Type 
)

Definition at line 85 of file windc.c.

86 {
87  PDCE pDce;
88 
90  if(!pDce)
91  return NULL;
92 
93  pDce->hDC = DceCreateDisplayDC();
94  if (!pDce->hDC)
95  {
97  return NULL;
98  }
99  DCECount++;
100  TRACE("Alloc DCE's! %d\n",DCECount);
101  pDce->hwndCurrent = (Window ? Window->head.h : NULL);
102  pDce->pwndOrg = Window;
103  pDce->pwndClip = Window;
104  pDce->hrgnClip = NULL;
105  pDce->hrgnClipPublic = NULL;
106  pDce->hrgnSavedVis = NULL;
107  pDce->ppiOwner = NULL;
108 
109  InsertTailList(&LEDce, &pDce->List);
110 
111  DCU_SetDcUndeletable(pDce->hDC);
112 
113  if (Type == DCE_WINDOW_DC || Type == DCE_CLASS_DC) // Window DCE have ownership.
114  {
115  pDce->ptiOwner = GetW32ThreadInfo();
116  }
117  else
118  {
119  TRACE("FREE DCATTR!!!! NOT DCE_WINDOW_DC!!!!! hDC-> %p\n", pDce->hDC);
121  pDce->ptiOwner = NULL;
122  }
123 
124  if (Type == DCE_CACHE_DC)
125  {
126  pDce->DCXFlags = DCX_CACHE | DCX_DCEEMPTY;
127  }
128  else
129  {
130  pDce->DCXFlags = DCX_DCEBUSY;
131  if (Window)
132  {
133  if (Type == DCE_WINDOW_DC)
134  {
135  if (Window->style & WS_CLIPCHILDREN) pDce->DCXFlags |= DCX_CLIPCHILDREN;
136  if (Window->style & WS_CLIPSIBLINGS) pDce->DCXFlags |= DCX_CLIPSIBLINGS;
137  }
138  }
139  }
140  return(pDce);
141 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define DCX_CLIPSIBLINGS
Definition: winuser.h:2077
#define DCX_CLIPCHILDREN
Definition: winuser.h:2078
PTHREADINFO ptiOwner
Definition: dce.h:29
Type
Definition: Type.h:6
#define DCX_DCEBUSY
Definition: dce.h:36
HDC hDC
Definition: dce.h:20
static LIST_ENTRY LEDce
Definition: windc.c:17
HDC FASTCALL DceCreateDisplayDC(VOID)
Definition: windc.c:40
#define InsertTailList(ListHead, Entry)
#define WS_CLIPCHILDREN
Definition: pedump.c:619
HWND hwndCurrent
Definition: dce.h:21
struct _THREADINFO * GetW32ThreadInfo(VOID)
Definition: misc.c:781
PWND pwndClip
Definition: dce.h:23
PPROCESSINFO ppiOwner
Definition: dce.h:30
Definition: window.c:29
DWORD DCXFlags
Definition: dce.h:28
HRGN hrgnClipPublic
Definition: dce.h:26
#define DCX_DCEEMPTY
Definition: dce.h:35
smooth NULL
Definition: ftsmooth.c:416
HRGN hrgnSavedVis
Definition: dce.h:27
HRGN hrgnClip
Definition: dce.h:25
#define TRACE(s)
Definition: solgame.cpp:4
#define USERTAG_DCE
Definition: tags.h:220
static INT DCECount
Definition: windc.c:18
int Window
Definition: x11stubs.h:26
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
VOID FASTCALL DCU_SetDcUndeletable(HDC)
Definition: dcutil.c:322
#define DCX_CACHE
Definition: winuser.h:2075
BOOL NTAPI GreSetDCOwner(HDC hdc, ULONG ulOwner)
Definition: dclife.c:447
Definition: dce.h:17
#define GDI_OBJ_HMGR_NONE
Definition: ntgdihdl.h:118
LIST_ENTRY List
Definition: dce.h:19
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
PWND pwndOrg
Definition: dce.h:22

Referenced by IntCreateWindow(), and UserGetDCEx().

◆ DceEmptyCache()

void FASTCALL DceEmptyCache ( void  )

Definition at line 800 of file windc.c.

801 {
802  PDCE pDCE;
803  PLIST_ENTRY ListEntry;
804 
805  ListEntry = LEDce.Flink;
806  while (ListEntry != &LEDce)
807  {
808  pDCE = CONTAINING_RECORD(ListEntry, DCE, List);
809  ListEntry = ListEntry->Flink;
810  DceFreeDCE(pDCE, TRUE);
811  }
812 }
#define TRUE
Definition: types.h:120
static LIST_ENTRY LEDce
Definition: windc.c:17
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
LIST_ENTRY List
Definition: psmgr.c:57
Definition: typedefs.h:117
void FASTCALL DceFreeDCE(PDCE pdce, BOOLEAN Force)
Definition: windc.c:632
Definition: dce.h:17

◆ DceFreeClassDCE()

void FASTCALL DceFreeClassDCE ( PDCE  )

Definition at line 761 of file windc.c.

762 {
763  PDCE pDCE;
764  PLIST_ENTRY ListEntry;
765 
766  ListEntry = LEDce.Flink;
767  while (ListEntry != &LEDce)
768  {
769  pDCE = CONTAINING_RECORD(ListEntry, DCE, List);
770  ListEntry = ListEntry->Flink;
771  if (pDCE == pdceClass)
772  {
773  DceFreeDCE(pDCE, TRUE); // Might have gone cheap!
774  }
775  }
776 }
#define TRUE
Definition: types.h:120
static LIST_ENTRY LEDce
Definition: windc.c:17
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
LIST_ENTRY List
Definition: psmgr.c:57
Definition: typedefs.h:117
void FASTCALL DceFreeDCE(PDCE pdce, BOOLEAN Force)
Definition: windc.c:632
Definition: dce.h:17

Referenced by IntDestroyClass().

◆ DceFreeDCE()

void FASTCALL DceFreeDCE ( PDCE  dce,
BOOLEAN  Force 
)

Definition at line 632 of file windc.c.

633 {
634  BOOL Hit = FALSE;
635 
636  ASSERT(pdce != NULL);
637  if (NULL == pdce) return;
638 
639  pdce->DCXFlags |= DCX_INDESTROY;
640 
641  if (Force &&
643  {
644  TRACE("Change ownership for DCE! -> %p\n" , pdce);
645  // NOTE: Windows sets W32PF_OWNDCCLEANUP and moves on.
646  if (GreIsHandleValid(pdce->hDC))
647  {
649  }
650  else
651  {
652  ERR("Attempted to change ownership of an DCEhDC %p currently being destroyed!!!\n",
653  pdce->hDC);
654  Hit = TRUE;
655  }
656  }
657  else
658  {
659  if (GreGetObjectOwner(pdce->hDC) == GDI_OBJ_HMGR_PUBLIC)
661  }
662 
663  if (!Hit) IntGdiDeleteDC(pdce->hDC, TRUE);
664 
665  if (pdce->hrgnClip && !(pdce->DCXFlags & DCX_KEEPCLIPRGN))
666  {
667  GreDeleteObject(pdce->hrgnClip);
668  pdce->hrgnClip = NULL;
669  }
670 
671  RemoveEntryList(&pdce->List);
672 
674 
675  DCECount--;
676  TRACE("Freed DCE's! %d \n", DCECount);
677 }
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
Definition: gdiobj.c:1153
#define TRUE
Definition: types.h:120
BOOL NTAPI GreIsHandleValid(HGDIOBJ hobj)
Definition: gdiobj.c:1141
BOOL FASTCALL IntGdiDeleteDC(HDC, BOOL)
Definition: dclife.c:881
ULONG NTAPI GreGetObjectOwner(HGDIOBJ hobj)
Definition: gdiobj.c:1187
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
unsigned int BOOL
Definition: ntddk_ex.h:94
#define DCX_KEEPCLIPRGN
Definition: undocuser.h:66
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define USERTAG_DCE
Definition: tags.h:220
static INT DCECount
Definition: windc.c:18
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define GDI_OBJ_HMGR_POWNED
Definition: ntgdihdl.h:117
#define DCX_INDESTROY
Definition: dce.h:42
#define ERR(fmt,...)
Definition: debug.h:109
BOOL NTAPI GreSetDCOwner(HDC hdc, ULONG ulOwner)
Definition: dclife.c:447
#define GDI_OBJ_HMGR_PUBLIC
Definition: ntgdihdl.h:116
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
_Inout_ PVCB _In_ BOOLEAN Force
Definition: cdprocs.h:1425

Referenced by DceEmptyCache(), DceFreeClassDCE(), DceFreeThreadDCE(), DceFreeWindowDCE(), and DceReleaseDC().

◆ DceFreeThreadDCE()

void FASTCALL DceFreeThreadDCE ( PTHREADINFO  )

Definition at line 779 of file windc.c.

780 {
781  PDCE pDCE;
782  PLIST_ENTRY ListEntry;
783 
784  ListEntry = LEDce.Flink;
785  while (ListEntry != &LEDce)
786  {
787  pDCE = CONTAINING_RECORD(ListEntry, DCE, List);
788  ListEntry = ListEntry->Flink;
789  if (pDCE->ptiOwner == pti)
790  {
791  if (pDCE->DCXFlags & DCX_CACHE)
792  {
793  DceFreeDCE(pDCE, TRUE);
794  }
795  }
796  }
797 }
#define TRUE
Definition: types.h:120
PTHREADINFO ptiOwner
Definition: dce.h:29
static LIST_ENTRY LEDce
Definition: windc.c:17
DWORD DCXFlags
Definition: dce.h:28
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
LIST_ENTRY List
Definition: psmgr.c:57
Definition: typedefs.h:117
#define DCX_CACHE
Definition: winuser.h:2075
void FASTCALL DceFreeDCE(PDCE pdce, BOOLEAN Force)
Definition: windc.c:632
Definition: dce.h:17

Referenced by ExitThreadCallback().

◆ DceFreeWindowDCE()

void FASTCALL DceFreeWindowDCE ( PWND  )

Definition at line 685 of file windc.c.

686 {
687  PDCE pDCE;
688  PLIST_ENTRY ListEntry;
689 
690  if (DCECount <= 0)
691  {
692  ERR("FreeWindowDCE No Entry! %d\n",DCECount);
693  return;
694  }
695 
696  ListEntry = LEDce.Flink;
697  while (ListEntry != &LEDce)
698  {
699  pDCE = CONTAINING_RECORD(ListEntry, DCE, List);
700  ListEntry = ListEntry->Flink;
701  if ( pDCE->hwndCurrent == Window->head.h &&
702  !(pDCE->DCXFlags & DCX_DCEEMPTY) )
703  {
704  if (!(pDCE->DCXFlags & DCX_CACHE)) /* Owned or Class DCE */
705  {
706  if (Window->pcls->style & CS_CLASSDC) /* Test Class first */
707  {
708  if (pDCE->DCXFlags & (DCX_INTERSECTRGN | DCX_EXCLUDERGN)) /* Class DCE */
709  DceDeleteClipRgn(pDCE);
710  // Update and reset Vis Rgn and clear the dirty bit.
711  // Should release VisRgn than reset it to default.
712  DceUpdateVisRgn(pDCE, Window, pDCE->DCXFlags);
714  pDCE->hwndCurrent = 0;
715  pDCE->pwndOrg = pDCE->pwndClip = NULL;
716 
717  TRACE("POWNED DCE going Cheap!! DCX_CACHE!! hDC-> %p \n",
718  pDCE->hDC);
719  if (!GreSetDCOwner( pDCE->hDC, GDI_OBJ_HMGR_NONE))
720  {
721  ERR("Fail Owner Switch hDC-> %p \n", pDCE->hDC);
722  break;
723  }
724  /* Do not change owner so thread can clean up! */
725  }
726  else if (Window->pcls->style & CS_OWNDC) /* Owned DCE */
727  {
728  DceFreeDCE(pDCE, FALSE);
729  continue;
730  }
731  else
732  {
733  ERR("Not POWNED or CLASSDC hwndCurrent -> %p \n",
734  pDCE->hwndCurrent);
735  // ASSERT(FALSE); /* bug 5320 */
736  }
737  }
738  else
739  {
740  if (pDCE->DCXFlags & DCX_DCEBUSY) /* Shared cache DCE */
741  {
742  /* FIXME: AFAICS we are doing the right thing here so
743  * this should be a TRACE. But this is best left as an ERR
744  * because the 'application error' is likely to come from
745  * another part of Wine (i.e. it's our fault after all).
746  * We should change this to TRACE when ReactOS is more stable
747  * (for 1.0?).
748  */
749  ERR("[%p] GetDC() without ReleaseDC()!\n", Window->head.h);
750  DceReleaseDC(pDCE, FALSE);
751  }
752  pDCE->DCXFlags |= DCX_DCEEMPTY;
753  pDCE->hwndCurrent = 0;
754  pDCE->pwndOrg = pDCE->pwndClip = NULL;
755  }
756  }
757  }
758 }
#define DCX_DCEBUSY
Definition: dce.h:36
HDC hDC
Definition: dce.h:20
static LIST_ENTRY LEDce
Definition: windc.c:17
#define CS_OWNDC
Definition: winuser.h:650
#define DCX_INTERSECTRGN
Definition: winuser.h:2083
HWND hwndCurrent
Definition: dce.h:21
static VOID FASTCALL DceDeleteClipRgn(DCE *Dce)
Definition: windc.c:169
PWND pwndClip
Definition: dce.h:23
Definition: window.c:29
static INT FASTCALL DceReleaseDC(DCE *dce, BOOL EndPaint)
Definition: windc.c:278
DWORD DCXFlags
Definition: dce.h:28
#define DCX_DCEEMPTY
Definition: dce.h:35
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
#define TRACE(s)
Definition: solgame.cpp:4
static INT DCECount
Definition: windc.c:18
LIST_ENTRY List
Definition: psmgr.c:57
VOID FASTCALL DceUpdateVisRgn(DCE *Dce, PWND Window, ULONG Flags)
Definition: windc.c:191
Definition: typedefs.h:117
#define CS_CLASSDC
Definition: winuser.h:645
#define ERR(fmt,...)
Definition: debug.h:109
#define DCX_CACHE
Definition: winuser.h:2075
void FASTCALL DceFreeDCE(PDCE pdce, BOOLEAN Force)
Definition: windc.c:632
BOOL NTAPI GreSetDCOwner(HDC hdc, ULONG ulOwner)
Definition: dclife.c:447
Definition: dce.h:17
#define GDI_OBJ_HMGR_NONE
Definition: ntgdihdl.h:118
PWND pwndOrg
Definition: dce.h:22
#define DCX_EXCLUDERGN
Definition: winuser.h:2082

Referenced by co_UserFreeWindow().

◆ DceGetDceFromDC()

DCE* FASTCALL DceGetDceFromDC ( HDC  hdc)

Definition at line 52 of file windc.c.

53 {
54  PLIST_ENTRY ListEntry;
55  DCE* dce;
56 
57  ListEntry = LEDce.Flink;
58  while (ListEntry != &LEDce)
59  {
60  dce = CONTAINING_RECORD(ListEntry, DCE, List);
61  ListEntry = ListEntry->Flink;
62  if (dce->hDC == hdc)
63  return dce;
64  }
65 
66  return NULL;
67 }
HDC hDC
Definition: dce.h:20
static LIST_ENTRY LEDce
Definition: windc.c:17
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
LIST_ENTRY List
Definition: psmgr.c:57
HDC hdc
Definition: main.c:9
Definition: typedefs.h:117
Definition: dce.h:17

◆ DceResetActiveDCEs()

VOID FASTCALL DceResetActiveDCEs ( PWND  Window)

Definition at line 815 of file windc.c.

816 {
817  DCE *pDCE;
818  PDC dc;
819  PWND CurrentWindow;
820  INT DeltaX;
821  INT DeltaY;
822  PLIST_ENTRY ListEntry;
823 
824  if (NULL == Window)
825  {
826  return;
827  }
828 
829  ListEntry = LEDce.Flink;
830  while (ListEntry != &LEDce)
831  {
832  pDCE = CONTAINING_RECORD(ListEntry, DCE, List);
833  ListEntry = ListEntry->Flink;
834  if (0 == (pDCE->DCXFlags & (DCX_DCEEMPTY|DCX_INDESTROY)))
835  {
836  if (Window->head.h == pDCE->hwndCurrent)
837  {
838  CurrentWindow = Window;
839  }
840  else
841  {
842  if (!pDCE->hwndCurrent)
843  CurrentWindow = NULL;
844  else
845  CurrentWindow = UserGetWindowObject(pDCE->hwndCurrent);
846  if (NULL == CurrentWindow)
847  {
848  continue;
849  }
850  }
851 
852  if (!GreIsHandleValid(pDCE->hDC) ||
853  (dc = DC_LockDc(pDCE->hDC)) == NULL)
854  {
855  continue;
856  }
857  if (Window == CurrentWindow || IntIsChildWindow(Window, CurrentWindow))
858  {
859  if (pDCE->DCXFlags & DCX_WINDOW)
860  {
861  DeltaX = CurrentWindow->rcWindow.left - dc->ptlDCOrig.x;
862  DeltaY = CurrentWindow->rcWindow.top - dc->ptlDCOrig.y;
863  dc->ptlDCOrig.x = CurrentWindow->rcWindow.left;
864  dc->ptlDCOrig.y = CurrentWindow->rcWindow.top;
865  }
866  else
867  {
868  DeltaX = CurrentWindow->rcClient.left - dc->ptlDCOrig.x;
869  DeltaY = CurrentWindow->rcClient.top - dc->ptlDCOrig.y;
870  dc->ptlDCOrig.x = CurrentWindow->rcClient.left;
871  dc->ptlDCOrig.y = CurrentWindow->rcClient.top;
872  }
873 
874  if (NULL != dc->dclevel.prgnClip)
875  {
876  REGION_bOffsetRgn(dc->dclevel.prgnClip, DeltaX, DeltaY);
877  dc->fs |= DC_FLAG_DIRTY_RAO;
878  }
879  if (NULL != pDCE->hrgnClip)
880  {
881  NtGdiOffsetRgn(pDCE->hrgnClip, DeltaX, DeltaY);
882  }
883  }
884  DC_UnlockDc(dc);
885 
886  DceUpdateVisRgn(pDCE, CurrentWindow, pDCE->DCXFlags);
888  }
889  }
890 }
BOOL NTAPI GreIsHandleValid(HGDIOBJ hobj)
Definition: gdiobj.c:1141
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
LONG top
Definition: windef.h:292
HDC hDC
Definition: dce.h:20
static LIST_ENTRY LEDce
Definition: windc.c:17
HDC dc
Definition: cylfrac.c:34
BOOL FASTCALL REGION_bOffsetRgn(_Inout_ PREGION prgn, _In_ INT cx, _In_ INT cy)
Definition: region.c:2730
RECT rcClient
Definition: ntuser.h:681
LONG left
Definition: windef.h:291
int32_t INT
Definition: typedefs.h:56
#define DCX_WINDOW
Definition: winuser.h:2074
HWND hwndCurrent
Definition: dce.h:21
Definition: window.c:29
DWORD DCXFlags
Definition: dce.h:28
#define DCX_DCEEMPTY
Definition: dce.h:35
smooth NULL
Definition: ftsmooth.c:416
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:103
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
HRGN hrgnClip
Definition: dce.h:25
WORD APIENTRY IntGdiSetHookFlags(HDC hDC, WORD Flags)
Definition: dcutil.c:423
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
Definition: polytest.cpp:40
LIST_ENTRY List
Definition: psmgr.c:57
#define DC_FLAG_DIRTY_RAO
Definition: ntgdihdl.h:132
int Window
Definition: x11stubs.h:26
__kernel_entry W32KAPI INT APIENTRY NtGdiOffsetRgn(_In_ HRGN hrgn, _In_ INT cx, _In_ INT cy)
Definition: region.c:3984
VOID FASTCALL DceUpdateVisRgn(DCE *Dce, PWND Window, ULONG Flags)
Definition: windc.c:191
RECT rcWindow
Definition: ntuser.h:680
#define DCX_INDESTROY
Definition: dce.h:42
Definition: typedefs.h:117
Definition: ntuser.h:657
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
Definition: dce.h:17
BOOL FASTCALL IntIsChildWindow(PWND Parent, PWND BaseWindow)
Definition: window.c:882
#define DCHF_VALIDATEVISRGN
Definition: gdi_driver.h:267

Referenced by co_IntSetParent(), co_IntSetWindowLongPtr(), co_WinPosSetWindowPos(), and IntSetStyle().

◆ DceUpdateVisRgn()

VOID FASTCALL DceUpdateVisRgn ( DCE Dce,
PWND  Window,
ULONG  Flags 
)

Definition at line 191 of file windc.c.

192 {
193  PREGION RgnVisible = NULL;
194  ULONG DcxFlags;
196 
197  if (Flags & DCX_PARENTCLIP)
198  {
199  PWND Parent;
200 
201  Parent = Window->spwndParent;
202  if (!Parent)
203  {
204  RgnVisible = NULL;
205  goto noparent;
206  }
207 
208  if (Parent->style & WS_CLIPSIBLINGS)
209  {
210  DcxFlags = DCX_CLIPSIBLINGS |
212  }
213  else
214  {
216  }
217  RgnVisible = DceGetVisRgn(Parent, DcxFlags, Window->head.h, Flags);
218  }
219  else if (Window == NULL)
220  {
222  if (NULL != DesktopWindow)
223  {
224  RgnVisible = IntSysCreateRectpRgnIndirect(&DesktopWindow->rcWindow);
225  }
226  else
227  {
228  RgnVisible = NULL;
229  }
230  }
231  else
232  {
233  RgnVisible = DceGetVisRgn(Window, Flags, 0, 0);
234  }
235 
236 noparent:
237  if (Flags & DCX_INTERSECTRGN)
238  {
239  PREGION RgnClip = NULL;
240 
241  if (Dce->hrgnClip != NULL)
242  RgnClip = REGION_LockRgn(Dce->hrgnClip);
243 
244  if (RgnClip)
245  {
246  IntGdiCombineRgn(RgnVisible, RgnVisible, RgnClip, RGN_AND);
247  REGION_UnlockRgn(RgnClip);
248  }
249  else
250  {
251  if (RgnVisible != NULL)
252  {
253  REGION_Delete(RgnVisible);
254  }
255  RgnVisible = IntSysCreateRectpRgn(0, 0, 0, 0);
256  }
257  }
258  else if ((Flags & DCX_EXCLUDERGN) && Dce->hrgnClip != NULL)
259  {
260  PREGION RgnClip = REGION_LockRgn(Dce->hrgnClip);
261  IntGdiCombineRgn(RgnVisible, RgnVisible, RgnClip, RGN_DIFF);
262  REGION_UnlockRgn(RgnClip);
263  }
264 
265  Dce->DCXFlags &= ~DCX_DCEDIRTY;
266  GdiSelectVisRgn(Dce->hDC, RgnVisible);
267  /* Tell GDI driver */
268  if (Window)
270 
271  if (RgnVisible != NULL)
272  {
273  REGION_Delete(RgnVisible);
274  }
275 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define DCX_CLIPSIBLINGS
Definition: winuser.h:2077
#define DCX_CLIPCHILDREN
Definition: winuser.h:2078
VOID FASTCALL GdiSelectVisRgn(HDC hdc, PREGION prgn)
Definition: cliprgn.c:42
HDC hDC
Definition: dce.h:20
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:716
PREGION FASTCALL REGION_LockRgn(_In_ HRGN hrgn)
Definition: region.c:2380
#define DCX_INTERSECTRGN
Definition: winuser.h:2083
#define DCX_WINDOW
Definition: winuser.h:2074
#define RGN_AND
Definition: wingdi.h:355
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
Definition: window.c:29
PREGION FASTCALL IntSysCreateRectpRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
Definition: region.c:2429
DWORD DCXFlags
Definition: dce.h:28
smooth NULL
Definition: ftsmooth.c:416
Definition: region.h:7
#define WOC_RGN_CLIENT
Definition: winddi.h:1265
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:103
INT FASTCALL IntGdiCombineRgn(PREGION prgnDest, PREGION prgnSrc1, PREGION prgnSrc2, INT iCombineMode)
Definition: region.c:2509
HRGN hrgnClip
Definition: dce.h:25
#define IntSysCreateRectpRgnIndirect(prc)
Definition: region.h:93
Implementation of the Explorer desktop window.
Definition: desktop.h:51
Definition: ntuser.h:657
HWND FASTCALL IntGetDesktopWindow(VOID)
Definition: desktop.c:1338
#define DCX_PARENTCLIP
Definition: winuser.h:2076
#define RGN_DIFF
Definition: wingdi.h:357
VOID FASTCALL IntEngWindowChanged(_In_ struct _WND *Window, _In_ FLONG flChanged)
#define DCX_DCEDIRTY
Definition: dce.h:37
VOID FASTCALL REGION_UnlockRgn(_In_ PREGION prgn)
Definition: region.c:2395
unsigned int ULONG
Definition: retypes.h:1
VOID FASTCALL REGION_Delete(PREGION pRgn)
Definition: region.c:2471
static PREGION FASTCALL DceGetVisRgn(PWND Window, ULONG Flags, HWND hWndChild, ULONG CFlags)
Definition: windc.c:71
#define DCX_EXCLUDERGN
Definition: winuser.h:2082

Referenced by DceFreeWindowDCE(), DceReleaseDC(), DceResetActiveDCEs(), and UserGetDCEx().

◆ InitDCEImpl()

INIT_FUNCTION NTSTATUS NTAPI InitDCEImpl ( VOID  )

Definition at line 30 of file windc.c.

31 {
33  return STATUS_SUCCESS;
34 }
static LIST_ENTRY LEDce
Definition: windc.c:17
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
return STATUS_SUCCESS
Definition: btrfs.c:2725

Referenced by DriverEntry().

◆ IntWindowFromDC()

HWND FASTCALL IntWindowFromDC ( HDC  hDc)

Definition at line 893 of file windc.c.

894 {
895  DCE *Dce;
896  PLIST_ENTRY ListEntry;
897  HWND Ret = NULL;
898 
899  ListEntry = LEDce.Flink;
900  while (ListEntry != &LEDce)
901  {
902  Dce = CONTAINING_RECORD(ListEntry, DCE, List);
903  ListEntry = ListEntry->Flink;
904  if (Dce->hDC == hDc)
905  {
906  if (Dce->DCXFlags & DCX_INDESTROY)
907  Ret = NULL;
908  else
909  Ret = Dce->hwndCurrent;
910  break;
911  }
912  }
913  return Ret;
914 }
HDC hDC
Definition: dce.h:20
static LIST_ENTRY LEDce
Definition: windc.c:17
HWND hwndCurrent
Definition: dce.h:21
DWORD DCXFlags
Definition: dce.h:28
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
LIST_ENTRY List
Definition: psmgr.c:57
#define DCX_INDESTROY
Definition: dce.h:42
Definition: typedefs.h:117
Definition: dce.h:17

Referenced by NtGdiUpdateColors(), NtUserCallOneParam(), UserGethWnd(), and UserRealizePalette().

◆ UserGethWnd()

HWND FASTCALL UserGethWnd ( HDC  ,
PWNDOBJ  
)

Definition at line 952 of file windc.c.

953 {
954  EWNDOBJ* Clip;
955  PWND Wnd;
956  HWND hWnd;
957 
959 
960  if (hWnd && (Wnd = UserGetWindowObject(hWnd)))
961  {
962  Clip = (EWNDOBJ*)UserGetProp(Wnd, AtomWndObj, TRUE);
963 
964  if ( Clip && Clip->Hwnd == hWnd )
965  {
966  if (pwndo) *pwndo = (PWNDOBJ)Clip;
967  }
968  }
969  return hWnd;
970 }
HWND Hwnd
Definition: engobjects.h:98
#define TRUE
Definition: types.h:120
HWND hWnd
Definition: settings.c:17
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:103
HWND FASTCALL IntWindowFromDC(HDC hDc)
Definition: windc.c:893
HANDLE FASTCALL UserGetProp(_In_ PWND Window, _In_ ATOM Atom, _In_ BOOLEAN SystemProp)
Definition: prop.c:46
HDC hdc
Definition: main.c:9
ATOM AtomWndObj
Definition: ntuser.c:20
Definition: ntuser.h:657
struct _WNDOBJ * PWNDOBJ

Referenced by NtGdiSetPixelFormat(), and NtGdiSwapBuffers().