Nikolay Sivov : gdi32: Use NtUserGetSysColor() directly.

Alexandre Julliard julliard at winehq.org
Tue Apr 19 16:20:13 CDT 2022


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Tue Apr 19 14:00:32 2022 +0100

gdi32: Use NtUserGetSysColor() directly.

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

---

 dlls/gdi32/uniscribe/usp10.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/dlls/gdi32/uniscribe/usp10.c b/dlls/gdi32/uniscribe/usp10.c
index a5637dbf645..3e27fcc2a03 100644
--- a/dlls/gdi32/uniscribe/usp10.c
+++ b/dlls/gdi32/uniscribe/usp10.c
@@ -31,6 +31,7 @@
 #include "windef.h"
 #include "winbase.h"
 #include "ntgdi.h"
+#include "ntuser.h"
 #include "winuser.h"
 #include "winnls.h"
 #include "winreg.h"
@@ -2107,19 +2108,6 @@ static inline BOOL does_glyph_start_cluster(const SCRIPT_VISATTR *pva, const WOR
     return FALSE;
 }
 
-static DWORD get_sys_color(INT index)
-{
-    static DWORD (WINAPI *pGetSysColor)(INT index);
-
-    if (!pGetSysColor)
-    {
-        HMODULE user = GetModuleHandleW( L"user32.dll" );
-        if (user) pGetSysColor = (void *)GetProcAddress( user, "GetSysColor" );
-    }
-
-    return pGetSysColor(index);
-}
-
 static HRESULT SS_ItemOut( SCRIPT_STRING_ANALYSIS ssa,
                            int iX,
                            int iY,
@@ -2159,11 +2147,11 @@ static HRESULT SS_ItemOut( SCRIPT_STRING_ANALYSIS ssa,
         BkMode = GetBkMode(analysis->hdc);
         SetBkMode( analysis->hdc, OPAQUE);
         BkColor = GetBkColor(analysis->hdc);
-        SetBkColor(analysis->hdc, get_sys_color(COLOR_HIGHLIGHT));
+        SetBkColor(analysis->hdc, NtUserGetSysColor(COLOR_HIGHLIGHT));
         if (!fDisabled)
         {
             TextColor = GetTextColor(analysis->hdc);
-            SetTextColor(analysis->hdc, get_sys_color(COLOR_HIGHLIGHTTEXT));
+            SetTextColor(analysis->hdc, NtUserGetSysColor(COLOR_HIGHLIGHTTEXT));
         }
     }
     if (analysis->glyphs[iItem].fallbackFont)




More information about the wine-cvs mailing list