mirror of
https://github.com/reactos/reactos.git
synced 2025-05-28 21:48:19 +00:00
[WIN32K]
- Implement NtGdiGetObjectBitmapHandle - Set BR_IS_DIBPALCOLORS in IntGdiCreateDIBBrush svn path=/trunk/; revision=65884
This commit is contained in:
parent
30d86f26f4
commit
ed7952a360
2 changed files with 79 additions and 44 deletions
|
@ -923,18 +923,6 @@ NtGdiGetUFI(
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
HBRUSH
|
|
||||||
APIENTRY
|
|
||||||
NtGdiClearBrushAttributes(
|
|
||||||
IN HBRUSH hbm,
|
|
||||||
IN DWORD dwFlags)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
|
@ -1256,19 +1244,6 @@ NtGdiGetLinkedUFIs(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
HBITMAP
|
|
||||||
APIENTRY
|
|
||||||
NtGdiGetObjectBitmapHandle(
|
|
||||||
IN HBRUSH hbr,
|
|
||||||
OUT UINT *piUsage)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
@ -1410,19 +1385,6 @@ NtGdiSetupPublicCFONT(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* @unimplemented
|
|
||||||
*/
|
|
||||||
HBRUSH
|
|
||||||
APIENTRY
|
|
||||||
NtGdiSetBrushAttributes(
|
|
||||||
IN HBRUSH hbm,
|
|
||||||
IN DWORD dwFlags)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -200,10 +200,10 @@ BRUSH_GetObject(PBRUSH pbrush, INT cjSize, LPLOGBRUSH plogbrush)
|
||||||
HBRUSH
|
HBRUSH
|
||||||
APIENTRY
|
APIENTRY
|
||||||
IntGdiCreateDIBBrush(
|
IntGdiCreateDIBBrush(
|
||||||
CONST BITMAPINFO *BitmapInfo,
|
const BITMAPINFO *BitmapInfo,
|
||||||
UINT ColorSpec,
|
UINT uUsage,
|
||||||
UINT BitmapInfoSize,
|
UINT BitmapInfoSize,
|
||||||
CONST VOID *PackedDIB)
|
const VOID* pvClient)
|
||||||
{
|
{
|
||||||
HBRUSH hBrush;
|
HBRUSH hBrush;
|
||||||
PBRUSH pbrush;
|
PBRUSH pbrush;
|
||||||
|
@ -217,9 +217,9 @@ IntGdiCreateDIBBrush(
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
DataPtr = (ULONG_PTR)BitmapInfo + DIB_BitmapInfoSize(BitmapInfo, ColorSpec);
|
DataPtr = (ULONG_PTR)BitmapInfo + DIB_BitmapInfoSize(BitmapInfo, uUsage);
|
||||||
|
|
||||||
hPattern = DIB_CreateDIBSection(NULL, BitmapInfo, ColorSpec, &pvDIBits, NULL, 0, 0);
|
hPattern = DIB_CreateDIBSection(NULL, BitmapInfo, uUsage, &pvDIBits, NULL, 0, 0);
|
||||||
if (hPattern == NULL)
|
if (hPattern == NULL)
|
||||||
{
|
{
|
||||||
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
|
@ -241,8 +241,10 @@ IntGdiCreateDIBBrush(
|
||||||
hBrush = pbrush->BaseObject.hHmgr;
|
hBrush = pbrush->BaseObject.hHmgr;
|
||||||
|
|
||||||
pbrush->flAttrs |= BR_IS_BITMAP | BR_IS_DIB;
|
pbrush->flAttrs |= BR_IS_BITMAP | BR_IS_DIB;
|
||||||
|
if (uUsage == DIB_PAL_COLORS)
|
||||||
|
pbrush->flAttrs |= BR_IS_DIBPALCOLORS;
|
||||||
pbrush->hbmPattern = hPattern;
|
pbrush->hbmPattern = hPattern;
|
||||||
pbrush->hbmClient = (HBITMAP)PackedDIB;
|
pbrush->hbmClient = (HBITMAP)pvClient;
|
||||||
/* FIXME: Fill in the rest of fields!!! */
|
/* FIXME: Fill in the rest of fields!!! */
|
||||||
|
|
||||||
GreSetObjectOwner(hPattern, GDI_OBJ_HMGR_PUBLIC);
|
GreSetObjectOwner(hPattern, GDI_OBJ_HMGR_PUBLIC);
|
||||||
|
@ -460,5 +462,76 @@ NtGdiCreateSolidBrush(COLORREF Color,
|
||||||
return IntGdiCreateSolidBrush(Color);
|
return IntGdiCreateSolidBrush(Color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HBITMAP
|
||||||
|
APIENTRY
|
||||||
|
NtGdiGetObjectBitmapHandle(
|
||||||
|
_In_ HBRUSH hbr,
|
||||||
|
_Out_ UINT *piUsage)
|
||||||
|
{
|
||||||
|
HBITMAP hbmPattern;
|
||||||
|
PBRUSH pbr;
|
||||||
|
|
||||||
|
/* Lock the brush */
|
||||||
|
pbr = BRUSH_ShareLockBrush(hbr);
|
||||||
|
if (pbr == NULL)
|
||||||
|
{
|
||||||
|
DPRINT1("Could not lock brush\n");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Get the pattern bitmap handle */
|
||||||
|
hbmPattern = pbr->hbmPattern;
|
||||||
|
|
||||||
|
_SEH2_TRY
|
||||||
|
{
|
||||||
|
ProbeForWrite(piUsage, sizeof(*piUsage), sizeof(*piUsage));
|
||||||
|
|
||||||
|
/* Set usage according to flags */
|
||||||
|
if (pbr->flAttrs & BR_IS_DIBPALCOLORS)
|
||||||
|
*piUsage = DIB_PAL_COLORS;
|
||||||
|
else
|
||||||
|
*piUsage = DIB_RGB_COLORS;
|
||||||
|
}
|
||||||
|
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||||
|
{
|
||||||
|
DPRINT1("Got exception!\n");
|
||||||
|
hbmPattern = NULL;
|
||||||
|
}
|
||||||
|
_SEH2_END;
|
||||||
|
|
||||||
|
/* Unlock the brush */
|
||||||
|
BRUSH_ShareUnlockBrush(pbr);
|
||||||
|
|
||||||
|
/* Return the pattern bitmap handle */
|
||||||
|
return hbmPattern;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @unimplemented
|
||||||
|
*/
|
||||||
|
HBRUSH
|
||||||
|
APIENTRY
|
||||||
|
NtGdiSetBrushAttributes(
|
||||||
|
IN HBRUSH hbm,
|
||||||
|
IN DWORD dwFlags)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @unimplemented
|
||||||
|
*/
|
||||||
|
HBRUSH
|
||||||
|
APIENTRY
|
||||||
|
NtGdiClearBrushAttributes(
|
||||||
|
IN HBRUSH hbr,
|
||||||
|
IN DWORD dwFlags)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Reference in a new issue