https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dd75ae8eca21320cdf9f5…
commit dd75ae8eca21320cdf9f5a225e87c8d187ee4b58
Author: Thamatip Chitpong <tangaming123456(a)outlook.com>
AuthorDate: Wed Oct 26 07:17:01 2022 +0700
Commit: GitHub <noreply(a)github.com>
CommitDate: Wed Oct 26 02:17:01 2022 +0200
[WIN32SS] Use GDI_HANDLE_* macros for readability (#4797)
---
win32ss/gdi/gdi32/misc/misc.c | 2 +-
win32ss/gdi/gdi32/objects/gdiobj.c | 2 +-
win32ss/gdi/ntgdi/palette.c | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/win32ss/gdi/gdi32/misc/misc.c b/win32ss/gdi/gdi32/misc/misc.c
index f753e9bde0f..a1006c7b832 100644
--- a/win32ss/gdi/gdi32/misc/misc.c
+++ b/win32ss/gdi/gdi32/misc/misc.c
@@ -735,7 +735,7 @@ GdiFixUpHandle(HGDIOBJ hGdiObj)
{
PGDI_TABLE_ENTRY Entry;
- if (((ULONG_PTR)(hGdiObj)) & GDI_HANDLE_UPPER_MASK )
+ if (GDI_HANDLE_GET_UPPER(hGdiObj))
{
return hGdiObj;
}
diff --git a/win32ss/gdi/gdi32/objects/gdiobj.c b/win32ss/gdi/gdi32/objects/gdiobj.c
index 5f8d8e1f6c3..c1b6c2abe07 100644
--- a/win32ss/gdi/gdi32/objects/gdiobj.c
+++ b/win32ss/gdi/gdi32/objects/gdiobj.c
@@ -320,7 +320,7 @@ DeleteObject(HGDIOBJ hObject)
return FALSE;
/* Check if this is a stock object */
- if ((DWORD_PTR)hObject & GDI_HANDLE_STOCK_MASK)
+ if (GDI_HANDLE_IS_STOCKOBJ(hObject))
{
/* Ignore the attempt to delete a stock object */
DPRINT1("Trying to delete system object 0x%p\n", hObject);
diff --git a/win32ss/gdi/ntgdi/palette.c b/win32ss/gdi/ntgdi/palette.c
index de0fe9c66c8..ac8b625792f 100644
--- a/win32ss/gdi/ntgdi/palette.c
+++ b/win32ss/gdi/ntgdi/palette.c
@@ -961,7 +961,7 @@ IntSetPaletteEntries(
PPALETTE palGDI;
ULONG numEntries;
- if ((UINT_PTR)hpal & GDI_HANDLE_STOCK_MASK)
+ if (GDI_HANDLE_IS_STOCKOBJ(hpal))
{
return 0;
}
@@ -1245,7 +1245,7 @@ NtGdiUnrealizeObject(HGDIOBJ hgdiobj)
PPALETTE palGDI;
if ( !hgdiobj ||
- ((UINT_PTR)hgdiobj & GDI_HANDLE_STOCK_MASK) ||
+ GDI_HANDLE_IS_STOCKOBJ(hgdiobj) ||
!GDI_HANDLE_IS_TYPE(hgdiobj, GDI_OBJECT_TYPE_PALETTE) )
return Ret;