add comments + small fix/change
Modified: trunk/reactos/include/pseh/prettybased.h
_____
Modified: trunk/reactos/include/pseh/prettybased.h
--- trunk/reactos/include/pseh/prettybased.h 2005-01-11 01:12:36 UTC
(rev 12923)
+++ trunk/reactos/include/pseh/prettybased.h 2005-01-11 01:47:35 UTC
(rev 12924)
@@ -39,8 +39,12 @@
to prevent variables from being optimized into registers.
See:
http://alphalinux.org/archives/axp-list/1998/February1998/0330.html
+-you can't use return within a try/except/finally block
+-you can't use __LEAVE within a (for/do/while) loop. it will only leave
the loop
+and not the try-block itself
+
USAGE:
__TRY{
@@ -98,7 +102,7 @@
{
_SEHPortableFrame_t SEH_Header;
_SEHJmpBuf_t SEH_JmpBuf;
-/* alternative: _SEHJmpBuf_t* SEH_JmpRetPtr; */
+ _SEHJmpBuf_t* SEH_JmpRetPtr;
}
_SEHFrame_t;
@@ -151,12 +155,8 @@
if(_SEHSetJmp(jmpRetBuf) == 0)
{
- _SEHLongJmp_KeepEsp(myframe->SEH_JmpBuf, (int)&jmpRetBuf);
-
- /* alternative:
myframe->SEH_JmpRetPtr = &jmpRetBuf;
_SEHLongJmp_KeepEsp(myframe->SEH_JmpBuf, 2);
- */
}
}
@@ -259,10 +259,9 @@
#define ___ENDTRY
\
} while (0);
\
\
- if (_ret > 1)
\
+ if (_ret == 2)
\
{
\
- _SEHLongJmp(*((_SEHJmpBuf_t*)_ret), 1);
\
- /* alternative: _SEHLongJmp(*_SEHFrame->SEH_JmpRetPtr,
1); */ \
+ _SEHLongJmp(*_SEHFrame->SEH_JmpRetPtr, 1);
\
}
\
break;
\
}
\
@@ -282,6 +281,7 @@
#define __ENDTRY
#define _SEH_STATIC_FILTER(ACTION_) (ACTION_)
#define __LEAVE __leave
+ #define __LEAVE2 __leave
#else
#define __TRY2 ___TRY
#define __EXCEPT2 ___EXCEPT_DUAL
@@ -292,6 +292,7 @@
#define __FINALLY ___FINALLY_SINGLE
#define __ENDTRY ___ENDTRY
#define __LEAVE break
+ #define __LEAVE2 break
#endif