[NTOS:KE/x64] Move initialization of PCR

This commit is contained in:
Timo Kreuzer 2023-12-02 16:32:20 +02:00
parent ba62dd0aaa
commit 160980aba1

View file

@ -443,6 +443,9 @@ KiSystemStartup(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
LoaderBlock->Thread = (ULONG_PTR)&KiInitialThread;
LoaderBlock->Process = (ULONG_PTR)&KiInitialProcess.Pcb;
LoaderBlock->Prcb = (ULONG_PTR)&KiInitialPcr.Prcb;
/* Initialize the PCR */
KiInitializePcr(&KiInitialPcr, 0, &KiInitialThread.Tcb, KiP0DoubleFaultStack);
}
/* Get Pcr from loader block */
@ -461,9 +464,6 @@ KiSystemStartup(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
/* Set us as the current process */
InitialThread->ApcState.Process = (PVOID)LoaderBlock->Process;
/* Initialize the PCR */
KiInitializePcr(Pcr, Cpu, InitialThread, KiP0DoubleFaultStack);
/* Initialize the CPU features */
KiInitializeCpu(Pcr);