Techwiki:Win32k/EBRUSHOBJ

From ReactOS Wiki
Jump to: navigation, search

EBRUSHOBJ as it is on XP. fields were found using WinDbg and dumping DCOBJ structures. Note: Don't mix this structure with BRUSH or GDIBRUSH, the structure for the handle.

size is 0x5c

typedef struct _BRUSHOBJ
{
  ULONG  iSolidColor;
  PVOID  pvRbrush;
  FLONG  flColorType;
} BRUSHOBJ;

typedef struct _EBRUSHOBJ
{ //                             W2k WXP
  BRUSHOBJ    brushobj;       // 000 000
  COLORREF    crRealize;      // 00C 00C : 00808080 == ulRGBColor
  ULONG       ulRGBColor;     //     010 : see above
  PENGBRUSH   pengbrush;      // 014     : 00000000 
  ULONG       ulSurfPalTime;  // 018     : 002521c7 
  ULONG       ulDCPalTime;    // 01C 01C : 002521c8
  COLORREF    crCurrentText;  // 020     : 00000000 
  COLORREF    crCurrentBack;  // 024     : 00ffffff 
  COLORADJUSTMENT * pca;      // 028     : e1b632c8 , pointer to DCOBJ.dcLevel.ca
  HANDLE      hColorTransform;// 02c     : 00000000
  FLONG       flFlags;        // 030     : 00000000 , If hCT has handle, bit 0x0002 is set
  SURFACE *   psurfTrg;       // 034 034 : e1fb9a10 -> 'Gla5' (surface), gdikdx says psoTarg1
  PPALETTE    ppalSurf;       // 038 038 : e1a11558 -> 'Gla8' (palette), gdikdx says palSurf1
  PPALETTE    ppalDC;         // 03c 03C : e19f24b8 -> 'Gh08' (palette), gdikdx says palDC1
  PPALETTE    ppal3;          // 040     : e1a11558 -> 'Gla8' (palette)
  DWORD       dwUnknown44;    // 044     : 00000006 
  BRUSH *     pbrush;         // 048     : e1726b68 -> 'Gla@' (brush)
  FLONG       flattrs;        // 04c     : 80040214
  DWORD       ulUnique;       // 050 050 : identical to BRUSH.ulUniqueBrush
#if (NTDDI_VERSION >= NTDDI_WINXP)
  DWORD       dwUnknown54;    //     054 : 00000001 
  DWORD       dwUnknown58;    //     058 : 00000000 
#endif
} EBRUSHOBJ, *PEBRUSHOBJ;

Fields

crRealize

RGB Color value of iSolidColor

ulRGBColor

same as crRealize? FIXME: what is this really?

pengbrush

Pointer to GDI's brush realisation. Tag is 'Gebr' (ENGBRUSH)

pbrush

Points to the corresponding BRUSH object. Points to the stockobject if the DC has selected DC_PEN or DC_BRUSH.

flattrs

Identical to BRUSH.flAttrs flags.
#define BR_NEED_FG_CLR      0x00000001
#define BR_NEED_BK_CLR      0x00000002  // Background color is needed
#define BR_DITHER_OK        0x00000004  // Allow color dithering
#define BR_IS_SOLID         0x00000010  // Solid brush
#define BR_IS_HATCH         0x00000020  // Hatch brush
#define BR_IS_BITMAP        0x00000040  // DDB pattern brush
#define BR_IS_DIB           0x00000080  // DIB pattern brush
#define BR_IS_NULL          0x00000100  // Null/hollow brush
#define BR_IS_GLOBAL        0x00000200  // Stock objects
#define BR_IS_PEN           0x00000400  // Pen created with ExtCreatePen
#define BR_IS_OLDSTYLEPEN   0x00000800  // Pen created with CreatePen
#define BR_IS_DIBPALCOLORS  0x00001000
#define BR_IS_DIBPALINDICES 0x00002000
#define BR_IS_DEFAULTSTYLE  0x00004000
#define BR_IS_MASKING       0x00008000  // Pattern bitmap is used as transparent mask (?)
#define BR_IS_INSIDEFRAME   0x00010000
#define BR_CACHED_ENGINE    0x00040000
#define BR_CACHED_IS_SOLID  0x80000000
  • Solid brushes have the RGB color in crRealize and the color translated to the surface in iSolidColor, which is identical to ulRealization member of the corresponding BRUSH.
  • The value of UlUnique is identical to the BRUSHes ulBrushUnique.