From cec7adb97fcb9e3b0f31a726c1537bc7255dfc61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Fri, 23 Feb 2024 22:53:36 +0100 Subject: [PATCH] [SDK:NDK/XDK] Adjust the KeGetPcr() ARM definition (#6542) Re-enable the KIPCR() macro and use it for KeGetPcr() and KeGetCurrentProcessorNumber() definitions. --- sdk/include/xdk/arm/ke.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sdk/include/xdk/arm/ke.h b/sdk/include/xdk/arm/ke.h index dc344b30c11..5a611a0dfde 100644 --- a/sdk/include/xdk/arm/ke.h +++ b/sdk/include/xdk/arm/ke.h @@ -334,14 +334,13 @@ typedef struct _KPCR } KPCR, *PKPCR; #define CP15_PCR_RESERVED_MASK 0xFFF -//#define KIPCR() ((ULONG_PTR)(_MoveFromCoprocessor(CP15_TPIDRPRW)) & ~CP15_PCR_RESERVED_MASK) +#define KIPCR() (((ULONG_PTR)_MoveFromCoprocessor(CP15_TPIDRPRW)) & ~CP15_PCR_RESERVED_MASK) FORCEINLINE PKPCR -KeGetPcr( - VOID) +KeGetPcr(VOID) { - return (PKPCR)(_MoveFromCoprocessor(CP15_TPIDRPRW) & ~CP15_PCR_RESERVED_MASK); + return (PKPCR)KIPCR(); } #if (NTDDI_VERSION < NTDDI_WIN7) || !defined(NT_PROCESSOR_GROUPS) @@ -349,8 +348,8 @@ FORCEINLINE ULONG KeGetCurrentProcessorNumber(VOID) { - return *((PUCHAR)KeGetPcr() + 0x580); + return (ULONG)*((PUCHAR)KIPCR() + 0x580); } #endif /* (NTDDI_VERSION < NTDDI_WIN7) || !defined(NT_PROCESSOR_GROUPS) */ -$endif +$endif (_NTDDK_)