23 static ULONG ulGlobalBrushUnique = 0;
112 ERR(
"Could not allocate brush attr\n");
175 plb->lbHatch = this->
iHatch;
209 BASEOBJECT::OWNER owner;
216 pbr =
new BRUSH(flAttrs, crColor,
iHatch, hbmPattern, pvClient);
219 ERR(
"Failed to allocate a brush\n");
229 if (!pbr->bAllocateBrushAttr())
231 ERR(
"Failed to allocate brush attribute\n");
238 owner = (flAttrs &
BR_IS_GLOBAL) ? BASEOBJECT::OWNER::PUBLIC :
239 BASEOBJECT::OWNER::POWNED;
242 hbr =
static_cast<HBRUSH
>(pbr->hInsertObject(owner));
245 ERR(
"Failed to insert brush\n");
266 BRUSH::vDeleteObject(pvObject);
276 return pbr->cjGetObject(
cjBuffer, plbBuffer);
324 pbr = BRUSH::LockAny(hbr);
327 ERR(
"Failed to lock brush %p\n", hbr);
332 pbr->vSetSolidColor(crColor);
347 WARN(
"hbr is not supported, ignoring\n");
366 WARN(
"bPen is not supported, ignoring\n");
400 WARN(
"b8X8 is not supported, ignoring\n");
405 WARN(
"bPen is not supported, ignoring\n");
410 if (hbmPattern ==
NULL)
412 ERR(
"Failed to copy the bitmap %p\n", hbmPattern);
438 WARN(
"b8X8 is not supported, ignoring\n");
443 WARN(
"bPen is not supported, ignoring\n");
448 ERR(
"Invalid uUsage value: %lu\n", uUsage);
455 if (pvPackedDIB ==
NULL)
457 ERR(
"Failed to allocate temp buffer of %u bytes\n",
cj);
469 ERR(
"Got exception, pv = %p, cj = %lu\n", pv,
cj);
496 ERR(
"Failed to create bitmap from DIB\n");
522 pbr = BRUSH::LockForRead(hbr);
525 ERR(
"Failed to lock brush %p\n", hbr);
530 hbm = pbr->hbmGetBitmapHandle(&uUsage);
542 ERR(
"Got exception! piUsage = %p\n", piUsage);
562 pbr = BRUSH::LockAny(hbr);
565 ERR(
"Failed to lock brush %p\n", hbr);
568 pbr->vReleaseAttribute();
588 pbr = BRUSH::LockAny(hbr);
591 ERR(
"Failed to lock brush %p\n", hbr);
594 if (!pbr->bAllocateBrushAttr())
596 ERR(
"Failed to allocate brush attribute\n");
HBITMAP FASTCALL BITMAP_CopyBitmap(HBITMAP hBitmap)
BOOL NTAPI GreSetBitmapOwner(_In_ HBITMAP hbmp, _In_ ULONG ulOwner)
#define DBG_DEFAULT_CHANNEL(ch)
HBRUSH APIENTRY IntGdiCreateSolidBrush(COLORREF crColor)
HBRUSH NTAPI IntGdiCreateNullBrush(VOID)
__kernel_entry HBRUSH APIENTRY NtGdiSetBrushAttributes(_In_ HBRUSH hbr, _In_ DWORD dwFlags)
VOID NTAPI BRUSH_vDeleteObject(PVOID pvObject)
__kernel_entry HBRUSH APIENTRY NtGdiCreatePatternBrushInternal(_In_ HBITMAP hbmClient, _In_ BOOL bPen, _In_ BOOL b8X8)
__kernel_entry HBRUSH APIENTRY NtGdiCreateSolidBrush(_In_ COLORREF crColor, _In_opt_ HBRUSH hbr)
static HBRUSH CreateBrushInternal(_In_ ULONG flAttrs, _In_ COLORREF crColor, _In_ ULONG iHatch, _In_opt_ HBITMAP hbmPattern, _In_opt_ PVOID pvClient)
INT FASTCALL BRUSH_GetObject(PBRUSH pbr, INT cjBuffer, LPLOGBRUSH plbBuffer)
__kernel_entry HBITMAP APIENTRY NtGdiGetObjectBitmapHandle(_In_ HBRUSH hbr, _Out_ UINT *piUsage)
HBRUSH NTAPI IntGdiCreatePatternBrush(HBITMAP hbmPattern)
__kernel_entry HBRUSH APIENTRY NtGdiCreateDIBBrush(_In_reads_bytes_(cj) PVOID pv, _In_ FLONG uUsage, _In_ UINT cj, _In_ BOOL b8X8, _In_ BOOL bPen, _In_ PVOID pvClient)
__kernel_entry HBRUSH APIENTRY NtGdiCreateHatchBrushInternal(_In_ ULONG iHatch, _In_ COLORREF crColor, _In_ BOOL bPen)
VOID NTAPI IntGdiSetSolidBrushColor(_In_ HBRUSH hbr, _In_ COLORREF crColor)
__kernel_entry HBRUSH APIENTRY NtGdiClearBrushAttributes(_In_ HBRUSH hbr, _In_ DWORD dwFlags)
PGDI_POOL GetBrushAttrPool(VOID)
VOID vSetObjectAttr(_In_opt_ PVOID pvUserAttr)
VOID vReleaseAttribute(VOID)
BRUSH(_In_ FLONG flAttrs, _In_ COLORREF crColor, _In_ ULONG iHatch, _In_opt_ HBITMAP hbmPattern, _In_opt_ PVOID pvClient, _In_ GDILOOBJTYPE objtype)
BOOL bAllocateBrushAttr(VOID)
UINT cjGetObject(_In_ UINT cjBuffer, _Out_bytecap_(cjBuffer) PLOGBRUSH plbBuffer) const
HBITMAP hbmGetBitmapHandle(_Out_ PUINT puUsage) const
static VOID vDeleteObject(_In_ PVOID pvObject)
VOID vSetSolidColor(_In_ COLORREF crColor)
#define ERROR_INVALID_PARAMETER
static void cleanup(void)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define InterlockedIncrementUL(Addend)
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
#define BR_IS_DIBPALINDICES
#define BR_IS_DEFAULTSTYLE
#define BR_IS_DIBPALCOLORS
#define GDI_HANDLE_GET_TYPE(h)
@ GDILoObjType_LO_BRUSH_TYPE
@ GDILoObjType_LO_EXTPEN_TYPE
@ GDILoObjType_LO_PEN_TYPE
enum GDILoObjType GDILOOBJTYPE
VOID NTAPI GdiPoolFree(PGDI_POOL pPool, PVOID pvAlloc)
PVOID NTAPI GdiPoolAllocate(PGDI_POOL pPool)
#define EXCEPTION_EXECUTE_HANDLER
#define ExFreePoolWithTag(_P, _T)
#define _In_reads_bytes_(size)
#define _Out_bytecap_(size)
#define _SEH2_EXCEPT(...)
#define RtlCopyMemory(Destination, Source, Length)
HBITMAP NTAPI GreCreateDIBitmapFromPackedDIB(_In_reads_(cjPackedDIB) PVOID pvPackedDIB, _In_ UINT cjPackedDIB, _In_ ULONG uUsage)
#define DIB_PAL_BRUSHHACK
BOOL NTAPI GDIOBJ_ConvertToStockObj(HGDIOBJ *phObj)
BOOL NTAPI GDIOBJ_ConvertFromStockObj(HGDIOBJ *phObj)
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
BOOL NTAPI GreIsHandleValid(HGDIOBJ hobj)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
_Inout_ SURFOBJ _In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_opt_ XLATEOBJ _In_ ULONG iHatch
struct tagLOGBRUSH LOGBRUSH