Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8685561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:36:36+00:00 2026-06-12T22:36:36+00:00

When writing a function/procedure/method that utilizes Windows API functions or functions of certain Windows

  • 0
  1. When writing a function/procedure/method that utilizes Windows API functions or functions of certain Windows DLLs (e.g. ntdll.dll), which Delphi exception class should be used to raise the last Win32/Win64 errors?

    Quoted from Delphi XE3 documentation about System.SysUtils.EExternal:

    “Note: EExternal classes represent Win32 exception codes. The ExceptionRecord member points to a Win32 exception record.”

  2. From that point, I conclude that there are differences between Win32 and Win64 exception mechanism. What are the differences between them?

  3. For debugging purpose—I mean in regards to the stack frames related stuffs—, are the differences lead to different code implementation of exception handling for each platform?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T22:36:37+00:00Added an answer on June 12, 2026 at 10:36 pm

    First of all, I am assuming that your question concerns Delphi, despite the Free Pascal tag. I’m basing that assumption on the fact that you quote the Delphi documentation.

    A Windows API message should be converted into an exception by calling RaiseLastOSError. This will raise an EOSError. That is a native Delphi exception.

    The EExternalError exception is unrelated. That’s what is used when the RTL converts a system trap, e.g. access violation, maths errors etc. into a native exception. Note that Win32 is commonly used to refer to both the 32 and 64 bit Windows API. There’s really only one interface with both 32 and 64 bit variants.

    The underlying exception handling model is completely different between 32 and 64 bit Windows. The 32 bit model is stack based and the 64 bit model is table based. This means that the implementations of exception handling, and try/finally, are completely different between 32 and 64 bit architectures.

    The original implementation in XE2 of the 64 bit table based model had a large number of faults. I am pleased to say that, following a number of QC reports submitted by myself and others, the implementation in XE3 is much improved.

    Stack Overflow is not the place to go into the low-level details of the exception handling ABI of these two architectures. Instead I offer the following articles:

    • A Crash Course on the Depths of Win32™ Structured Exception Handling
    • x64 Structured Exception Handling
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When writing a Delphi procedure or function in assembly code, which registers must be
Using Delphi 2010. I am looking for (possibly) a function or procedure which can
I am writing function that involve other function from base R with a lot
I'm currently writing a function what would create a zip file, which will be
I'm writing a function, which determine the number of useful bits of a 16
I'm writing a function which will drop a table if it already exists. It
I am writing a function in Haskell that deals with numbers beyond the length
I'm writing a function that replaces long hex coded color ( #334455 ) with
Short of writing a function manually that translates a few known REFIID to names,
I'm writing a function to call a stored procedure given an IDictionary of arguments.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.