FASTCALL
KiCallbackReturnHandler(IN PKTRAP_FRAME TrapFrame)
{
+ PKTHREAD Thread;
NTSTATUS Status;
+ /* Save the SEH chain, NtCallbackReturn will restore this */
+ TrapFrame->ExceptionList = KeGetPcr()->NtTib.ExceptionList;
+
+ /* Set thread fields */
+ Thread = KeGetCurrentThread();
+ Thread->TrapFrame = TrapFrame;
+ Thread->PreviousMode = KiUserTrap(TrapFrame);
+ NT_ASSERT(Thread->PreviousMode != KernelMode);
+
/* Pass the register parameters to NtCallbackReturn.
Result pointer is in ecx, result length in edx, status in eax */
Status = NtCallbackReturn((PVOID)TrapFrame->Ecx,
if (!NT_SUCCESS(Result))
{
/* Set the last error and fail */
- //SetLastWin32Error(RtlNtStatusToDosError(Result));
goto ExitCall;
}