Commit graph

12 commits

Author SHA1 Message Date
Alex Ionescu
b9020b11dd Major refactoring of the exception handling code + misc fixes:
- Fix/add prototypes for RtlCaptureContext, RtlDispatchException and RtlUnwind
	- Fix EXCEPTION_REGISTRATION_RECORD structure and PEXCEPTION_ROUTINE
	- Add w32api excpt.h (based on mingw) with PSDK compatibility fixes
	- Fix seriously broken User-Mode Ldr thunk and APC Callback prototypes
	- Fix KiUserExceptionDispatcher
	- Remove useless NTDLL entrypoint
	- Implement NTDLL Ki* callbacks in ASM
	- Implement RtlCaptureContext
	- Fix RtlRaiseException to handle cases when a user-mode debugger is present
	- Fix RtlRaiseStatus as above, plus set the exception address and capture context
	- Little cleanup of RTL headers
	- Implement RtlpGetStackLimits, RtlpGetExceptionList, RtlpSetExceptionList, RtlpGetExceptionAddress in ASM
	- Fix RtlDispatchException, add cases for exceptions in the DPC stack and validate the validity of the 
exception frames. Add support for exception logging by the global flag. Use TRAP_FRAME/EXCPETION_FRAME instead of 
Context.
	- Fix RtlUnwind logic, support cases where it's called with custom arguments instead of NULL.
	- Reimplement RtlpCaptureContext to work properly, convert exception handler calling functions to INTEL syntax 
and fix some bugs (like checking for the right unwind flag, clearing volatile register values, etc. Also use some 
optimizations to increase speed.
	- Modify some kernel functions (like KeContextToTrapFrame, KiDispatchException, KiInitializeUserApc, etc.) to 
support a PKEXCEPTION_FRAME for future PPC compatibility.
	- Reimplement RtlCaptureUnicodeString/FreeUnicodeString as inlined probe macros and optimize them.
	- Export ExRaiseStatus/Exception as Rtl*
	- Reimplement NtContinue to have more platform-independent code, and to protect and validate user-mode context 
and parameters with SEH.
	- Implement KiRaiseException, add SEH to all user-mode parameters and when copying data to the user-mode stack.
	- Fix KiInitializeUserApc to use KeTrapFrameToContext, to save the debug registers, not to deliver APCs during 
v86 mode, and to protect user-mode stack operations in SEH and probing. Also make it generate the proper stack for the 
user-mode callback. 
	- Implement KiUnexpectedInterrupt and KiCoprocessorError
	- Reimplement NtRaiseException in ASM to take advantage of optimizations due to the trap frame being in the 
stack when called through System call interface.
	- Fix Ntcontinue to respect AlertThread paramter
	- Fix some functiosn to return with KiServiceExit2 instead of KiServiceExit when required/needed
	- Fix KiDispatchException's logic, fix hacks when calling KeUserExceptionDispatcher, use correct context 
flags,...
	- Make NTDLL Ki* callbacks have SEH to protect them and return to kernel-mode with notification of any 
exceptions (the kernel-mode code to handle this isn't written yet though)

svn path=/trunk/; revision=17811
2005-09-11 22:32:20 +00:00
Filip Navara
3f77d0e91e #include "rtl.h" -> #include <rtl.h>
svn path=/trunk/; revision=16733
2005-07-26 08:40:02 +00:00
Thomas Bluemel
cc6ffdce48 fixed some signed/unsigned comparison warnings with -Wsign-compare
svn path=/trunk/; revision=16441
2005-07-05 22:35:29 +00:00
Steven Edwards
eace72f07c strip whitespace from end of lines
svn path=/trunk/; revision=15165
2005-05-09 01:41:02 +00:00
Alex Ionescu
59b1628118 forgot this guy
svn path=/trunk/; revision=15133
2005-05-08 16:50:18 +00:00
Alex Ionescu
9238d3d14f Remove debug output from user mode exceptions. Reported by hbirr.
svn path=/trunk/; revision=13295
2005-01-25 23:36:23 +00:00
Alex Ionescu
05ea4c4aa5 Fix bugs on optimized build, fix RtlpDispatchException gobbling up ebx (thx ge), remove obsolete files
svn path=/trunk/; revision=13264
2005-01-25 01:23:23 +00:00
Martin Fuchs
e228aadfe5 migrate substitution keywords to SVN
svn path=/trunk/; revision=12852
2005-01-06 13:58:04 +00:00
Filip Navara
18168b454a - Fixed dispatching of nested exceptions.
svn path=/trunk/; revision=10049
2004-07-09 20:06:40 +00:00
Filip Navara
bfb94c6d6f - Fixed RtlUnwind to correctly remove SEH frames and not to call ZwContinue.
svn path=/trunk/; revision=10010
2004-07-07 16:25:00 +00:00
Filip Navara
31456c578a - Don't continue execution if there is no exception handler. It's common that continuing such execution would result in the same exception again and thus creating infinite loop.
svn path=/trunk/; revision=9990
2004-07-04 02:01:02 +00:00
KJK::Hyperion
7fa5587882 Committed in the hope CVS will shut the hell up and let me branch. Still part of the SEH work
svn path=/trunk/; revision=9865
2004-06-25 01:41:20 +00:00