https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f74a2aac8ccb44f276368…
commit f74a2aac8ccb44f2763683d3200207467c14aeea
Author: Thamatip Chitpong <thamatip.chitpong(a)reactos.org>
AuthorDate: Sun Dec 24 23:42:15 2023 +0700
Commit: GitHub <noreply(a)github.com>
CommitDate: Sun Dec 24 23:42:15 2023 +0700
[NTUSER] Add UserHMSetHandle macro (#6164)
---
win32ss/include/ntuser.h | 1 +
win32ss/user/ntuser/event.c | 2 +-
win32ss/user/ntuser/timer.c | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/win32ss/include/ntuser.h b/win32ss/include/ntuser.h
index c5e08f83ac2..4299e769a69 100644
--- a/win32ss/include/ntuser.h
+++ b/win32ss/include/ntuser.h
@@ -228,6 +228,7 @@ typedef struct _PROCMARKHEAD
} PROCMARKHEAD, *PPROCMARKHEAD;
#define UserHMGetHandle(obj) ((obj)->head.h)
+#define UserHMSetHandle(obj, handle) ((obj)->head.h = (handle))
/* Window Client Information structure */
struct _ETHREAD;
diff --git a/win32ss/user/ntuser/event.c b/win32ss/user/ntuser/event.c
index b52efe9389e..daf5bef14b3 100644
--- a/win32ss/user/ntuser/event.c
+++ b/win32ss/user/ntuser/event.c
@@ -371,7 +371,7 @@ NtUserSetWinEventHook(
InsertTailList(&GlobalEvents->Events, &pEH->Chain);
GlobalEvents->Counts++;
- UserHMGetHandle(pEH) = Handle;
+ UserHMSetHandle(pEH, Handle);
pEH->eventMin = eventMin;
pEH->eventMax = eventMax;
pEH->idProcess = idProcess; // These are cmp'ed
diff --git a/win32ss/user/ntuser/timer.c b/win32ss/user/ntuser/timer.c
index 31ec4e256da..df1ebb0e6d0 100644
--- a/win32ss/user/ntuser/timer.c
+++ b/win32ss/user/ntuser/timer.c
@@ -57,7 +57,7 @@ CreateTimer(VOID)
Ret = UserCreateObject(gHandleTable, NULL, NULL, &Handle, TYPE_TIMER,
sizeof(TIMER));
if (Ret)
{
- Ret->head.h = Handle;
+ UserHMSetHandle(Ret, Handle);
InsertTailList(&TimersListHead, &Ret->ptmrList);
}