thank you rob.
i'm attaching some example code - it's from client/perf.c.
after looking at these closely, i believe it would be straightforward to #define CATCH to __EXCEPT etc. and to rewrite the FreeDCE __EXCEPT argument as a function rather than a structure.
dcethreads provides a CATCH macro - you are expected to provide a catcher for _one_ particular exception type. you're expected to roll these one after another: the macro expands to
"} else if exc_matches(...) { "
basically, i think the way that the Wine code does it, the CATCH possibilities are "rolled" into one EXCEPT - is that correct?
or can you do more than one EXCEPT (even if the function says "i accept more than one type of exception - visa _or_ marstercaaard")
so if the FreeDCE CATCH exceptions were turned into EXCEPT-style functions, on a "#ifdef / ./configure --with-wine-exceptions" basis, i think that'd work.
this raises a further question, which i apologise for not being able to work out from looking at the macros.
is it possible to do this:
__TRY { /* do something horrible */ } __EXCEPT(exception_1) { printf("this is exception 1\n"); } __EXCEPT(exception_2) { printf("this is exception 1\n"); } ENDTRY
secondary question: does Wine's exception handling cope with "stacked" exceptions and "fall-through"?
if there are "nested" __TRY / __EXCEPT blocks, and an exception is not covered by the "inner" exception handlers, will it go through to the "outer" ones?
ta rob.
l.
On Wed, Jan 26, 2005 at 03:11:36PM -0600, Robert Shearman wrote:
Luke Kenneth Casson Leighton wrote:
hi,
i would like to check something which, if it is the case, may make porting FreeDCE to wine a no-brainer.
i notice that there exists pthread emulation in Wine: it says so at the top of wine/dlls/kernel/pthread.c
can i therefore expect the following things:
- the attached test program to compile and work under wine,
with a few macros and/or simple wrapper functions e.g. redirect RAISE to RaiseException?
- a program that uses posix threads to also at the same time
be able to use Wine Exception routines/macros, try/except/catch?
... wouldn't it be ironic if Wine's pthreads emulation turned out to provide exactly the posix draft 4 threading semantics that FreeDCE programs expect?
l.
No, that program won't compile or run. Windows exception handling (SEH) requires you to have an exception filter function so that you don't get, say, a STATUS_ACCESS_VIOLATION exception when you are expecting an RPC_E_DISCONNECT exception.
You can see an example of Wine exception handling here: http://cvs.winehq.org/cvsweb/wine/dlls/user/lstr.c?rev=1.31&content-type...
Rob