[NTOS:KE/x64] Handle user faults in KiGeneralProtectionFaultHandler

This commit is contained in:
Timo Kreuzer 2021-06-26 18:49:47 +02:00
parent f659ac5201
commit 45f75d5d32
3 changed files with 198 additions and 15 deletions

View file

@ -701,9 +701,15 @@ RtlpUnwindInternal(
Note: this can happen after the first frame as the result of an exception */
UnwindContext.Rip = *(DWORD64*)UnwindContext.Rsp;
UnwindContext.Rsp += sizeof(DWORD64);
/* Copy the context back for the next iteration */
*ContextRecord = UnwindContext;
continue;
}
/* Save Rip before the virtual unwind */
DispatcherContext.ControlPc = UnwindContext.Rip;
/* Do a virtual unwind to get the next frame */
ExceptionRoutine = RtlVirtualUnwind(HandlerType,
ImageBase,
@ -749,7 +755,6 @@ RtlpUnwindInternal(
sizeof(DispatcherContext));
/* Set up the variable fields of the dispatcher context */
DispatcherContext.ControlPc = ContextRecord->Rip;
DispatcherContext.ImageBase = ImageBase;
DispatcherContext.FunctionEntry = FunctionEntry;
DispatcherContext.LanguageHandler = ExceptionRoutine;