2005-01-06 13:58:04 +00:00
|
|
|
/* $Id$
|
2004-06-24 19:30:21 +00:00
|
|
|
*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS kernel
|
|
|
|
* PURPOSE: User-mode exception support
|
|
|
|
* FILE: lib/ntdll/rtl/exception.c
|
|
|
|
* PROGRAMERS: David Welch <welch@cwcom.net>
|
|
|
|
* Skywing <skywing@valhallalegends.com>
|
|
|
|
* KJK::Hyperion <noog@libero.it>
|
|
|
|
* UPDATES: Skywing, 09/11/2003: Implemented RtlRaiseException and
|
|
|
|
* KiUserRaiseExceptionDispatcher.
|
|
|
|
* KJK::Hyperion, 22/06/2004: Moved the common parts here,
|
|
|
|
* left the user-mode code in ntdll
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES *****************************************************************/
|
|
|
|
|
2005-05-08 05:14:46 +00:00
|
|
|
#include "rtl.h"
|
2004-06-24 19:30:21 +00:00
|
|
|
|
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
/* FUNCTIONS ***************************************************************/
|
|
|
|
|
|
|
|
/* implemented in except.s */
|
|
|
|
VOID
|
|
|
|
RtlpCaptureContext(PCONTEXT Context);
|
|
|
|
|
2004-08-05 18:17:37 +00:00
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
|
|
|
NTSTATUS
|
|
|
|
STDCALL
|
|
|
|
RtlDispatchException(
|
2005-05-09 01:41:02 +00:00
|
|
|
PEXCEPTION_RECORD pExcptRec,
|
|
|
|
CONTEXT * pContext
|
2004-08-05 18:17:37 +00:00
|
|
|
)
|
|
|
|
{
|
|
|
|
UNIMPLEMENTED;
|
|
|
|
return STATUS_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
|
|
|
VOID
|
|
|
|
STDCALL
|
|
|
|
RtlGetCallersAddress(
|
|
|
|
OUT PVOID *CallersAddress,
|
|
|
|
OUT PVOID *CallersCaller
|
|
|
|
)
|
|
|
|
{
|
|
|
|
UNIMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
2004-06-24 19:30:21 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
VOID STDCALL
|
|
|
|
RtlRaiseException(PEXCEPTION_RECORD ExceptionRecord)
|
|
|
|
{
|
|
|
|
CONTEXT Context;
|
|
|
|
NTSTATUS Status;
|
|
|
|
|
|
|
|
RtlpCaptureContext(&Context);
|
|
|
|
|
|
|
|
ExceptionRecord->ExceptionAddress = (PVOID)(*(((PULONG)Context.Ebp)+1));
|
|
|
|
Context.ContextFlags = CONTEXT_FULL;
|
|
|
|
|
|
|
|
Status = ZwRaiseException(ExceptionRecord, &Context, TRUE);
|
|
|
|
RtlRaiseException(ExceptionRecord);
|
2005-05-09 01:41:02 +00:00
|
|
|
RtlRaiseStatus(Status);
|
2004-06-24 19:30:21 +00:00
|
|
|
}
|
|
|
|
|
2004-08-05 18:17:37 +00:00
|
|
|
|
2004-06-24 19:30:21 +00:00
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
|
|
|
VOID STDCALL
|
|
|
|
RtlRaiseStatus(NTSTATUS Status)
|
|
|
|
{
|
|
|
|
EXCEPTION_RECORD ExceptionRecord;
|
|
|
|
|
|
|
|
DPRINT("RtlRaiseStatus(Status 0x%.08x)\n", Status);
|
|
|
|
|
|
|
|
ExceptionRecord.ExceptionCode = Status;
|
|
|
|
ExceptionRecord.ExceptionRecord = NULL;
|
|
|
|
ExceptionRecord.NumberParameters = 0;
|
|
|
|
ExceptionRecord.ExceptionFlags = EXCEPTION_NONCONTINUABLE;
|
|
|
|
RtlRaiseException (& ExceptionRecord);
|
|
|
|
}
|
|
|
|
|
2004-08-05 18:17:37 +00:00
|
|
|
/*
|
|
|
|
* @unimplemented
|
|
|
|
*/
|
|
|
|
ULONG
|
|
|
|
STDCALL
|
|
|
|
RtlWalkFrameChain (
|
|
|
|
OUT PVOID *Callers,
|
|
|
|
IN ULONG Count,
|
|
|
|
IN ULONG Flags
|
|
|
|
)
|
|
|
|
{
|
|
|
|
UNIMPLEMENTED;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-06-24 19:30:21 +00:00
|
|
|
/* EOF */
|