From fc85e0674b436403c88b203d64ad631748cf89d8 Mon Sep 17 00:00:00 2001 From: belliash Date: Mon, 13 Nov 2023 15:36:50 +0100 Subject: [PATCH] Let KeGetCurrentProcessorControlBlock() use CurrentPrcb field and correct comments --- xtoskrnl/ke/amd64/proc.c | 6 +++--- xtoskrnl/ke/i686/proc.c | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/xtoskrnl/ke/amd64/proc.c b/xtoskrnl/ke/amd64/proc.c index 9022eb3..4d7d26b 100644 --- a/xtoskrnl/ke/amd64/proc.c +++ b/xtoskrnl/ke/amd64/proc.c @@ -39,11 +39,11 @@ KeGetCurrentProcessorControlBlock(VOID) } /** - * Gets address of current kernel's thread object. + * Gets the current thread running on the currently executing processor. * - * @return This routine returns address of current kernel's thread object. + * @return This routine returns the address of the current thread object. * - * @since XT 1.0 + * @since NT 3.5 */ XTAPI PKTHREAD diff --git a/xtoskrnl/ke/i686/proc.c b/xtoskrnl/ke/i686/proc.c index b7e498b..9893dca 100644 --- a/xtoskrnl/ke/i686/proc.c +++ b/xtoskrnl/ke/i686/proc.c @@ -35,9 +35,16 @@ XTAPI PKPROCESSOR_CONTROL_BLOCK KeGetCurrentProcessorControlBlock(VOID) { - return (PKPROCESSOR_CONTROL_BLOCK)ArReadFSDualWord(FIELD_OFFSET(KPROCESSOR_BLOCK, Prcb)); + return (PKPROCESSOR_CONTROL_BLOCK)ArReadFSDualWord(FIELD_OFFSET(KPROCESSOR_BLOCK, CurrentPrcb)); } +/** + * Gets the current thread running on the currently executing processor. + * + * @return This routine returns the address of the current thread object. + * + * @since NT 3.5 + */ XTAPI PKTHREAD KeGetCurrentThread(VOID)