MyRaiseExceptProc and TExceptionRecord under x64

delphi package - automated exception handling
Post Reply
obones
Posts: 66
Joined: Fri May 15, 2009 11:47 am

MyRaiseExceptProc and TExceptionRecord under x64

Post by obones »

Hello,

Reading the code for another issue I'm facing, I stumbled upon the implementation of MyRaiseExceptProc all in assembly.
I'm surprised that it works for x64 because it never uses the "r" registers as one would expect under x64.
Now, I can see that the RTL itself does not use any x64 specific code, but it looks dubious as well because it stores object pointers in eax where clearly, that is not enough.

Am I missing something here?
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: MyRaiseExceptProc and TExceptionRecord under x64

Post by madshi »

Don't know about the RTL code. Haven't looked at that, and don't want to, not my responsibility.

About madExcept: You must have looked at the wrong part of the "{$ifdef _WIN64} {$else} {$endif}" section. The x64 part doesn't have a "MyRaiseExceptProc" at all, there the exception hooking works a bit differently.
obones
Posts: 66
Joined: Fri May 15, 2009 11:47 am

Re: MyRaiseExceptProc and TExceptionRecord under x64

Post by obones »

You are definitely right, I did not expect the ifdef to be that big and did not notice it at first.
Sorry for wasting your time.
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: MyRaiseExceptProc and TExceptionRecord under x64

Post by madshi »

No probs, only cost me a minute.
Post Reply