mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
[NtGDI] Fix brush attribute transfer.
This commit is contained in:
parent
ef003fa47d
commit
b5fae844de
2 changed files with 34 additions and 0 deletions
|
@ -76,6 +76,17 @@ BRUSH::~BRUSH(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VOID
|
||||||
|
BRUSH::vReleaseAttribute(VOID)
|
||||||
|
{
|
||||||
|
if (this->pBrushAttr != &this->BrushAttr)
|
||||||
|
{
|
||||||
|
this->BrushAttr = *this->pBrushAttr;
|
||||||
|
GdiPoolFree(GetBrushAttrPool(), this->pBrushAttr);
|
||||||
|
this->pBrushAttr = &this->BrushAttr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
BRUSH::vDeleteObject(
|
BRUSH::vDeleteObject(
|
||||||
_In_ PVOID pvObject)
|
_In_ PVOID pvObject)
|
||||||
|
@ -543,10 +554,19 @@ NtGdiSetBrushAttributes(
|
||||||
_In_ HBRUSH hbr,
|
_In_ HBRUSH hbr,
|
||||||
_In_ DWORD dwFlags)
|
_In_ DWORD dwFlags)
|
||||||
{
|
{
|
||||||
|
PBRUSH pbr;
|
||||||
if ( dwFlags & SC_BB_STOCKOBJ )
|
if ( dwFlags & SC_BB_STOCKOBJ )
|
||||||
{
|
{
|
||||||
if (GDIOBJ_ConvertToStockObj((HGDIOBJ*)&hbr))
|
if (GDIOBJ_ConvertToStockObj((HGDIOBJ*)&hbr))
|
||||||
{
|
{
|
||||||
|
pbr = BRUSH::LockAny(hbr);
|
||||||
|
if (pbr == NULL)
|
||||||
|
{
|
||||||
|
ERR("Failed to lock brush %p\n", hbr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
pbr->vReleaseAttribute();
|
||||||
|
pbr->vUnlock();
|
||||||
return hbr;
|
return hbr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -560,10 +580,22 @@ NtGdiClearBrushAttributes(
|
||||||
_In_ HBRUSH hbr,
|
_In_ HBRUSH hbr,
|
||||||
_In_ DWORD dwFlags)
|
_In_ DWORD dwFlags)
|
||||||
{
|
{
|
||||||
|
PBRUSH pbr;
|
||||||
if ( dwFlags & SC_BB_STOCKOBJ )
|
if ( dwFlags & SC_BB_STOCKOBJ )
|
||||||
{
|
{
|
||||||
if (GDIOBJ_ConvertFromStockObj((HGDIOBJ*)&hbr))
|
if (GDIOBJ_ConvertFromStockObj((HGDIOBJ*)&hbr))
|
||||||
{
|
{
|
||||||
|
pbr = BRUSH::LockAny(hbr);
|
||||||
|
if (pbr == NULL)
|
||||||
|
{
|
||||||
|
ERR("Failed to lock brush %p\n", hbr);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
if (!pbr->bAllocateBrushAttr())
|
||||||
|
{
|
||||||
|
ERR("Failed to allocate brush attribute\n");
|
||||||
|
}
|
||||||
|
pbr->vUnlock();
|
||||||
return hbr;
|
return hbr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,6 +113,8 @@ public:
|
||||||
VOID
|
VOID
|
||||||
vSetSolidColor(
|
vSetSolidColor(
|
||||||
_In_ COLORREF crColor);
|
_In_ COLORREF crColor);
|
||||||
|
|
||||||
|
VOID vReleaseAttribute(VOID);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* HACK! */
|
/* HACK! */
|
||||||
|
|
Loading…
Reference in a new issue