Implement KeGetCurrentThread() routine
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
2023-02-08 23:58:24 +01:00
parent e3a900088c
commit c4a52938d2
3 changed files with 25 additions and 0 deletions

View File

@@ -37,3 +37,17 @@ KeGetCurrentProcessorControlBlock(VOID)
{
return (PKPROCESSOR_CONTROL_BLOCK)ArReadGSQuadWord(FIELD_OFFSET(KPROCESSOR_BLOCK, Prcb));
}
/**
* Gets address of current kernel's thread object.
*
* @return This routine returns address of current kernel's thread object.
*
* @since XT 1.0
*/
XTAPI
PKTHREAD
KeGetCurrentThread(VOID)
{
return (PKTHREAD)ArReadGSQuadWord(FIELD_OFFSET(KPROCESSOR_BLOCK, Prcb.CurrentThread));
}

View File

@@ -37,3 +37,10 @@ KeGetCurrentProcessorControlBlock(VOID)
{
return (PKPROCESSOR_CONTROL_BLOCK)ArReadFSDualWord(FIELD_OFFSET(KPROCESSOR_BLOCK, Prcb));
}
XTAPI
PKTHREAD
KeGetCurrentThread(VOID)
{
return (PKTHREAD)ArReadFSDualWord(FIELD_OFFSET(KPROCESSOR_BLOCK, Prcb.CurrentThread));
}