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

This commit is contained in:
Rafal Kupiec 2023-02-08 23:58:24 +01:00
parent e3a900088c
commit c4a52938d2
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
3 changed files with 25 additions and 0 deletions

View File

@ -20,6 +20,10 @@ XTAPI
PKPROCESSOR_CONTROL_BLOCK
KeGetCurrentProcessorControlBlock(VOID);
XTAPI
PKTHREAD
KeGetCurrentThread(VOID);
XTAPI
VOID
KepArchInitialize(VOID);

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));
}