From 210c4341baa8b0db88676661bb46f9bd9a7d3c93 Mon Sep 17 00:00:00 2001 From: Ratin Gao Date: Sun, 10 Nov 2024 11:01:56 +0800 Subject: [PATCH] [NT:EXTENSION] `NtCurrent(Process/Thread)Id` return a `ULONG` value --- Source/Include/KNSoft/NDK/NT/Extension/Runtime.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Include/KNSoft/NDK/NT/Extension/Runtime.h b/Source/Include/KNSoft/NDK/NT/Extension/Runtime.h index e874d0a..0bacfa0 100644 --- a/Source/Include/KNSoft/NDK/NT/Extension/Runtime.h +++ b/Source/Include/KNSoft/NDK/NT/Extension/Runtime.h @@ -159,8 +159,8 @@ NtSetLastStatus( #pragma region Current runtime information #define NtCurrentPeb() ((PPEB)ReadTeb(ProcessEnvironmentBlock)) -#define NtCurrentProcessId() ((HANDLE)ReadTeb(ClientId.UniqueProcess)) -#define NtCurrentThreadId() ((HANDLE)ReadTeb(ClientId.UniqueThread)) +#define NtCurrentProcessId() ((ULONG)(ULONG_PTR)ReadTeb(ClientId.UniqueProcess)) +#define NtCurrentThreadId() ((ULONG)(ULONG_PTR)ReadTeb(ClientId.UniqueThread)) #define NtCurrentLogonId() (NtCurrentPeb()->LogonId) #define NtGetProcessHeap() (NtCurrentPeb()->ProcessHeap) #define NtGetNtdllBase() (CONTAINING_RECORD(NtCurrentPeb()->Ldr->InInitializationOrderModuleList.Flink, LDR_DATA_TABLE_ENTRY, InInitializationOrderLinks)->DllBase)