Commit 3787b434 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

gdi32: Use NtGdiCreatePaletteInternal for CreatePalette.

parent 76821849
......@@ -516,3 +516,12 @@ HCOLORSPACE WINAPI SetColorSpace( HDC hdc, HCOLORSPACE cs )
FIXME( "stub\n" );
return cs;
}
/***********************************************************************
* CreatePalette (GDI32.@)
*/
HPALETTE WINAPI CreatePalette( const LOGPALETTE *palette )
{
if (!palette) return 0;
return NtGdiCreatePaletteInternal( palette, palette->palNumEntries );
}
......@@ -94,28 +94,23 @@ HPALETTE PALETTE_Init(void)
/***********************************************************************
* CreatePalette [GDI32.@]
* NtGdiCreatePaletteInternal (win32u.@)
*
* Creates a logical color palette.
*
* RETURNS
* Success: Handle to logical palette
* Failure: NULL
*/
HPALETTE WINAPI CreatePalette(
const LOGPALETTE* palette) /* [in] Pointer to logical color palette */
HPALETTE WINAPI NtGdiCreatePaletteInternal( const LOGPALETTE *palette, UINT count )
{
PALETTEOBJ * palettePtr;
HPALETTE hpalette;
int size;
if (!palette) return 0;
TRACE("entries=%i\n", palette->palNumEntries);
TRACE( "entries=%u\n", count );
if (!(palettePtr = HeapAlloc( GetProcessHeap(), 0, sizeof(*palettePtr) ))) return 0;
palettePtr->unrealize = NULL;
palettePtr->version = palette->palVersion;
palettePtr->count = palette->palNumEntries;
palettePtr->count = count;
size = palettePtr->count * sizeof(*palettePtr->entries);
if (!(palettePtr->entries = HeapAlloc( GetProcessHeap(), 0, size )))
{
......
......@@ -164,6 +164,7 @@ BOOL WINAPI NtGdiComputeXformCoefficients( HDC hdc );
HBITMAP WINAPI NtGdiCreateBitmap( INT width, INT height, UINT planes,
UINT bpp, const void *bits );
HBRUSH WINAPI NtGdiCreateHatchBrushInternal( INT style, COLORREF color, BOOL pen );
HPALETTE WINAPI NtGdiCreatePaletteInternal( const LOGPALETTE *palette, UINT count );
BOOL WINAPI NtGdiEllipse( HDC hdc, INT left, INT top, INT right, INT bottom );
INT WINAPI NtGdiEndDoc(HDC hdc);
BOOL WINAPI NtGdiEndPath( HDC hdc );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment