Francisco Casas : gdi32: Do not sign extend 64-bit gdi handles.

Alexandre Julliard julliard at winehq.org
Wed Oct 27 16:26:03 CDT 2021


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

Author: Francisco Casas <fcasas at codeweavers.com>
Date:   Wed Oct 27 09:47:07 2021 -0300

gdi32: Do not sign extend 64-bit gdi handles.

Testing on Windows shows typically handles are not sign extended,
however sometimes they are. It's not clear what triggers the change
in behaviour.

Signed-off-by: Francisco Casas <fcasas 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 | 2 +-
 dlls/win32u/gdiobj.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/gdi32/objects.c b/dlls/gdi32/objects.c
index 196cea9ba92..04b91cfd60f 100644
--- a/dlls/gdi32/objects.c
+++ b/dlls/gdi32/objects.c
@@ -102,7 +102,7 @@ static inline GDI_HANDLE_ENTRY *handle_entry( HGDIOBJ handle )
 static HGDIOBJ entry_to_handle( GDI_HANDLE_ENTRY *entry )
 {
     unsigned int idx = entry - get_gdi_shared()->Handles;
-    return LongToHandle( idx | (entry->Unique << NTGDI_HANDLE_TYPE_SHIFT) );
+    return ULongToHandle( idx | (entry->Unique << NTGDI_HANDLE_TYPE_SHIFT) );
 }
 
 static DWORD get_object_type( HGDIOBJ obj )
diff --git a/dlls/win32u/gdiobj.c b/dlls/win32u/gdiobj.c
index d097ba158fd..0310609afc0 100644
--- a/dlls/win32u/gdiobj.c
+++ b/dlls/win32u/gdiobj.c
@@ -55,7 +55,7 @@ const struct user_callbacks *user_callbacks = NULL;
 static inline HGDIOBJ entry_to_handle( GDI_HANDLE_ENTRY *entry )
 {
     unsigned int idx = entry - gdi_shared->Handles;
-    return LongToHandle( idx | (entry->Unique << NTGDI_HANDLE_TYPE_SHIFT) );
+    return ULongToHandle( idx | (entry->Unique << NTGDI_HANDLE_TYPE_SHIFT) );
 }
 
 static inline GDI_HANDLE_ENTRY *handle_entry( HGDIOBJ handle )




More information about the wine-cvs mailing list