Fixed KeRaiseUserException to return old EIP.

svn path=/trunk/; revision=9834
This commit is contained in:
Alex Ionescu 2004-06-23 19:42:14 +00:00
parent 7ebb752f56
commit 814c815bc1
2 changed files with 9 additions and 7 deletions

View file

@ -79,7 +79,7 @@ KiDeliverNormalApc(VOID);
BOOLEAN STDCALL KeRemoveQueueApc (PKAPC Apc);
PLIST_ENTRY STDCALL KeRundownQueue(IN PKQUEUE Queue);
VOID STDCALL
NTSTATUS STDCALL
KeRaiseUserException(NTSTATUS ExceptionCode);

View file

@ -746,14 +746,16 @@ KeInitExceptions(VOID)
* @implemented
*/
VOID STDCALL
NTSTATUS STDCALL
KeRaiseUserException(IN NTSTATUS ExceptionCode)
{
/* FIXME: This needs SEH */
ULONG OldEip;
PKTHREAD Thread = KeGetCurrentThread();
PKTHREAD Thread = KeGetCurrentThread();
ProbeForWrite(&Thread->Teb->ExceptionCode, sizeof(NTSTATUS), sizeof(NTSTATUS)); /* NT doesn't check this -- bad? */
Thread->TrapFrame->Eip = (ULONG_PTR)LdrpGetSystemDllRaiseExceptionDispatcher();
Thread->Teb->ExceptionCode = ExceptionCode;
ProbeForWrite(&Thread->Teb->ExceptionCode, sizeof(NTSTATUS), sizeof(NTSTATUS)); /* NT doesn't check this -- bad? */
OldEip = Thread->TrapFrame->Eip;
Thread->TrapFrame->Eip = (ULONG_PTR)LdrpGetSystemDllRaiseExceptionDispatcher();
Thread->Teb->ExceptionCode = ExceptionCode;
return((NTSTATUS)OldEip);
}