call _RtlRaiseException@4\r
ret 8\r
\r
+.globl _RtlpGetStackLimits@8\r
+_RtlpGetStackLimits@8:\r
+\r
+ /* Get the stack limits */\r
+ mov eax, [fs:TEB_STACK_LIMIT]\r
+ mov ecx, [fs:TEB_STACK_BASE]\r
+\r
+ /* Return them */\r
+ mov edx, [esp+4]\r
+ mov [edx], eax\r
+ mov edx, [esp+8]\r
+ mov [edx], ecx\r
+\r
+ /* return */\r
+ ret 8\r
+\r
/* FUNCTIONS ****************************************************************/
-.globl _RtlpGetStackLimits@8
-_RtlpGetStackLimits@8:
-
- /* Get the stack limits */
- mov eax, [fs:TEB_STACK_LIMIT]
- mov ecx, [fs:TEB_STACK_BASE]
-
- /* Return them */
- mov edx, [esp+4]
- mov [edx], eax
- mov edx, [esp+8]
- mov [edx], ecx
-
- /* return */
- ret 8
-
.globl _RtlpGetExceptionList@0
_RtlpGetExceptionList@0:
CONTEXT LocalContext;\r
\r
/* We'll have to make a copy and probe it */\r
- ProbeForRead(Context, sizeof(CONTEXT), sizeof(ULONG));\r
+ //ProbeForRead(Context, sizeof(CONTEXT), sizeof(ULONG));\r
RtlMoveMemory(&LocalContext, Context, sizeof(CONTEXT));\r
Context = &LocalContext;\r
\r
/* Check the previous mode */\r
if (PreviousMode != KernelMode)\r
{\r
+#if 0\r
/* Probe the context */\r
ProbeForRead(Context, sizeof(CONTEXT), sizeof(ULONG));\r
\r
FIELD_OFFSET(EXCEPTION_RECORD, NumberParameters) +\r
sizeof(ULONG),\r
sizeof(ULONG));\r
-\r
+#endif\r
/* Validate the maximum parameters */\r
if ((ParameterCount = ExceptionRecord->NumberParameters) >\r
EXCEPTION_MAXIMUM_PARAMETERS)\r
{\r
/* Too large */\r
- return STATUS_INVALID_PARAMETER;\r
+ Status = STATUS_INVALID_PARAMETER;\r
+ _SEH_LEAVE;\r
}\r
\r
/* Probe the entire parameters now*/\r
KD_CONTINUE_TYPE Action;
ULONG_PTR Stack, NewStack;
ULONG Size;
+ BOOLEAN UserDispatch = FALSE;
DPRINT1("KiDispatchException() called\n");
/* Increase number of Exception Dispatches */
/* Set EIP to the User-mode Dispathcer */
TrapFrame->Eip = (ULONG)KeUserExceptionDispatcher;
- return;
+ UserDispatch = TRUE;
+ _SEH_LEAVE;
}
_SEH_HANDLE
{
_SEH_END;
}
+ /* If we dispatch to user, return now */
+ if (UserDispatch) return;
+
/* FIXME: Forward the exception to the debugger for 2nd chance */
/* 3rd strike, kill the thread */
* Please keep them in sync.
*/
+#include <ndk/asm.h>
+
#define ExceptionContinueExecution 0
#define ExceptionContinueSearch 1
#define ExceptionNestedException 2
// We should never get here
ret
+
+.intel_syntax noprefix
+.globl _RtlpGetStackLimits@8
+_RtlpGetStackLimits@8:
+
+ /* Get the current thread */
+ mov eax, [fs:KPCR_CURRENT_THREAD]
+
+ /* Get the stack limits */
+ mov ecx, [eax+KTHREAD_STACK_LIMIT]
+ mov edx, [eax+KTHREAD_INITIAL_STACK]
+ sub edx, SIZEOF_FX_SAVE_AREA
+
+ /* Return them */
+ mov eax, [esp+4]
+ mov [eax], ecx
+
+ mov eax, [esp+8]
+ mov [eax], edx
+
+ /* return */
+ ret 8
+