Techwiki:Win32k/XCLIPOBJ
From ReactOS
Windows XP version of REGION
typedef struct { LONG scnPntTop; // top line (inclusive) LONG scnPntBottom; // bottom line (exclusive) LONG scnPntX[2]; // v-length array of x pairs } SCAN2; // REGION Object minimum size of 0x70, 3 cScan typedef struct { LONG scnPntCnt; // 038 count of x coordinates SCAN2 scnPnt[3]; // 03C LONG scnPntCntToo; // 108 same as scnPntCnt; } SCAN1; // REGION Object minimum size of 0x4C, 1 cScan typedef struct { LONG scnPntCnt; // 38 count of x coordinates LONG scnPntTop; // 3c top line (inclusive) LONG scnPntBottom; // 40 bottom line (exclusive) LONG scnPntX[2]; // 44 48 v-length array of x pairs } SCAN; typedef struct _RGN { BASEOBJECT BaseObject; unsigned sizeObj; ULONG iUniq; // from Clip object DWORD nRefCount // inc/dec Ref count if 0 deleteRGNOBJ SCAN * pscnTail; unsigned sizeRgn; unsigned cScans; RECTL rcl; SCAN scnHead[1]; // 038 + 1 = 0x4C SCAN1 scnHead[1]; // 038 + 1 = 0x70 } RGN, *PRGN;
sizeRgn reports 2 minimum sizes, 0x4C and 0x70.
Windows XP version of CLIPOBJ or WNDOBJ
typedef struct _CLIPOBJ { ULONG iUniq; RECTL rclBounds; BYTE iDComplexity; BYTE iFComplexity; BYTE iMode; BYTE fjOptions; } CLIPOBJ;
typedef struct _WNDOBJ { CLIPOBJ coClient; PVOID pvConsumer; RECTL rclClient; SURFOBJ *psoOwner; } WNDOBJ, *PWNDOBJ;
EXtended CLip and Window Region Object Multipurpose E/X/CLIPOBJ and E/WNDOBJ structure
typedef struct _XCLIPOBJ { WNDOBJ exClipWnd; // 000 PVOID pClipRgn; // 030 RECTL rclClipRgn; // 034 PVOID pscanClipRgn; // 044 DWORD cScans; // 048 DWORD Unknown1; // 04C ULONG ulBSize; // 050 LONG lscnSize; // 054 ULONG ulObjSize; // 058 ULONG iDirection; // 05C ULONG ClipType; // 060 DWORD Unknown2; // 064 init z LONG lUpDown; // 068 DWORD Unknown3; // 06C init z BOOL ShouldDoAll; // 070 DWORD nComplexity; // 074 PVOID pUnknown; // 078 } XCLIPOBJ, *PXCLIPOBJ; // Size is 0x7C or 124
exClipWnd
pClipRgn
- prgnRao or (prgnVis if prgnRao == 0)
rclClipRgn
- If ShouldDoAll is TRUE: Copy of clip prgn.rcl
- If ShouldDoAll is FALSE: from exClipWnd.co.rclBounds.
pscanClipRgn
- Based on iDirection, ulUpDown -1 *Tail up, 1 *Head down
cScans
- From clip rgn cScans.
ulBSize
- Recomputed buffer size.
lscnSize
- Add (+-)size for pointer based on size of SCAN & iDirection.
ulObjSize
- Specifies the size, in bytes, of the enum output buffer.
iDirection
- One of CD_ANY CD_LEFTDOWN CD_LEFTUP CD_LEFTWARDS CD_RIGHTDOWN
CD_RIGHTUP CD_UPWARDS
ClipType
- Always CT_RECTANGLES aka 0
lUpDown
- -1 up, 1 down, based on "iDirection" of reading SCAN list.
ShouldDoAll
- Specifies whether the entire region should be enumerated.
nComplexity
- count/mode based on # of rect in regions SCAN.
pUnknown
- pointer to a large DDA based drawing structure. See Note.
Signed lUpDown is not used, but is a notification which direction the scan list is read.
Note:
On a raster-based device, such as a screen display or a printer, the line drawing uses a class of algorithms called DDA (digital differential analyzer) to select the pixels to paint to represent a line. The Bresenham algorithm is a classical incremental DDA algorithm. The Windows NT/2000 graphics engine uses 28.4 fixed-point coordinate space on physical device surfaces. Lines are drawn following the so-called GIQ (Grid Intersection Quantization) diamond convention, in which each pixel is thought of as having a 1-by-1 pixel size diamond shape around it. A pixel is painted if its diamond shape touches a line segment. From section 8.4 of Windows Graphics Programming Win32 GDI and DirectDraw.

