Techwiki:Win32k/XCLIPOBJ
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 _REGION { 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 };
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 { /* 000 */ WNDOBJ exClipWnd; /* 030 */ PVOID pClipRgn; // prgnRao_ or (prgnVis_ if (prgnRao_ == z)) /* 034 */ RECTL rclClipRgn; // if ShouldDoAll TRUE: Copy of clip prgn.rcl, FALSE: from // exClipWnd.co.rclBounds. /* 044 */ PVOID pscanClipRgn; // based on iDirection, ulUpDown -1 *Tail up, 1 *Head down /* 048 */ DWORD cScans; // from clip rgn cScans. /* 04C */ DWORD Unknown1; /* 050 */ ULONG ulBSize; // recomputed buffer size. /* 054 */ LONG lscnSize; // Add (+-)size for pointer based on size of SCAN & iDirection. /* 058 */ ULONG ulObjSize; // Specifies the size, in bytes, of the enum output buffer. /* 05C */ ULONG iDirection; // CD_ANY CD_LEFTDOWN CD_LEFTUP CD_LEFTWARDS CD_RIGHTDOWN // CD_RIGHTUP CD_UPWARDS /* 060 */ ULONG ClipType; // always CT_RECTANGLES aka z /* 064 */ DWORD Unknown2; // init z /* 068 */ LONG lUpDown; // -1 up, 1 down, based on "iDirection" of reading SCAN list. /* 06C */ DWORD Unknown3; // init z /* 070 */ BOOL ShouldDoAll; // Specifies whether the entire region should be enumerated. /* 074 */ DWORD nComplexity; // count/mode based on # of rect in regions SCAN. /* 078 */ PVOID pUnknown; // pointer to a large DDA based drawing structure. See Note. } XCLIPOBJ, *PXCLIPOBJ; // Size is 0x7C or 124
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.