Techwiki:Win32k/BRUSH

From ReactOS Wiki
Revision as of 14:59, 1 March 2011 by ThePhysicist (talk | contribs)
Jump to: navigation, search

BRUSH as found on Windows XP


typedef _BRUSHATTR
{
    UINT AttrFlags;
    COLORREF lbColor;
} BRUSHATTR, *PBRUSHATTR;
typedef _BRUSH
{
    BASEOBJECT baseobj;       // 0x000 ulShareCount = 6
    ULONG      ulStyle;       // 0x010
    HBITMAP    hbmPattern;    // 0x014 01050078 
    HBITMAP    hbmClient;     // 0x018 01050077 invalid handle
    FLONG      flAttrs;       // 0x01c 00020043 
    ULONG      ulBrushUnique; // 0x020 0000002e ?
    PBRUSHATTR pbrushattr;    // 0x024 e16293c8
    BRUSHATTR  brushattr;     // 0x028
    DWORD      unk030;        // 0x030 00000000
    ULONG      unk034;        // 0x034 00000000 ?
    BOOL       bCacheGrabbed; // 0x038 00000001 ?
    COLORREF   crBack;        // 0x03c 00d8e9ec
    COLORREF   crFore;        // 0x040 00ffffff
    ULONG      ulPalTime;     // 0x044 00000004 ?
    ULONG      ulSurfTime;    // 0x048 00000008 ?
    PVOID      pvRBrush       // 0x04c e16146b0 -> 'Gdbr' (ulRealisation in gdikdx)
    PPDEVOBJ   ppdev;         // 0x050 e1d17008 -> 'GDev'
    DWORD      unk054;        // 0x054 ffffffff 
    LONG       lWidth;        // 0x058 00000000  Width is measured in LONG device coordinates
                              //                 for a cosmetic wide line.
                              // NtGdiExtCreatePen ulWidth
    FLOATL     eWidth;        // 0x05c 00000000  Width is measured in FLOAT world coordinates
                              //                 for a geometric wide line.
    ULONG      ulPenStyle;    // 0x060
    DWORD     *pStyle;        // 0x064 -> 'Gsty' Pointer to an array of FLOAT_LONG elements
                              // Allocated copy of pulStyle.
    DWORD      dwStyleCount;  // 0x068           Specifies the number of entries in the style
                              //                 array pointed to by the pstyle member.
    BYTE       jJoin;         // 0x06c 00        join styles for geometric wide lines
    BYTE       jEndCap;       //       00        end cap style for a geometric wide line
    WORD       unk06e;        // 0x06e 0100
    INT        iBrushStyle;   // 0x070 8a27f1f0 ???
    PREGION    prgn;          // 0x074 e1610008 -> 'Gla4'
    DWORD      unk078;        // 0x078 00020210 
    DWORD      unk07c;        // 0x07c 7153624f
    LIST_ENTRY ListHead;      // 0x080
} BRUSH, *PBRUSH;

Fields

flAttrs

Flags for the brush
#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