2005-05-08 05:14:46 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS System Libraries
|
|
|
|
* FILE: lib/rtl/rtl.h
|
|
|
|
* PURPOSE: Run-Time Libary Header
|
|
|
|
* PROGRAMMER: Alex Ionescu
|
|
|
|
*/
|
|
|
|
|
2006-08-27 20:23:26 +00:00
|
|
|
#ifndef RTL_H
|
|
|
|
#define RTL_H
|
|
|
|
|
2005-11-30 08:15:13 +00:00
|
|
|
/* We're a core NT DLL, we don't import syscalls */
|
2005-10-19 17:03:38 +00:00
|
|
|
#define _INC_SWPRINTF_INL_
|
2008-04-01 17:49:03 +00:00
|
|
|
#undef __MSVCRT__
|
2005-09-05 07:51:15 +00:00
|
|
|
|
2005-07-26 14:00:45 +00:00
|
|
|
/* C Headers */
|
2007-03-02 19:52:29 +00:00
|
|
|
#include <stdlib.h>
|
2005-07-26 14:00:45 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2005-06-19 22:05:50 +00:00
|
|
|
/* PSDK/NDK Headers */
|
2013-01-24 23:00:42 +00:00
|
|
|
#define WIN32_NO_STATUS
|
|
|
|
#define _INC_WINDOWS
|
|
|
|
#define COM_NO_WINDOWS_H
|
2014-01-04 13:53:47 +00:00
|
|
|
#define COBJMACROS
|
|
|
|
#define CONST_VTABLE
|
2013-01-24 23:00:42 +00:00
|
|
|
#include <windef.h>
|
|
|
|
#include <winbase.h>
|
|
|
|
#include <winreg.h>
|
|
|
|
#include <objbase.h>
|
2015-02-07 13:24:29 +00:00
|
|
|
#include <ntintsafe.h>
|
2011-08-17 14:04:33 +00:00
|
|
|
#include <ndk/exfuncs.h>
|
|
|
|
#include <ndk/iofuncs.h>
|
|
|
|
#include <ndk/kefuncs.h>
|
|
|
|
#include <ndk/ldrfuncs.h>
|
|
|
|
#include <ndk/mmfuncs.h>
|
|
|
|
#include <ndk/obfuncs.h>
|
|
|
|
#include <ndk/psfuncs.h>
|
|
|
|
#include <ndk/rtlfuncs.h>
|
|
|
|
#include <ndk/setypes.h>
|
|
|
|
#include <ndk/sefuncs.h>
|
|
|
|
#include <ndk/umfuncs.h>
|
2005-05-08 05:14:46 +00:00
|
|
|
|
2015-02-01 13:33:06 +00:00
|
|
|
/* SEH support with PSEH */
|
|
|
|
#include <pseh/pseh2.h>
|
|
|
|
|
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
|
|
|
/* Internal RTL header */
|
|
|
|
#include "rtlp.h"
|
2005-07-20 23:35:59 +00:00
|
|
|
|
2011-02-10 11:47:17 +00:00
|
|
|
/* Use intrinsics for x86 and x64 */
|
|
|
|
#if defined(_M_IX86) || defined(_M_AMD64)
|
|
|
|
#define InterlockedCompareExchange _InterlockedCompareExchange
|
|
|
|
#define InterlockedIncrement _InterlockedIncrement
|
|
|
|
#define InterlockedDecrement _InterlockedDecrement
|
|
|
|
#define InterlockedExchangeAdd _InterlockedExchangeAdd
|
|
|
|
#define InterlockedExchange _InterlockedExchange
|
|
|
|
#define InterlockedBitTestAndSet _interlockedbittestandset
|
|
|
|
#define InterlockedBitTestAndSet64 _interlockedbittestandset64
|
|
|
|
#endif
|
|
|
|
|
2006-08-27 20:23:26 +00:00
|
|
|
#endif /* RTL_H */
|