<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-2"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    <br>
    I have looked into this again in a little more detail.<br>
    What I think is happening is the following:<br>
    <br>
    in delphi an exception is raised.<br>
    <br>
    Delphi.Sytstem._RaiseExcept<br>
        RaiseException<br>
            RtlRaiseException<br>
                RtlDispatchException<br>
                    RtlpExecuteHandlerForExecption<br>
                        Delphi.System._ExceptionHandler<br>
                            UnhandledExceptionFilter<br>
    <br>
    EXCEPTION_DISPOSITION<br>
     __cdecl Delphi.System.ExceptionHandler(<br>
         struct _EXCEPTION_RECORD *ExceptionRecord,<br>
         void * EstablisherFrame,<br>
         struct _CONTEXT *ContextRecord,<br>
         void * DispatcherContext<br>
         );<br>
    <br>
    Source code can be found here (search for <font color="#000000">_RaiseExcept,
      _ExceptionHandler):<br>
    </font><a class="moz-txt-link-freetext" href="http://www.getunderstand.com/documents/sample_reports/udelphi_example_reports/3.html">http://www.getunderstand.com/documents/sample_reports/udelphi_example_reports/3.html</a><br>
    <br>
    what you can see in the code for _<font color="#000000">ExceptionHandler
      is</font><br>
    10680         LEA     EAX,[ESP+4]<br>
    10681         PUSH    EAX<br>
    10682         CALL    UnhandledExceptionFilter<br>
    <br>
    This is an unmodified esp, so esp points to the return address and
    esp+4 points to the function parameters<br>
    so it's effectively doing something like<br>
    <br>
    <pre><span id="ctl00_MTCS_main_ctl01"><pre class="libCScode" id="ctl00_MTCS_main_ctl01_code"><code>EXCEPTION_POINTER ExceptionPointers;
</code><code></code><code>ExceptionPointers</code><code></code><code>.</code><code>ExceptionRecord</code><span id="ctl00_MTCS_main_ctl01"></span> = ExceptionRecord;<code>
ExceptionPointers</code><code></code><code>.</code><code></code><span id="ctl00_MTCS_main_ctl01"></span><code>ContextRecord</code><span id="ctl00_MTCS_main_ctl01"></span> = EstablisherFrame;
UnhandledExceptionFilter(&amp;<code>ExceptionPointers</code><span id="ctl00_MTCS_main_ctl01"></span>);<span id="ctl00_MTCS_main_ctl01"></span>

It is done that way in multiple locations (line 9641, 9666 (push / esp+8), 10028, 10064, ...)
so It's obviously done intentionally.



</pre></span></pre>
  </body>
</html>