Yes, it is the comment I was referring to.

On the ordering differences:

Assume that the implementation of PAL_LocalFilter wrapper will be doing
catch & rethrow. I can't think of any other implementation at the moment
that preserves the SEH interop. Something like:

MyDelegateFilter(...)
{
    exception_thrown = true;
    <store the exception info>
    return EXCEPTION_EXECUTE_HANDLER;
}

MyDelegateWrapperHelper(...)
{
    PAL_TRY {
        MyDelegate(...);
    } PAL_EXCEPT_FILTER(MyDelegateFilter, ...) {
    }
    PAL_ENDTRY
}

MyDelegateWrapper(...)
{
    <pack all parameters into myparams>

    PAL_LocalFilter(MydelegatewrapperHelper, &myparams);
    
    if (exception_thrown) {
         // rethrow the exception
         RaiseException(<stored exception info>);
    }
}

In your example, things will be executed in the following order with
this solution:

- C throws exception
- C finally block is executed
- B filter is executed
- B handler is executed
- execution continues without any exception back into A

To compare, things should be executed in the following order on .NET
Framework:

- C throws exception
- B filter is executed
- C finally block is executed
- B handler is executed
- execution continues without any exception back into A


-Jan

This posting is provided "AS IS" with no warranties, and confers no
rights.

-----Original Message-----
From: Cristian Diaconu [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, May 01, 2002 10:29 AM
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET-ROTOR] SEH Interop via PAL - .NET vs Rotor


On Wed, 1 May 2002 08:46:54 -0700, Jan Kotas <[EMAIL PROTECTED]>
wrote:

>There is just a small comment in the implementation of PAL_LocalFrame 
>in pal\win32\win32pal.c to suggest that this is possible. You could try

>to wrap the delegate in PAL_LocalFrame by yourself as a workaround.
>

I see...

I assume you refer to the comment that reads:
"
// Note that it can be used to workaround a random problems with alien
// stack frames being installed on the stack (e.g. in some PInvokes) "

It was so discreet ;-) I glazed over it without paying much attention.
Yes, I believe PAL_LocalFrame should do the expected thing.

>>>>>>>>>>
there will be a small differences in
the order filters and handlers get executed under some circumstances
<<<<<<<<<<

Any chance you find a minute to elaborate on this?

Thanks

Cristian

Reply via email to