Re: Exception Handling - help!

From: George (George_at_discussions.microsoft.com)
Date: 11/03/04


Date: Wed, 3 Nov 2004 02:27:02 -0800

Hi David,

thank you very much for the answer.

> the only
> language that supports user filters is VB,

right. After I sent the post, I installed and tried myself examples in VB.

> and it does not support calling
> methods, only evaluating simple expressions. To call a user-filter you would
> have to write the code directly in IL.

I don't agree :-) I tried out examples where the "when" clause of a catch
contains a method call. Something like:

Catch exc As System.Exception When m(0) < 5

In turn, "m" could call "n" and so on ...

> Since the stack has not yet been unwound then any methods
> invoked during the user filter would have to be on top of the stack, which
> implies that those routines also have access to the stack frame in which the
> original exception occurred

are you sure these routines have access to the faulting frame? I think
rather not. They are in completely different frames.

> If another exception occurs within a user filter then the runtime would have
> to treat this as a nested exception.

I tried examples in VB and I guess they do the following:

if an exception occurs in a filter (i.e. in pass 1), then it starts a new
exception propagation. It looks for a suitable handler. Upon propagation, if
this exception reaches our filter, then the 1st pass of this second exception
finishes - further the second pass is executed. Finally, our filter is
considered as it would have returned 0 (i.e. "continue search"). Please
someone contradict me if I'm wrong!!

In this situation, we return to the 1st pass of the initial exception,
looking for another catch or filter.

> This isn't well
> documented.

I definitely agree with you!!

> After the user filter executes, if it returns a value that tells the runtime
> to execute the handler the runtime then remembers the catch block that will
> handle the original exception, executes the 2nd pass, which executes finally
> blocks, and this continues until the stack is unwound and control resumes
> within the catch handler.

You are right!

One again many thanks!
George



Relevant Pages

  • Re: Exception Handling - help!
    ... >> invoked during the user filter would have to be on top of the stack, ... > are you sure these routines have access to the faulting frame? ... >> to treat this as a nested exception. ...
    (microsoft.public.dotnet.framework.clr)
  • Re: Exception Handling - help!
    ... | to also be in Partition I.12.4.2.5, the overview of Exception Handling. ... | filter block - is this true only for inline code, ... | (which it was not when the exception was thrown). ... | nested exception the new exception would have to walk the stack anyway ...
    (microsoft.public.dotnet.framework.clr)
  • Re: DirectShow Transcoding Woes
    ... to assume that the addition of a particular filter ... results in the exception being thrown by RenderFile. ... faults are not supposed to happen and the code ...
    (microsoft.public.win32.programmer.directx.video)
  • ISA2004 Firewall fails to start & event id 14057
    ... a 3rd party filter installed and occasionally I am ... When attempting to start the firewall in the ISA server manager I sometimes ... again saw exception 6D9 messages during module loading as follows: ...
    (microsoft.public.isa.configuration)
  • Re: Exception Handling - help!
    ... Can the nesting be of ... can an exception filter throw an ... | which itself causes another filter to execute, ...
    (microsoft.public.dotnet.framework.clr)

Loading