mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:25:39 +00:00
- Fix KeRaiseUserException (can't use "return" from SEH_HANDLE).
svn path=/trunk/; revision=23803
This commit is contained in:
parent
5fc996c43e
commit
7ea78797f2
1 changed files with 11 additions and 6 deletions
|
@ -812,27 +812,32 @@ NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
KeRaiseUserException(IN NTSTATUS ExceptionCode)
|
KeRaiseUserException(IN NTSTATUS ExceptionCode)
|
||||||
{
|
{
|
||||||
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
ULONG OldEip;
|
ULONG OldEip;
|
||||||
PKTHREAD Thread = KeGetCurrentThread();
|
PTEB Teb = KeGetCurrentThread()->Teb;
|
||||||
|
PKTRAP_FRAME TrapFrame = KeGetCurrentThread()->TrapFrame;
|
||||||
|
|
||||||
/* Make sure we can access the TEB */
|
/* Make sure we can access the TEB */
|
||||||
_SEH_TRY
|
_SEH_TRY
|
||||||
{
|
{
|
||||||
Thread->Teb->ExceptionCode = ExceptionCode;
|
/* Set the exception code */
|
||||||
|
Teb->ExceptionCode = ExceptionCode;
|
||||||
}
|
}
|
||||||
_SEH_HANDLE
|
_SEH_HANDLE
|
||||||
{
|
{
|
||||||
return(ExceptionCode);
|
/* Save exception code */
|
||||||
|
Status = ExceptionCode;
|
||||||
}
|
}
|
||||||
_SEH_END;
|
_SEH_END;
|
||||||
|
if (!NT_SUCCESS(Status)) return Status;
|
||||||
|
|
||||||
/* Get the old EIP */
|
/* Get the old EIP */
|
||||||
OldEip = Thread->TrapFrame->Eip;
|
OldEip = TrapFrame->Eip;
|
||||||
|
|
||||||
/* Change it to the user-mode dispatcher */
|
/* Change it to the user-mode dispatcher */
|
||||||
Thread->TrapFrame->Eip = (ULONG_PTR)KeRaiseUserExceptionDispatcher;
|
TrapFrame->Eip = (ULONG_PTR)KeRaiseUserExceptionDispatcher;
|
||||||
|
|
||||||
/* Return the old EIP */
|
/* Return the old EIP */
|
||||||
return((NTSTATUS)OldEip);
|
return (NTSTATUS)OldEip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue