11#if !defined(MAINWIN) && !defined(WINELIB)
29typedef struct _SCOPETABLE {
30 unsigned long previousTryLevel;
31 int __stdcall (*lpfnFilter)();
33 void __stdcall (*lpfnHandler)();
39typedef struct _VC_EXCEPTION_REGISTRATION {
40 unsigned long stan_stack;
41 unsigned long xcept_ptrs;
43 unsigned long handler;
45 unsigned long trylevel;
47} VC_EXCEPTION_REGISTRATION;
52#define EH_NONCONTINUABLE 0x01
53#define EH_UNWINDING 0x02
54#define EH_EXIT_UNWIND 0x04
55#define EH_STACK_INVALID 0x08
56#define EH_NESTED_CALL 0x10
58#define EXCEPTION_EXECUTE_HANDLER 1
60#define EXCEPTION_CONTINUE_SEARCH 0
71#define GetExceptionInformation() \
74#define GetExceptionCode()\
75(**((int**)__vcer.xcept_ptrs))
77#define RpcExceptionCode() GetExceptionCode()
83#define _SXV(args...) \
84__asm__ __volatile__("/BEGIN_SXV\n"); \
85VC_EXCEPTION_REGISTRATION __vcer; \
86int __volatile__ __xcpt_filter_result __attribute__((__unused__)); \
87int __volatile__ __xcpt_happened __attribute__((__unused__)); \
88__asm__ __volatile__(".equ __except_list, 0\n"); \
89__vcer.trylevel=(unsigned long)-1; \
90__vcer.handler=(unsigned long)&mexcept_handler3; \
91__asm__ __volatile__("/END_SXV\n");
99: "=g" (__vcer.stan_stack), "=g" (__vcer._ebp) : );\
100__asm__ __volatile__(\
101 "movl %%fs:__except_list,%0\n\t"\
102 "movl %2,%%fs:__except_list\n\t"\
103 "/ ScopeTable Pointer\n\t"\
105 : "=g" (__vcer.prev), "=m" (__vcer.tbl_ptr): "r" (&__vcer.prev) : "memory");\
107__asm__ __volatile__("/ END_TRY");\
113#undef _except(args...)
115#define _except(args...) \
116__asm__ __volatile__("/BEGIN_EXCEPT\n");\
118__asm__ __volatile__(\
121 "5:.int -1, 1f, 2f\n"\
125__xcpt_filter_result = (## args);\
126__asm__ __volatile__(\
130 : "=m" (__xcpt_happened)\
131 : "a" (__xcpt_filter_result)\
133__asm__ __volatile__(\
136 "/ reset __except_list to previous exception function\n\t"\
137 "movl %0,%%fs:__except_list\n" : : "r" (__vcer.prev) : "memory");\
139__asm__ __volatile__("/END_EXCEPT\n");\
140if(__xcpt_happened && (## args))
144#define __except _except
145#define __except__ _except
156 struct _EXCEPTION_RECORD* pExceptionRecord,
157 VC_EXCEPTION_REGISTRATION* pRegistrationFrame,
158 struct _CONTEXT* pContextRecord,
162#define TRYLEVEL_NONE -1
167 struct _EXCEPTION_RECORD* pExceptionRecord,
168 VC_EXCEPTION_REGISTRATION* pRegistrationFrame,
169 struct _CONTEXT* pContextRecord,
175 struct _EXCEPTION_RECORD* pExceptionRecord,
176 VC_EXCEPTION_REGISTRATION* pRegistrationFrame,
177 struct _CONTEXT* pContextRecord,
181 VC_EXCEPTION_REGISTRATION* __vcer=(VC_EXCEPTION_REGISTRATION*)((
long*)pRegistrationFrame-2);
184 EXCEPTION_POINTERS exceptPtrs;
185 SCOPETABLE* pScopeTable;
188 __asm__ __volatile__(
"cld");
193 if ( ! (pExceptionRecord->ExceptionFlags
198 exceptPtrs.ExceptionRecord = pExceptionRecord;
199 exceptPtrs.ContextRecord = pContextRecord;
203 __vcer->xcept_ptrs = (
unsigned long)&exceptPtrs;
206 trylevel = __vcer->trylevel ;
209 pScopeTable = __vcer->tbl_ptr;
213 if ( pScopeTable[trylevel].lpfnFilter ){
222 __asm__ __volatile__(
"pushl %%ebp\n\t"\
225 "popl %%ebp" :
"=a" (filterFuncRet) \
226 :
"r" (pScopeTable[trylevel].lpfnFilter),
"m" (__vcer->_ebp) );
230 if ( filterFuncRet < 0 )
254 __vcer->trylevel = pScopeTable->previousTryLevel;
260 __asm__ __volatile__ (
"pushfl\n\tpopl %%esi\n\t"\
261 "movl %0, %%esp\n\t"\
262 "movl %1, %%ebp\n\t"\
264 "pushl %%esi\n\tpopfl\n\t"\
265 "ret": :
"r" (__vcer->stan_stack),
"r" (__vcer->_ebp),
"r" (pScopeTable->lpfnHandler) );
269 __vcer=(VC_EXCEPTION_REGISTRATION*)(((
long*)__vcer->prev)-2);
270 trylevel = pScopeTable->previousTryLevel;
271 pScopeTable = __vcer->tbl_ptr;
273 goto search_for_handler;
318 ShouldClose = shouldClose;
321 long err = QueryInfo(0, 0, &SubkeyCount, 0, 0, &ValueCount, 0, 0, 0, 0);
322 if (err != S_OK && err != ERROR_INSUFFICIENT_BUFFER)
Class will be base class for owner draw items: ListBox,ComboBox,Menu atc.
TRegKey(THandle baseKey, tstring keyName, REGSAM samDesired=KEY_ALL_ACCESS, TCreateOK createOK=CreateOK)
Creates or opens a key given a base key and a subkey name.
char * strnewdup(const char *s, size_t minAllocSize=0)
Object Windows Library (OWLNext Core).
TDrawItem * lTCB(uint32 data)
#define TYPESAFE_DOWNCAST(object, toClass)
General Registry access & registration implementation TRegKey, TRegValue, TRegKeyIterator,...
#define EXCEPTION_EXECUTE_HANDLER
@ ExceptionContinueSearch
@ ExceptionCollidedUnwind
@ ExceptionNestedException
@ ExceptionContinueExecution
#define EXCEPTION_CONTINUE_SEARCH
int mexcept_handler3(struct _EXCEPTION_RECORD *pExceptionRecord, VC_EXCEPTION_REGISTRATION *pRegistrationFrame, struct _CONTEXT *pContextRecord, void *)
void _local_unwind2(void *, int)
void _global_unwind2(void *)
#define GetExceptionCode()
Base window class TWindow definition, including HWND encapsulation.