Jacek Caban : gdi32: Use NtGdiDoPalette for SetPaletteEntries.

Alexandre Julliard julliard at winehq.org
Mon Aug 16 18:07:24 CDT 2021


Module: wine
Branch: master
Commit: 4fc5f0ff70dfec40b0d50af93b0beba47659009f
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=4fc5f0ff70dfec40b0d50af93b0beba47659009f

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Aug 16 10:27:37 2021 +0200

gdi32: Use NtGdiDoPalette for SetPaletteEntries.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/gdi32/objects.c |  9 +++++++++
 dlls/gdi32/palette.c | 18 ++++--------------
 2 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/dlls/gdi32/objects.c b/dlls/gdi32/objects.c
index cce783d8cfe..b1723b20085 100644
--- a/dlls/gdi32/objects.c
+++ b/dlls/gdi32/objects.c
@@ -533,3 +533,12 @@ UINT WINAPI GetPaletteEntries( HPALETTE palette, UINT start, UINT count, PALETTE
 {
     return NtGdiDoPalette( palette, start, count, entries, NtGdiGetPaletteEntries, TRUE );
 }
+
+/***********************************************************************
+ *           SetPaletteEntries    (GDI32.@)
+ */
+UINT WINAPI SetPaletteEntries( HPALETTE palette, UINT start, UINT count,
+                               const PALETTEENTRY *entries )
+{
+    return NtGdiDoPalette( palette, start, count, (void *)entries, NtGdiSetPaletteEntries, FALSE );
+}
diff --git a/dlls/gdi32/palette.c b/dlls/gdi32/palette.c
index 804d2ecbf92..a46d75e9970 100644
--- a/dlls/gdi32/palette.c
+++ b/dlls/gdi32/palette.c
@@ -193,20 +193,8 @@ UINT get_palette_entries( HPALETTE hpalette, UINT start, UINT count, PALETTEENTR
 }
 
 
-/***********************************************************************
- * SetPaletteEntries [GDI32.@]
- *
- * Sets color values for range in palette.
- *
- * RETURNS
- *    Success: Number of entries that were set
- *    Failure: 0
- */
-UINT WINAPI SetPaletteEntries(
-    HPALETTE hpalette,    /* [in] Handle of logical palette */
-    UINT start,           /* [in] Index of first entry to set */
-    UINT count,           /* [in] Number of entries to set */
-    const PALETTEENTRY *entries) /* [in] Address of array of structures */
+static UINT set_palette_entries( HPALETTE hpalette, UINT start, UINT count,
+                                 const PALETTEENTRY *entries )
 {
     PALETTEOBJ * palPtr;
     UINT numEntries;
@@ -691,6 +679,8 @@ LONG WINAPI NtGdiDoPalette( HGDIOBJ handle, WORD start, WORD count, void *entrie
 {
     switch (func)
     {
+    case NtGdiSetPaletteEntries:
+        return set_palette_entries( handle, start, count, entries );
     case NtGdiGetPaletteEntries:
         return get_palette_entries( handle, start, count, entries );
     default:




More information about the wine-cvs mailing list