!!! ATTENTION EVERYONE - do a make clean after getting this revision !!!

!!! ATTENTION PSEH USERS - new features & a change in rules !!!

modified   include/reactos/libs/pseh/framebased.h
modified   include/reactos/libs/pseh/framebased/internal.h
deleted    include/reactos/libs/pseh/setjmp.h
modified   lib/pseh/framebased.c
deleted    lib/pseh/i386/setjmp.asm
modified   lib/pseh/pseh.rbuild
   Big PSEH revamp. If God is kind and merciful, this might be the last revision to PSEH ever
   !!! RULE CHANGE !!! Obsoleted _SEH_NO_NATIVE_NLG, do NOT use it anymore, it will now cause fatal compile-time errors
   !!! RULE CHANGE !!! As a side effect to the fix for a bug where a _SEH_TRY nested in a _SEH_HANDLE would lead to stack corruption, using "return" or "goto" from anywhere inside a PSEH block is now FORBIDDEN; all code that already did has been fixed in this revision
   !!! NEW FEATURE !!! To leave a PSEH block from anywhere inside it, use the new _SEH_YIELD(<statement>) macro; examples: _SEH_YIELD(return value), _SEH_YIELD(goto label), _SEH_YIELD(returnvalue = value; goto label); ALWAYS ensure a _SEH_YIELD() leads outside the top-level _SEH_TRY block - do NOT goto into an ancestor _SEH_TRY block!!! Also note that _SEH_YIELD() disables SEH protection for the enclosed statement, so do NOT perform operations that might throw exceptions inside a _SEH_YIELD(); finally, ensure the enclosed statement does NOT allow execution to continue, or _SEH_YIELD() will get in an infinite loop; bear with me, for I have done the impossible, so don't expect miracles
   Don't use a fake setjmp/longjmp *ever*, too dangerous; removed _SEHLongJmp & _SEHSetJmp, obsoleted _SEH_NO_NATIVE_NLG
   On GCC, use __builtin_setjmp/__builtin_longjmp instead of setjmp/longjmp; they produce efficient code that plays well with optimizations, require no external library and are designed specifically for exception handling; should result in faster code and no hidden bugs
   Use inline code to enter/leave trylevels; yields much better binary code
   Inline handlers inside _SEH_PortableFrame_t instead of pointing to them; yields better code for the most common usages
   Turn all top-level statements generated by macros from bare scopes into for loops, to ensure they are used correctly as stand-alone statements
   Removed bitrotten old syntax, because it wasn't being used nor maintained

modified   dll/3rdparty/freetype/freetype.rbuild
modified   dll/win32/kernel32/kernel32.rbuild
modified   drivers/network/tcpip/tcpip.rbuild
modified   lib/drivers/ip/ip.rbuild
modified   lib/rtl/rtl.rbuild
modified   ntoskrnl/ntoskrnl.rbuild
modified   subsystems/win32/win32k/win32k.rbuild
   Removed obsolete _SEH_NO_NATIVE_NLG define

modified   drivers/network/afd/afd/lock.c
modified   drivers/network/afd/afd/tdi.c
modified   subsystems/csr/csrsrv/api.c
modified   subsystems/win32/win32k/ntuser/clipboard.c
modified   subsystems/win32/win32k/ntuser/window.c
   Use the new _SEH_YIELD macro to return/goto from SEH blocks

modified   tools/rbuild/backend/mingw/modulehandler.cpp
modified   tools/rbuild/backend/mingw/modulehandler.h
modified   tools/rbuild/module.cpp
modified   tools/rbuild/project.dtd
modified   tools/rbuild/rbuild.h
   Don't use the obsolete _SEH_NO_NATIVE_NLG flag anymore
   Only add underscores to imported symbols when module is marked underscoresymbols="true"; fixes debugsup and, indirectly, PSEH tracing

modified   lib/3rdparty/mingw/mingw.rbuild
   Build with underscoresymbols="true"

svn path=/trunk/; revision=26224
This commit is contained in:
KJK::Hyperion 2007-04-01 00:07:25 +00:00
parent 9ce1b28fc1
commit 643b171651
24 changed files with 398 additions and 639 deletions

View file

@ -2,7 +2,6 @@
<importlibrary definition="freetype.def" />
<include base="freetype">include</include>
<define name="_DISABLE_TIDENTS" />
<define name="_SEH_NO_NATIVE_NLG" />
<define name="__NTDRIVER__" />
<define name="__NO_CTYPE_INLINES" />
<define name="__USE_W32API" />

View file

@ -3,7 +3,6 @@
<include base="kernel32_base">include</include>
<include base="ReactOS">include/reactos/subsys</include>
<define name="_DISABLE_TIDENTS" />
<define name="_SEH_NO_NATIVE_NLG" />
<define name="__USE_W32API" />
<define name="_WIN32_WINNT">0x0600</define>
<define name="__NO_CTYPE_INLINES" />
@ -120,7 +119,6 @@
<include base="kernel32">.</include>
<include base="kernel32">include</include>
<define name="_DISABLE_TIDENTS" />
<define name="_SEH_NO_NATIVE_NLG" />
<define name="__USE_W32API" />
<define name="WINVER">0x0500</define>
<library>kernel32_base</library>
@ -130,4 +128,4 @@
<linkerflag>-nostartfiles</linkerflag>
<linkerflag>-nostdlib</linkerflag>
<file>kernel32.rc</file>
</module>
</module>

View file

@ -71,7 +71,7 @@ PAFD_WSABUF LockBuffers( PAFD_WSABUF Buf, UINT Count,
"from userland (%x %x)\n",
Buf, AddressLen));
ExFreePool( NewBuf );
return NULL;
_SEH_YIELD(return NULL);
} _SEH_END;
for( i = 0; i < Count; i++ ) {

View file

@ -977,7 +977,7 @@ NTSTATUS TdiReceiveDatagram(
} _SEH_HANDLE {
AFD_DbgPrint(MIN_TRACE, ("MmProbeAndLockPages() failed.\n"));
IoFreeIrp(*Irp);
return STATUS_INSUFFICIENT_RESOURCES;
_SEH_YIELD(return STATUS_INSUFFICIENT_RESOURCES);
} _SEH_END;
AFD_DbgPrint(MID_TRACE,("AFD>>> Got an MDL: %x\n", Mdl));
@ -1066,7 +1066,7 @@ NTSTATUS TdiSendDatagram(
} _SEH_HANDLE {
AFD_DbgPrint(MIN_TRACE, ("MmProbeAndLockPages() failed.\n"));
IoFreeIrp(*Irp);
return STATUS_INSUFFICIENT_RESOURCES;
_SEH_YIELD(return STATUS_INSUFFICIENT_RESOURCES);
} _SEH_END;
AFD_DbgPrint(MID_TRACE,("AFD>>> Got an MDL: %x\n", Mdl));

View file

@ -2,7 +2,6 @@
<importlibrary definition="tcpip.def"></importlibrary>
<include base="tcpip">include</include>
<include base="oskittcp">include</include>
<define name="_SEH_NO_NATIVE_NLG" />
<define name="NDIS40" />
<define name="__USE_W32API" />
<define name="_NTDRIVER_" />

View file

@ -30,15 +30,14 @@
# include <stddef.h>
#endif
/*
Fall back to non-optimal, non-native NLG implementation for environments
without their own (e.g., currently, kernel-mode ReactOS/Windows). THIS IS NOT
RECOMMENDED AND IT WILL BE DROPPED IN A FUTURE VERSION BECAUSE IT MAY CAUSE
SEVERE STACK CORRUPTION. REIMPLEMENT OR PORT YOUR COMPILER'S NATIVE NLG
IMPLEMENTATION INSTEAD.
*/
#ifdef _SEH_NO_NATIVE_NLG
# include <pseh/setjmp.h>
#if defined(_SEH_NO_NATIVE_NLG)
# error PSEH setjmp/longjmp fallback is no longer supported
#endif
#if defined(__GNUC__)
# define _SEHLongJmp __builtin_longjmp
# define _SEHSetJmp __builtin_setjmp
typedef void * _SEHJmpBuf_t[5];
#else
# include <setjmp.h>
# define _SEHLongJmp longjmp
@ -55,7 +54,7 @@
typedef struct __SEHFrame
{
_SEHPortableFrame_t SEH_Header;
void * SEH_Locals;
void * volatile SEH_Locals;
}
_SEHFrame_t;
@ -78,6 +77,7 @@ static __declspec(noreturn) __inline void __stdcall _SEHCompilerSpecificHandler
static const int _SEHScopeKind = 1;
static _SEHPortableFrame_t * const _SEHPortableFrame = 0;
static _SEHPortableTryLevel_t * const _SEHPortableTryLevel = 0;
/* SHARED LOCALS */
/* Access the locals for the current frame */
@ -139,28 +139,6 @@ static _SEHPortableFrame_t * const _SEHPortableFrame = 0;
}
/* SAFE BLOCKS */
#define _SEHX_TRY_FINALLY(FINALLY_) \
_SEH_TRY_FILTER_FINALLY \
( \
_SEH_STATIC_FILTER(_SEH_CONTINUE_SEARCH), \
(FINALLY_) \
)
#define _SEHX_END_FINALLY _SEH_HANDLE _SEH_END
#define _SEHX_TRY_FILTER(FILTER_) \
_SEH_TRY_FILTER_FINALLY((FILTER_), 0)
#define _SEHX_TRY_HANDLE_FINALLY(FINALLY_) \
_SEH_TRY_FILTER_FINALLY \
( \
_SEH_STATIC_FILTER(_SEH_EXECUTE_HANDLER), \
(FINALLY_) \
)
#define _SEHX_TRY \
_SEH_TRY_HANDLE_FINALLY(0)
#ifdef __cplusplus
# define _SEH_DECLARE_HANDLERS(FILTER_, FINALLY_) \
static const _SEHHandlers_t _SEHHandlers = { (FILTER_), (FINALLY_) };
@ -171,79 +149,30 @@ static _SEHPortableFrame_t * const _SEHPortableFrame = 0;
_SEHHandlers.SH_Finally = (FINALLY_);
#endif
#define _SEHX_TRY_FILTER_FINALLY(FILTER_, FINALLY_) \
{ \
_SEHPortableFrame_t * const _SEHCurPortableFrame = _SEHPortableFrame; \
\
{ \
_SEHFrame_t _SEHFrame; \
_SEHTryLevel_t _SEHTryLevel; \
_SEHPortableFrame_t * const _SEHPortableFrame = \
_SEHScopeKind ? &_SEHFrame.SEH_Header : _SEHCurPortableFrame; \
\
(void)_SEHPortableFrame; \
\
_SEH_DECLARE_HANDLERS((FILTER_), (FINALLY_)); \
\
_SEHTryLevel.ST_Header.SPT_Handlers = &_SEHHandlers; \
\
if(_SEHScopeKind) \
{ \
if(&_SEHLocals != _SEHDummyLocals) \
_SEHFrame.SEH_Locals = &_SEHLocals; \
\
_SEHFrame.SEH_Header.SPF_Handler = _SEHCompilerSpecificHandler; \
_SEHEnterFrame(&_SEHFrame.SEH_Header, &_SEHTryLevel.ST_Header); \
} \
else \
_SEHEnterTry(&_SEHTryLevel.ST_Header); \
\
{ \
_SEH_INIT_CONST int _SEHScopeKind = 0; \
(void)_SEHScopeKind; \
\
if(_SEHSetJmp(_SEHTryLevel.ST_JmpBuf) == 0) \
{ \
for(;;) \
{
#define _SEH_GetExceptionCode() (unsigned long)(_SEHPortableFrame->SPF_Code)
#define _SEHX_HANDLE \
\
break; \
} \
\
_SEHLeave(); \
} \
else \
{ \
_SEHLeave();
#define _SEHX_END \
} \
\
if(_SEHHandlers.SH_Finally) \
_SEHHandlers.SH_Finally(_SEHPortableFrame); \
} \
} \
}
#define _SEHX_LEAVE break
#define _SEHX_GetExceptionCode() (unsigned long)(_SEHPortableFrame->SPF_Code)
#define _SEHX_GetExceptionPointers() \
#define _SEH_GetExceptionPointers() \
((struct _EXCEPTION_POINTERS *)_SEHExceptionPointers)
#define _SEHX_AbnormalTermination() (_SEHPortableFrame->SPF_Code != 0)
/* New syntax */
#define _SEH_AbnormalTermination() (_SEHPortableFrame->SPF_Code != 0)
#define _SEH_LEAVE break
#define _SEH_YIELD(STMT_) \
for(;;) \
{ \
if(!_SEHScopeKind) \
_SEHReturn(); \
\
STMT_; \
}
#define _SEH_TRY \
for(;;) \
{ \
_SEH_INIT_CONST int _SEHTopTryLevel = (_SEHScopeKind != 0); \
_SEHPortableFrame_t * const _SEHCurPortableFrame = _SEHPortableFrame; \
_SEHPortableTryLevel_t * const _SEHPrevPortableTryLevel = _SEHPortableTryLevel; \
\
{ \
_SEH_INIT_CONST int _SEHScopeKind = 0; \
@ -253,9 +182,11 @@ static _SEHPortableFrame_t * const _SEHPortableFrame = 0;
_SEHTryLevel_t _SEHTryLevel; \
_SEHPortableFrame_t * const _SEHPortableFrame = \
_SEHTopTryLevel ? &_SEHFrame.SEH_Header : _SEHCurPortableFrame; \
_SEHPortableTryLevel_t * const _SEHPortableTryLevel = &_SEHTryLevel.ST_Header; \
\
(void)_SEHScopeKind; \
(void)_SEHPortableFrame; \
(void)_SEHPortableTryLevel; \
(void)_SEHHandle; \
\
for(;;) \
@ -276,24 +207,24 @@ static _SEHPortableFrame_t * const _SEHPortableFrame = 0;
} \
else \
{ \
_SEH_DECLARE_HANDLERS((FILTER_), 0); \
\
_SEHTryLevel.ST_Header.SPT_Handlers = &_SEHHandlers; \
\
if(_SEHTopTryLevel) \
{ \
if(&_SEHLocals != _SEHDummyLocals) \
_SEHFrame.SEH_Locals = &_SEHLocals; \
\
_SEH_EnableTracing(_SEH_DO_DEFAULT_TRACING); \
_SEHFrame.SEH_Header.SPF_Handler = _SEHCompilerSpecificHandler; \
_SEHEnterFrame(&_SEHFrame.SEH_Header, &_SEHTryLevel.ST_Header); \
} \
else \
_SEHEnterTry(&_SEHTryLevel.ST_Header); \
\
if((_SEHHandle = _SEHSetJmp(_SEHTryLevel.ST_JmpBuf)) == 0) \
{ \
_SEHTryLevel.ST_Header.SPT_Handlers.SH_Filter = (FILTER_); \
_SEHTryLevel.ST_Header.SPT_Handlers.SH_Finally = 0; \
\
_SEHTryLevel.ST_Header.SPT_Next = _SEHPrevPortableTryLevel; \
_SEHFrame.SEH_Header.SPF_TopTryLevel = &_SEHTryLevel.ST_Header; \
\
if(_SEHTopTryLevel) \
{ \
if(&_SEHLocals != _SEHDummyLocals) \
_SEHFrame.SEH_Locals = &_SEHLocals; \
\
_SEH_EnableTracing(_SEH_DO_DEFAULT_TRACING); \
_SEHFrame.SEH_Header.SPF_Handler = _SEHCompilerSpecificHandler; \
_SEHEnterFrame(&_SEHFrame.SEH_Header); \
} \
\
++ _SEHState; \
continue; \
} \
@ -306,7 +237,7 @@ static _SEHPortableFrame_t * const _SEHPortableFrame = 0;
break; \
} \
\
_SEHLeave(); \
_SEHPortableFrame->SPF_TopTryLevel = _SEHPrevPortableTryLevel; \
\
if(_SEHHandle) \
{
@ -317,14 +248,16 @@ static _SEHPortableFrame_t * const _SEHPortableFrame = 0;
break; \
} \
\
_SEHLeave(); \
_SEHPortableFrame->SPF_TopTryLevel = _SEHPrevPortableTryLevel; \
break; \
} \
else \
{ \
_SEH_DECLARE_HANDLERS(0, (FINALLY_)); \
_SEHTryLevel.ST_Header.SPT_Handlers.SH_Filter = 0; \
_SEHTryLevel.ST_Header.SPT_Handlers.SH_Finally = (FINALLY_); \
\
_SEHTryLevel.ST_Header.SPT_Handlers = &_SEHHandlers; \
_SEHTryLevel.ST_Header.SPT_Next = _SEHPrevPortableTryLevel; \
_SEHFrame.SEH_Header.SPF_TopTryLevel = &_SEHTryLevel.ST_Header; \
\
if(_SEHTopTryLevel) \
{ \
@ -332,11 +265,9 @@ static _SEHPortableFrame_t * const _SEHPortableFrame = 0;
_SEHFrame.SEH_Locals = &_SEHLocals; \
\
_SEH_EnableTracing(_SEH_DO_DEFAULT_TRACING); \
_SEHFrame.SEH_Header.SPF_Handler = 0; \
_SEHEnterFrame(&_SEHFrame.SEH_Header, &_SEHTryLevel.ST_Header); \
_SEHFrame.SEH_Header.SPF_Handler = _SEHCompilerSpecificHandler; \
_SEHEnterFrame(&_SEHFrame.SEH_Header); \
} \
else \
_SEHEnterTry(&_SEHTryLevel.ST_Header); \
\
++ _SEHState; \
continue; \
@ -353,14 +284,15 @@ static _SEHPortableFrame_t * const _SEHPortableFrame = 0;
#define _SEH_END \
} \
} \
\
if(_SEHTopTryLevel) \
_SEHLeaveFrame(); \
\
break; \
}
#define _SEH_HANDLE _SEH_EXCEPT(_SEH_STATIC_FILTER(_SEH_EXECUTE_HANDLER))
#define _SEH_GetExceptionCode _SEHX_GetExceptionCode
#define _SEH_GetExceptionPointers _SEHX_GetExceptionPointers
#define _SEH_AbnormalTermination _SEHX_AbnormalTermination
#define _SEH_EnableTracing(LEVEL_) ((void)(_SEHPortableFrame->SPF_Tracing = (LEVEL_)))
#define _SEH_DisableTracing() ((void)(_SEHPortableFrame->SPF_Tracing = _SEH_DO_TRACE_NONE))

View file

@ -87,8 +87,8 @@ _SEHHandlers_t;
typedef struct __SEHPortableTryLevel
{
struct __SEHPortableTryLevel * SPT_Next;
const _SEHHandlers_t * SPT_Handlers;
struct __SEHPortableTryLevel * volatile SPT_Next;
volatile _SEHHandlers_t SPT_Handlers;
}
_SEHPortableTryLevel_t;
@ -96,9 +96,9 @@ typedef struct __SEHPortableFrame
{
_SEHRegistration_t SPF_Registration;
unsigned long SPF_Code;
_SEHHandler_t SPF_Handler;
_SEHPortableTryLevel_t * SPF_TopTryLevel;
int SPF_Tracing;
volatile _SEHHandler_t SPF_Handler;
_SEHPortableTryLevel_t * volatile SPF_TopTryLevel;
volatile int SPF_Tracing;
}
_SEHPortableFrame_t;
@ -107,14 +107,9 @@ extern "C"
{
#endif
extern void __stdcall _SEHEnterFrame_s
(
_SEHPortableFrame_t *,
_SEHPortableTryLevel_t *
);
extern void __stdcall _SEHEnterTry_s(_SEHPortableTryLevel_t *);
extern void __stdcall _SEHLeave_s(void);
extern void __stdcall _SEHEnterFrame_s(_SEHPortableFrame_t *);
extern void __stdcall _SEHLeaveFrame_s(void);
extern void __stdcall _SEHReturn_s(void);
#if !defined(_SEH_NO_FASTCALL)
# ifdef _M_IX86
@ -123,22 +118,17 @@ extern void __stdcall _SEHLeave_s(void);
# define _SEH_FASTCALL __stdcall
# endif
extern void _SEH_FASTCALL _SEHEnterFrame_f
(
_SEHPortableFrame_t *,
_SEHPortableTryLevel_t *
);
extern void _SEH_FASTCALL _SEHEnterTry_f(_SEHPortableTryLevel_t *);
extern void _SEH_FASTCALL _SEHLeave_f(void);
extern void _SEH_FASTCALL _SEHEnterFrame_f(_SEHPortableFrame_t *);
extern void _SEH_FASTCALL _SEHLeaveFrame_f(void);
extern void _SEH_FASTCALL _SEHReturn_f(void);
# define _SEHEnterFrame _SEHEnterFrame_f
# define _SEHEnterTry _SEHEnterTry_f
# define _SEHLeave _SEHLeave_f
# define _SEHLeaveFrame _SEHLeaveFrame_f
# define _SEHReturn _SEHReturn_f
#else
# define _SEHEnterFrame _SEHEnterFrame_s
# define _SEHEnterTry _SEHEnterTry_s
# define _SEHLeave _SEHLeave_s
# define _SEHLeaveFrame _SEHLeaveFrame_s
# define _SEHReturn _SEHReturn_s
#endif
#ifdef __cplusplus

View file

@ -1,54 +0,0 @@
/*
Copyright (c) 2004/2005 KJK::Hyperion
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
#ifndef KJK_PSEH_SETJMP_H_
#define KJK_PSEH_SETJMP_H_
#ifdef _M_IX86
typedef struct __SEHJmpBuf
{
unsigned long JB_Ebp;
unsigned long JB_Esp;
unsigned long JB_Eip;
unsigned long JB_Ebx;
unsigned long JB_Esi;
unsigned long JB_Edi;
}
_SEHJmpBuf_t[1];
#endif
#ifdef __cplusplus
extern "C"
{
#endif
extern __declspec(noreturn) void __stdcall _SEHLongJmp(_SEHJmpBuf_t, int);
extern __declspec(noreturn) void __stdcall _SEHLongJmp_KeepEsp(_SEHJmpBuf_t, int);
extern int __stdcall _SEHSetJmp(_SEHJmpBuf_t);
#ifdef __cplusplus
}
#endif
#endif
/* EOF */

View file

@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
<group>
<module name="mingw_common" type="staticlibrary" isstartuplib="true">
<module name="mingw_common" type="staticlibrary" isstartuplib="true" underscoresymbols="true">
<importlibrary definition="moldname-msvcrt.def" dllname="msvcrt.dll" />
<include base="ReactOS">include/crt</include>
<include base="ReactOS">include/psdk</include>

View file

@ -1,6 +1,5 @@
<module name="ip" type="staticlibrary" allowwarnings="true">
<define name="__NTDRIVER__"/>
<define name="_SEH_NO_NATIVE_NLG"/>
<define name="__USE_W32API"/>
<include base="tcpip">include</include>
<include base="oskittcp">include</include>

View file

@ -164,7 +164,7 @@ extern unsigned long __cdecl DbgPrint(const char * format, ...);
{ \
if((FRAME_)->SPF_Tracing & _SEH_DO_TRACE_TRYLEVEL) \
{ \
_SEH_TRACE_LINE_((FRAME_), ("trylevel %p, filter %p", (TRYLEVEL_), (TRYLEVEL_)->SPT_Handlers->SH_Filter)); \
_SEH_TRACE_LINE_((FRAME_), ("trylevel %p, filter %p", (TRYLEVEL_), (TRYLEVEL_)->SPT_Handlers.SH_Filter)); \
} \
}
@ -178,7 +178,7 @@ extern unsigned long __cdecl DbgPrint(const char * format, ...);
( \
"trylevel %p, calling filter %p, ExceptionCode %08X", \
(TRYLEVEL_), \
(TRYLEVEL_)->SPT_Handlers->SH_Filter, \
(TRYLEVEL_)->SPT_Handlers.SH_Filter, \
(ER_)->ExceptionCode \
) \
); \
@ -195,7 +195,7 @@ extern unsigned long __cdecl DbgPrint(const char * format, ...);
( \
"trylevel %p, filter %p => %s", \
(TRYLEVEL_), \
(TRYLEVEL_)->SPT_Handlers->SH_Filter, \
(TRYLEVEL_)->SPT_Handlers.SH_Filter, \
_SEH_FILTER_RET_STRING_(RET_) \
) \
); \
@ -236,7 +236,7 @@ extern unsigned long __cdecl DbgPrint(const char * format, ...);
( \
"trylevel %p, calling exit routine %p", \
(TRYLEVEL_), \
(TRYLEVEL_)->SPT_Handlers->SH_Finally \
(TRYLEVEL_)->SPT_Handlers.SH_Finally \
) \
); \
} \
@ -252,7 +252,7 @@ extern unsigned long __cdecl DbgPrint(const char * format, ...);
( \
"trylevel %p, exit routine %p returned", \
(TRYLEVEL_), \
(TRYLEVEL_)->SPT_Handlers->SH_Finally \
(TRYLEVEL_)->SPT_Handlers.SH_Finally \
) \
); \
} \
@ -305,7 +305,7 @@ static void __stdcall _SEHLocalUnwind
/* ASSERT(trylevel); */
pfnFinally = trylevel->SPT_Handlers->SH_Finally;
pfnFinally = trylevel->SPT_Handlers.SH_Finally;
if(pfnFinally)
{
@ -386,7 +386,7 @@ static int __cdecl _SEHFrameHandler
trylevel = trylevel->SPT_Next
)
{
_SEHFilter_t pfnFilter = trylevel->SPT_Handlers->SH_Filter;
_SEHFilter_t pfnFilter = trylevel->SPT_Handlers.SH_Filter;
_SEH_TRACE_TRYLEVEL(frame, trylevel);
@ -402,7 +402,7 @@ static int __cdecl _SEHFrameHandler
default:
{
if(trylevel->SPT_Handlers->SH_Filter)
if(trylevel->SPT_Handlers.SH_Filter)
{
EXCEPTION_POINTERS ep;
@ -443,41 +443,31 @@ static int __cdecl _SEHFrameHandler
return ExceptionContinueSearch;
}
void __stdcall _SEHEnterFrame_s
(
_SEHPortableFrame_t * frame,
_SEHPortableTryLevel_t * trylevel
)
void __stdcall _SEHEnterFrame_s(_SEHPortableFrame_t * frame)
{
_SEHEnterFrame_f(frame, trylevel);
_SEHEnterFrame_f(frame);
}
void __stdcall _SEHEnterTry_s(_SEHPortableTryLevel_t * trylevel)
void __stdcall _SEHLeaveFrame_s(void)
{
_SEHEnterTry_f(trylevel);
_SEHLeaveFrame_f();
}
void __stdcall _SEHLeave_s(void)
void __stdcall _SEHReturn_s(void)
{
_SEHLeave_f();
_SEHReturn_f();
}
void _SEH_FASTCALL _SEHEnterFrame_f
(
_SEHPortableFrame_t * frame,
_SEHPortableTryLevel_t * trylevel
)
void _SEH_FASTCALL _SEHEnterFrame_f(_SEHPortableFrame_t * frame)
{
/* ASSERT(frame); */
/* ASSERT(trylevel); */
frame->SPF_Registration.SER_Handler = _SEHFrameHandler;
frame->SPF_Code = 0;
frame->SPF_TopTryLevel = trylevel;
trylevel->SPT_Next = NULL;
_SEHRegisterFrame(&frame->SPF_Registration);
}
void _SEH_FASTCALL _SEHEnterTry_f(_SEHPortableTryLevel_t * trylevel)
void _SEH_FASTCALL _SEHLeaveFrame_f(void)
{
_SEHPortableFrame_t * frame;
@ -488,32 +478,25 @@ void _SEH_FASTCALL _SEHEnterTry_f(_SEHPortableTryLevel_t * trylevel)
SPF_Registration
);
trylevel->SPT_Next = frame->SPF_TopTryLevel;
frame->SPF_TopTryLevel = trylevel;
}
void _SEH_FASTCALL _SEHLeave_f(void)
{
_SEHPortableFrame_t * frame;
_SEHPortableTryLevel_t * trylevel;
frame = _SEH_CONTAINING_RECORD
(
_SEHCurrentRegistration(),
_SEHPortableFrame_t,
SPF_Registration
);
/* ASSERT(frame); */
/* ASSERT(frame->SPF_TopTryLevel == NULL) */
trylevel = frame->SPF_TopTryLevel;
_SEHUnregisterFrame();
}
/* ASSERT(trylevel); */
void _SEH_FASTCALL _SEHReturn_f(void)
{
_SEHPortableFrame_t * frame;
if(trylevel->SPT_Next)
frame->SPF_TopTryLevel = trylevel->SPT_Next;
else
_SEHUnregisterFrame();
frame = _SEH_CONTAINING_RECORD
(
_SEHCurrentRegistration(),
_SEHPortableFrame_t,
SPF_Registration
);
_SEHLocalUnwind(frame, NULL);
_SEHUnregisterFrame();
}
/* EOF */

View file

@ -1,88 +0,0 @@
; Copyright (c) 2004/2005 KJK::Hyperion
; Permission is hereby granted, free of charge, to any person obtaining a copy
; of this software and associated documentation files (the "Software"), to deal
; in the Software without restriction, including without limitation the rights
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
; copies of the Software, and to permit persons to whom the Software is
; furnished to dos so, subject to the following conditions:
; The above copyright notice and this permission notice shall be included in all
; copies or substantial portions of the Software.
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
; SOFTWARE.
segment .text use32
; Note: the undecorated names are for Borland C++ (and possibly other compilers
; using the OMF format)
global _SEHSetJmp
global __SEHSetJmp@4
_SEHSetJmp:
__SEHSetJmp@4:
; jump buffer
mov eax, [esp+4]
; program counter
mov ecx, [esp+0]
; stack pointer
lea edx, [esp+8]
; fill the jump buffer
mov [eax+0], ebp
mov [eax+4], edx
mov [eax+8], ecx
mov [eax+12], ebx
mov [eax+16], esi
mov [eax+20], edi
xor eax, eax
ret 4
global _SEHLongJmp
global __SEHLongJmp@8
_SEHLongJmp:
__SEHLongJmp@8:
; return value
mov eax, [esp+8]
; jump buffer
mov ecx, [esp+4]
; restore the saved context
mov ebp, [ecx+0]
mov esp, [ecx+4]
mov edx, [ecx+8]
mov ebx, [ecx+12]
mov esi, [ecx+16]
mov edi, [ecx+20]
jmp edx
global _SEHLongJmp_KeepEsp
global __SEHLongJmp_KeepEsp@8
_SEHLongJmp_KeepEsp:
__SEHLongJmp_KeepEsp@8:
; return value
mov eax, [esp+8]
; jump buffer
mov ecx, [esp+4]
; restore the saved context
mov ebp, [ecx+0]
; don't restore esp
; mov esp, [ecx+4]
mov edx, [ecx+8]
mov ebx, [ecx+12]
mov esi, [ecx+16]
mov edi, [ecx+20]
jmp edx
; EOF

View file

@ -3,7 +3,6 @@
<if property="ARCH" value="i386">
<directory name="i386">
<file>framebased.asm</file>
<file>setjmp.asm</file>
</directory>
</if>
<file>framebased.c</file>

View file

@ -5,7 +5,6 @@
<define name="NO_RTL_INLINES" />
<define name="_NTSYSTEM_" />
<define name="_NTDLLBUILD_" />
<define name="_SEH_NO_NATIVE_NLG" />
<include base="rtl">.</include>
<if property="ARCH" value="i386">
<directory name="i386">

View file

@ -1,7 +1,6 @@
<module name="ntoskrnl" type="kernel" installbase="system32" installname="ntoskrnl.exe">
<bootstrap base="$(CDOUTPUT)" />
<importlibrary definition="ntoskrnl.def" />
<define name="_SEH_NO_NATIVE_NLG" />
<define name="_DISABLE_TIDENTS" />
<define name="__NTOSKRNL__" />
<define name="_NTOSKRNL_" />

View file

@ -109,7 +109,7 @@ CsrCheckRequestThreads(VOID)
* communications with the Session Manager (SM) and initializes the static
* thread that will handle connection requests and APIs.
*
* @param None
* @param None
*
* @return STATUS_SUCCESS in case of success, STATUS_UNSUCCESSFUL
* othwerwise.
@ -192,7 +192,7 @@ CsrSbApiPortInitialize(VOID)
* communications with the Client/Server Runtime (CSR) and initializes the
* static thread that will handle connection requests and APIs.
*
* @param None
* @param None
*
* @return STATUS_SUCCESS in case of success, STATUS_UNSUCCESSFUL
* othwerwise.
@ -311,7 +311,7 @@ CsrApiPortInitialize(VOID)
* requests on the CSR API LPC Port.
*
* @param Parameter
* System-default user-defined parameter. Unused.
* System-default user-defined parameter. Unused.
*
* @return The thread exit code, if the thread is terminated.
*
@ -462,7 +462,7 @@ CsrApiRequestThread(IN PVOID Parameter)
}
}
}
/* Increase the thread count */
InterlockedIncrement(&CsrpStaticThreadCount);
@ -625,7 +625,7 @@ CsrApiRequestThread(IN PVOID Parameter)
}
}
}
/* Increase the thread count */
InterlockedIncrement(&CsrpStaticThreadCount);
@ -791,7 +791,7 @@ CsrApiHandleConnectionRequest(IN PCSR_API_MESSAGE ApiMessage)
* requests on the SM API LPC Port.
*
* @param Parameter
* System-default user-defined parameter. Unused.
* System-default user-defined parameter. Unused.
*
* @return The thread exit code, if the thread is terminated.
*
@ -848,7 +848,7 @@ CsrSbApiRequestThread(IN PVOID Parameter)
{
/* Close the handle if we have one */
if (PortContext) NtClose((HANDLE)PortContext);
/* Client died, start over */
ReplyMsg = NULL;
continue;
@ -1026,7 +1026,7 @@ CsrCallServerFromServer(PCSR_API_MESSAGE ReceiveMsg,
*
* The CsrConnectToUser connects to the User subsystem.
*
* @param None
* @param None
*
* @return A pointer to the CSR Thread
*
@ -1145,7 +1145,7 @@ CsrCaptureArguments(IN PCSR_THREAD CsrThread,
{
/* Return failure */
ApiMessage->Status = STATUS_INVALID_PARAMETER;
return FALSE;
_SEH_YIELD(return FALSE);
}
/* Check if the Length is valid */
@ -1154,14 +1154,14 @@ CsrCaptureArguments(IN PCSR_THREAD CsrThread,
{
/* Return failure */
ApiMessage->Status = STATUS_INVALID_PARAMETER;
return FALSE;
_SEH_YIELD(return FALSE);
}
}
_SEH_HANDLE
{
/* Return failure */
ApiMessage->Status = STATUS_INVALID_PARAMETER;
return FALSE;
_SEH_YIELD(return FALSE);
} _SEH_END;
/* We validated the incoming buffer, now allocate the remote one */
@ -1226,7 +1226,7 @@ CsrCaptureArguments(IN PCSR_THREAD CsrThread,
RemoteCaptureBuffer->PreviousCaptureBuffer = LocalCaptureBuffer;
ApiMessage->CsrCaptureData = RemoteCaptureBuffer;
}
/* Success */
return TRUE;
}
@ -1267,7 +1267,7 @@ CsrReleaseCapturedArguments(IN PCSR_API_MESSAGE ApiMessage)
/* Find out the difference between the two buffers */
BufferDistance = (ULONG_PTR)LocalCaptureBuffer - (ULONG_PTR)RemoteCaptureBuffer;
/* Save the pointer count and offset pointer */
PointerCount = RemoteCaptureBuffer->PointerCount;
PointerOffsets = (ULONG_PTR**)(RemoteCaptureBuffer + 1);
@ -1284,7 +1284,7 @@ CsrReleaseCapturedArguments(IN PCSR_API_MESSAGE ApiMessage)
/* Modify the pointer to take into account its new position */
*CurrentPointer += BufferDistance;
}
/* Move to the next Pointer */
PointerCount--;
}

File diff suppressed because it is too large Load diff

View file

@ -70,7 +70,7 @@ CleanupWindowImpl(VOID)
PWINDOW_OBJECT FASTCALL IntGetWindowObject(HWND hWnd)
{
PWINDOW_OBJECT Window;
if (!hWnd) return NULL;
Window = UserGetWindowObject(hWnd);
@ -100,11 +100,11 @@ PWINDOW_OBJECT FASTCALL UserGetWindowObject(HWND hWnd)
}
if (!hWnd)
{
{
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
return NULL;
}
Window = (PWINDOW_OBJECT)UserGetObject(gHandleTable, hWnd, otWindow);
if (!Window || 0 != (Window->Status & WINDOWSTATUS_DESTROYED))
{
@ -146,7 +146,7 @@ IntIsWindow(HWND hWnd)
/*
/*
Caller must NOT dereference retval!
But if caller want the returned value to persist spanning a co_ call,
it must reference the value (because the owner is not garanteed to
@ -168,7 +168,7 @@ IntGetParent(PWINDOW_OBJECT Wnd)
}
/*
/*
Caller must NOT dereference retval!
But if caller want the returned value to persist spanning a co_ call,
it must reference the value (because the owner is not garanteed to
@ -243,7 +243,7 @@ static void IntSendDestroyMsg(HWND hWnd)
{
// USER_REFERENCE_ENTRY Ref;
// UserRefObjectCo(Window, &Ref);
if (!IntGetOwner(Window) && !IntGetParent(Window))
{
co_IntShellHookNotify(HSHELL_WINDOWDESTROYED, (LPARAM) hWnd);
@ -299,7 +299,7 @@ static void IntSendDestroyMsg(HWND hWnd)
*
* This is the "functional" DestroyWindows function ei. all stuff
* done in CreateWindow is undone here and not in DestroyWindow:-P
*/
static LRESULT co_UserFreeWindow(PWINDOW_OBJECT Window,
PW32PROCESS ProcessData,
@ -351,7 +351,7 @@ static LRESULT co_UserFreeWindow(PWINDOW_OBJECT Window,
}
else
co_UserFreeWindow(Child, ProcessData, ThreadData, SendMessages);
UserDerefObject(Child);
}
}
@ -461,7 +461,7 @@ static LRESULT co_UserFreeWindow(PWINDOW_OBJECT Window,
UserDerefObject(Window);
IntClipboardFreeWindow(Window);
IntClipboardFreeWindow(Window);
return 0;
}
@ -641,7 +641,7 @@ co_DestroyThreadWindows(struct _ETHREAD *Thread)
PWINDOW_OBJECT Wnd;
USER_REFERENCE_ENTRY Ref;
WThread = (PW32THREAD)Thread->Tcb.Win32Thread;
while (!IsListEmpty(&WThread->WindowListHead))
{
Current = WThread->WindowListHead.Flink;
@ -650,14 +650,14 @@ co_DestroyThreadWindows(struct _ETHREAD *Thread)
DPRINT("thread cleanup: while destroy wnds, wnd=0x%x\n",Wnd);
/* window removes itself from the list */
/*
fixme: it is critical that the window removes itself! if now, we will loop
here forever...
*/
//ASSERT(co_UserDestroyWindow(Wnd));
UserRefObjectCo(Wnd, &Ref);//faxme: temp hack??
if (!co_UserDestroyWindow(Wnd))
{
@ -973,9 +973,9 @@ co_IntSetParent(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndNewParent)
return NULL;
WndOldParent = Wnd->Parent;
if (WndOldParent) UserRefObject(WndOldParent); /* caller must deref */
if (WndNewParent != WndOldParent)
{
IntUnlinkWindow(Wnd);
@ -1032,7 +1032,7 @@ co_IntSetParent(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndNewParent)
of IntSetParent() */
// return WndOldParent;
// }
return WndOldParent;//NULL;
}
@ -1583,7 +1583,7 @@ co_IntCreateWindowEx(DWORD dwExStyle,
Window->MessageQueue = PsGetCurrentThreadWin32Thread()->MessageQueue;
IntReferenceMessageQueue(Window->MessageQueue);
Window->Parent = ParentWindow;
if((OwnerWindow = UserGetWindowObject(OwnerWindowHandle)))
{
Window->hOwner = OwnerWindowHandle;
@ -1594,7 +1594,7 @@ co_IntCreateWindowEx(DWORD dwExStyle,
Window->hOwner = NULL;
HasOwner = FALSE;
}
Window->UserData = 0;
Window->IsSystem = Window->Class->System;
@ -1755,11 +1755,11 @@ co_IntCreateWindowEx(DWORD dwExStyle,
Pos.y = rc.top;
}
/*
/*
According to wine, the ShowMode is set to y if x == CW_USEDEFAULT(16) and
y is something else. and Quote!
*/
/* Never believe Microsoft's documentation... CreateWindowEx doc says
* that if an overlapped window is created with WS_VISIBLE style bit
* set and the x parameter is set to CW_USEDEFAULT, the system ignores
@ -1891,7 +1891,7 @@ co_IntCreateWindowEx(DWORD dwExStyle,
MaxPos.x = Window->WindowRect.left;
MaxPos.y = Window->WindowRect.top;
DPRINT("IntCreateWindowEx(): About to get non-client size.\n");
/* WinPosGetNonClientSize SENDS THE WM_NCCALCSIZE message */
Result = co_WinPosGetNonClientSize(Window,
@ -1909,9 +1909,9 @@ co_IntCreateWindowEx(DWORD dwExStyle,
if ((dwStyle & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD)
{
PWINDOW_OBJECT PrevSibling;
PrevSibling = ParentWindow->LastChild;
/* link window as bottom sibling */
IntLinkWindow(Window, ParentWindow, PrevSibling /*prev sibling*/);
}
@ -1933,7 +1933,7 @@ co_IntCreateWindowEx(DWORD dwExStyle,
{
InsertAfter = NULL;
}
IntLinkWindow(Window, ParentWindow, InsertAfter /* prev sibling */);
}
@ -1943,7 +1943,7 @@ co_IntCreateWindowEx(DWORD dwExStyle,
DPRINT("IntCreateWindowEx(): about to send CREATE message.\n");
Result = co_IntSendMessage(Window->hSelf, WM_CREATE, 0, (LPARAM) &Cs);
if (Result == (LRESULT)-1)
{
/* FIXME: Cleanup. */
@ -1987,14 +1987,14 @@ co_IntCreateWindowEx(DWORD dwExStyle,
Window->ClientRect.top);
}
co_IntSendMessage(Window->hSelf, WM_MOVE, 0, lParam);
/* Call WNDOBJ change procs */
IntEngWindowChanged(Window, WOC_RGN_CLIENT);
}
/* Show or maybe minimize or maximize the window. */
@ -2329,7 +2329,7 @@ NtUserDestroyWindow(HWND Wnd)
UserDerefObjectCo(Window);//faxme: dunno if win should be reffed during destroy..
RETURN(ret);
CLEANUP:
DPRINT("Leave NtUserDestroyWindow, ret=%i\n",_ret_);
UserLeave();
@ -2513,7 +2513,7 @@ NtUserFindWindowEx(HWND hwndParent,
_SEH_HANDLE
{
SetLastNtError(_SEH_GetExceptionCode());
RETURN(NULL);
_SEH_YIELD(RETURN(NULL));
}
_SEH_END;
@ -2710,7 +2710,7 @@ PWINDOW_OBJECT FASTCALL UserGetAncestor(PWINDOW_OBJECT Wnd, UINT Type)
for (;;)
{
PWINDOW_OBJECT Parent, Old;
Old = WndAncestor;
Parent = IntGetParent(WndAncestor);
@ -2718,10 +2718,10 @@ PWINDOW_OBJECT FASTCALL UserGetAncestor(PWINDOW_OBJECT Wnd, UINT Type)
{
break;
}
//temp hack
// UserDerefObject(Parent);
WndAncestor = Parent;
}
break;
@ -2749,7 +2749,7 @@ NtUserGetAncestor(HWND hWnd, UINT Type)
DPRINT("Enter NtUserGetAncestor\n");
UserEnterExclusive();
if (!(Window = UserGetWindowObject(hWnd)))
{
RETURN(NULL);
@ -2757,7 +2757,7 @@ NtUserGetAncestor(HWND hWnd, UINT Type)
Ancestor = UserGetAncestor(Window, Type);
/* faxme: can UserGetAncestor ever return NULL for a valid window? */
RETURN(Ancestor ? Ancestor->hSelf : NULL);
CLEANUP:
@ -2956,9 +2956,9 @@ co_UserSetParent(HWND hWndChild, HWND hWndNewParent)
UserRefObjectCo(Wnd, &Ref);
UserRefObjectCo(WndParent, &ParentRef);
WndOldParent = co_IntSetParent(Wnd, WndParent);
UserDerefObjectCo(WndParent);
UserDerefObjectCo(Wnd);
@ -3931,12 +3931,12 @@ NtUserMoveWindow(
/*
QueryWindow based on KJK::Hyperion and James Tabor.
0 = QWUniqueProcessId
1 = QWUniqueThreadId
4 = QWIsHung Implements IsHungAppWindow found
by KJK::Hyperion.
9 = QWKillWindow When I called this with hWnd ==
DesktopWindow, it shutdown the system
and rebooted.
@ -4475,13 +4475,13 @@ NtUserWindowFromPoint(LONG X, LONG Y)
//hmm... threads live on desktops thus we have a reference on the desktop and indirectly the desktop window
//its possible this referencing is useless, thou it shouldnt hurt...
UserRefObjectCo(DesktopWindow, &Ref);
Hit = co_WinPosWindowFromPoint(DesktopWindow, PsGetCurrentThreadWin32Thread()->MessageQueue, &pt, &Window);
if(Window)
{
Ret = Window->hSelf;
RETURN( Ret);
}
}

View file

@ -1,7 +1,7 @@
<module name="win32k_base" type="objectlibrary">
<include base="win32k">.</include>
<include base="win32k">include</include>
<include base="ntoskrnl">include</include>
<include base="ntoskrnl">include</include>
<include base="freetype">include</include>
<include base="ReactOS">include/reactos/subsys</include>
<include base="ReactOS">include/reactos/drivers</include>
@ -9,7 +9,6 @@
<define name="__USE_W32API" />
<define name="_WIN32_WINNT">0x0501</define>
<define name="WINVER">0x600</define>
<define name="_SEH_NO_NATIVE_NLG" />
<define name="_WIN32K_" />
<pch>w32k.h</pch>
@ -33,14 +32,14 @@
</directory>
</if>
<ifnot property="ARCH" value="i386">
<ifnot property="ARCH" value="i386">
<file>dib24bppc.c</file>
<file>dib32bppc.c</file>
</ifnot>
</ifnot>
</directory>
<directory name="eng">
@ -93,7 +92,7 @@
<file>floor_asm.s</file>
<file>ceil_asm.s</file>
</directory>
</if>
</if>
</directory>
<directory name="ntddraw">
<compilationunit name="ntddraw.c">
@ -127,7 +126,7 @@
<file>misc.c</file>
<file>monitor.c</file>
<file>msgqueue.c</file>
<file>ntuser.c</file>
<file>ntuser.c</file>
<file>painting.c</file>
<file>prop.c</file>
<file>scrollbar.c</file>

View file

@ -1556,19 +1556,18 @@ MingwModuleHandler::GenerateLinkerCommand (
fprintf ( fMakefile, "\t$(ECHO_LD)\n" );
string targetName ( module.GetTargetName () );
string killAt = module.mangledSymbols ? "" : "--kill-at";
if ( module.IsDLL () )
{
string temp_exp = ros_temp + module.name + ".temp.exp";
CLEAN_FILE ( temp_exp );
fprintf ( fMakefile,
"\t${dlltool} --dllname %s --def %s --output-exp %s %s\n",
"\t${dlltool} --dllname %s --def %s --output-exp %s %s %s\n",
targetName.c_str (),
definitionFilename.c_str (),
temp_exp.c_str (),
killAt.c_str () );
module.mangledSymbols ? "" : "--kill-at",
module.underscoreSymbols ? "--add-underscore" : "" );
fprintf ( fMakefile,
"\t%s %s %s %s -o %s %s %s %s\n",
@ -1741,10 +1740,11 @@ MingwModuleHandler::GenerateArchiveTarget ( const string& ar,
string definitionFilename ( GetDefinitionFilename () );
fprintf ( fMakefile,
"\t${dlltool} --dllname %s --def %s --output-lib $@ %s -U\n",
"\t${dlltool} --dllname %s --def %s --output-lib $@ %s %s\n",
module.importLibrary->dllname.c_str (),
definitionFilename.c_str (),
module.mangledSymbols ? "" : "--kill-at" );
module.mangledSymbols ? "" : "--kill-at",
module.underscoreSymbols ? "--add-underscore" : "" );
}
fprintf ( fMakefile, "\t$(ECHO_AR)\n" );
@ -2199,13 +2199,13 @@ MingwModuleHandler::GenerateImportLibraryTargetIfNeeded ()
fprintf ( fMakefile, "\t$(ECHO_DLLTOOL)\n" );
string killAt = module.mangledSymbols ? "" : "--kill-at";
fprintf ( fMakefile,
"\t${dlltool} --dllname %s --def %s --output-lib %s %s\n\n",
"\t${dlltool} --dllname %s --def %s --output-lib %s %s %s\n\n",
module.GetTargetName ().c_str (),
defFilename.c_str (),
library_target.c_str (),
killAt.c_str () );
module.mangledSymbols ? "" : "--kill-at",
module.underscoreSymbols ? "--add-underscore" : "" );
}
}

View file

@ -244,7 +244,6 @@ public:
MingwKernelModuleHandler ( const Module& module );
virtual HostType DefaultHost() { return HostFalse; }
virtual void Process ();
std::string TypeSpecificCFlags() { return "-D_SEH_NO_NATIVE_NLG"; }
private:
void GenerateKernelModuleTarget ();
};
@ -278,7 +277,6 @@ public:
MingwKernelModeDLLModuleHandler ( const Module& module );
virtual HostType DefaultHost() { return HostFalse; }
virtual void Process ();
std::string TypeSpecificCFlags() { return "-D_SEH_NO_NATIVE_NLG"; }
std::string TypeSpecificLinkerFlags() { return "-nostartfiles -nostdlib"; }
void AddImplicitLibraries ( Module& module );
private:
@ -292,7 +290,7 @@ public:
MingwKernelModeDriverModuleHandler ( const Module& module );
virtual HostType DefaultHost() { return HostFalse; }
virtual void Process ();
std::string TypeSpecificCFlags() { return "-D__NTDRIVER__ -D_SEH_NO_NATIVE_NLG"; }
std::string TypeSpecificCFlags() { return "-D__NTDRIVER__"; }
std::string TypeSpecificLinkerFlags() { return "-nostartfiles -nostdlib"; }
void AddImplicitLibraries ( Module& module );
private:
@ -306,7 +304,6 @@ public:
MingwNativeDLLModuleHandler ( const Module& module );
virtual HostType DefaultHost() { return HostFalse; }
virtual void Process ();
std::string TypeSpecificCFlags() { return "-D_SEH_NO_NATIVE_NLG"; }
std::string TypeSpecificLinkerFlags() { return "-nostartfiles -nostdlib"; }
void AddImplicitLibraries ( Module& module );
private:
@ -320,7 +317,7 @@ public:
MingwNativeCUIModuleHandler ( const Module& module );
virtual HostType DefaultHost() { return HostFalse; }
virtual void Process ();
std::string TypeSpecificCFlags() { return "-D__NTAPP__ -D_SEH_NO_NATIVE_NLG"; }
std::string TypeSpecificCFlags() { return "-D__NTAPP__"; }
std::string TypeSpecificLinkerFlags() { return "-nostartfiles -nostdlib"; }
void AddImplicitLibraries ( Module& module );
private:

View file

@ -142,7 +142,7 @@ GetExtension ( const string& filename )
if (index == string::npos) index = 0;
string tmp = filename.substr( index, filename.size() - index );
size_t ext_index = tmp.find_last_of( '.' );
if (ext_index != string::npos)
if (ext_index != string::npos)
return filename.substr ( index + ext_index, filename.size() );
return "";
}
@ -373,6 +373,12 @@ Module::Module ( const Project& project,
else
mangledSymbols = false;
att = moduleNode.GetAttribute ( "underscoresymbols", false );
if ( att != NULL )
underscoreSymbols = att->value == "true";
else
underscoreSymbols = false;
att = moduleNode.GetAttribute ( "host", false );
if ( att != NULL )
{
@ -424,7 +430,7 @@ Module::Module ( const Project& project,
installName = att->value;
else
installName = "";
att = moduleNode.GetAttribute ( "usewrc", false );
if ( att != NULL )
useWRC = att->value == "true";
@ -1451,7 +1457,7 @@ If::~If ()
void
If::ProcessXML()
{
}

View file

@ -82,6 +82,7 @@
entrypoint %CIdentifier; #IMPLIED
baseaddress %CIdentifier; #IMPLIED
mangledsymbols %Text; #IMPLIED
underscoresymbols (true|false) "false"
installbase %Text; #IMPLIED
installname %Text; #IMPLIED
usewrc %Text; #IMPLIED

View file

@ -296,6 +296,7 @@ public:
ModuleType type;
ImportLibrary* importLibrary;
bool mangledSymbols;
bool underscoreSymbols;
bool isUnicode;
bool isDefaultEntryPoint;
Bootstrap* bootstrap;