[Kernel] Fixed invalid thread pointer in KeEnableFpuExceptions

This commit is contained in:
Gliniak 2022-12-08 21:48:13 +01:00
parent 747fb42bdf
commit 7c5da821d4
1 changed files with 2 additions and 1 deletions

View File

@ -24,7 +24,8 @@ void KeEnableFpuExceptions_entry(
// TODO(benvanik): can we do anything about exceptions?
// theres a lot more thats supposed to happen here, the floating point state has to be saved to kthread, the irql changes, the machine state register is changed to enable exceptions
X_KTHREAD* kthread = ctx->TranslateVirtualGPR<X_KTHREAD*>(ctx->r[13]);
X_KTHREAD* kthread = ctx->TranslateVirtual<X_KTHREAD*>(
ctx->TranslateVirtualGPR<X_KPCR*>(ctx->r[13])->current_thread);
kthread->fpu_exceptions_on = static_cast<uint32_t>(ctx->r[3]) != 0;
}
DECLARE_XBOXKRNL_EXPORT1(KeEnableFpuExceptions, kNone, kStub);