Windows 64 bit api

Programming Guide for 64-bit Windows

Microsoft has released 64-bit versions of the Windows operating system. 64-bit Windows was designed with compatibility in mind. Developers can ensure that their existing 32-bit applications run well under 64-bit Windows or take advantage of the benefits of 64-bit Windows by migrating their applications.

Benefits of 64-bit Windows

A 64-bit operating system supports far more physical memory than a 32-bit operating system. For example, most 32-bit Windows systems support a maximum of 4 gigabytes of physical memory, with up to 3 gigabytes of address space for each process, while 64-bit Windows supports up to 2 terabytes of physical memory with 8 terabytes of address space for each process. The increased physical memory includes the following benefits for applications:

  • Each application can support more users. All or part of each application must be replicated for each user, which requires additional memory.
  • Each application has better performance. Increased physical memory allows more applications to run simultaneously and remain completely resident in the system’s main memory. This reduces or eliminates the performance penalty of swapping pages to and from disk.
  • Each application has more memory for data storage and manipulation. Databases can store more of their data in the physical memory of the system. Data access is faster because disk reads are not necessary.
  • Applications can manipulate large amounts of data easily and more reliably. Video composition for motion picture work requires 64-bit Windows for this reason. Modeling for scientific and financial applications benefits greatly from memory-resident data structures that are not possible on 32-bit Windows.

There are also important benefits for businesses:

  • Increased productivity. Knowledge workers can spend their time thinking and producing, rather than waiting for the software to finish its tasks.
  • Lower cost of ownership. Each server can support larger numbers of users and applications, so your business will require fewer servers. This translates directly into less management overhead—one of the highest costs in any computing environment.
  • New application opportunities. New applications can be designed without the barriers imposed by 32-bit Windows. New graphics applications will make work easier and more enjoyable. Data-intensive tasks that are impossible today can be done with 64-bit Windows.

Национальная библиотека им. Н. Э. Баумана
Bauman National Library

Персональные инструменты

Microsoft Windows API

Microsoft Windows API — наиболее важная и мощная библиотека функций интерфейсов программирования приложений Microsoft Windows, которую могут использовать разработчики приложений. Является самым прямым способом взаимодействия приложений с Windows. «Майкрософт» выпускает специальный комплект разработчика программного обеспечения для создания программ, использующих Windows API, который носит название Platform SDK. Данный комплект содержит файлы заголовков, библиотеки, примеры, документацию и инструменты, необходимые для разработки приложений для Microsoft Windows и Microsoft .NET Framework. [Источник 1]

Содержание

Общие сведения

Windows API спроектирован для написания прикладных программ на языке С, предназначенных для работы под управлением операционной системы MS Windows. Тем не менее, API может быть использован любым языком программирования компилятора или ассемблером , способным обрабатывать (четко определенные) структуры данных низкого уровня наряду с предписанными соглашениями о вызовах для звонков и обратных вызовов . Кроме того , внутренняя реализация функции API была разработана на нескольких языках, исторически. Несмотря на то , что С не является объектно-ориентированным программированием языка, Windows API , и Windows , оба исторически были описаны как объектно-ориентированные. Там также было много классов обертки и расширений (от Microsoft и другие) для объектно-ориентированных языков программирования, которые делают эту объектно-ориентированную структуру более четко (MFC, VCL, GDI+ и т.д.) , Так , например, Microsoft Windows 8 обеспечивает API для Windows и WinRT API, который реализован в C++ и объектно-ориентированный дизайн. [Источник 2]

Работа через Windows API — это наиболее близкий к операционной системе способ взаимодействия с ней из прикладных программ. Более низкий уровень доступа, необходимый только для драйверов устройств, в текущих версиях Windows предоставляется через Windows Driver Model.

Windows API представляет собой множество функций, структур данных и числовых констант, следующих соглашениям языка Си. Все языки программирования, способные вызывать такие функции и оперировать такими типами данных в программах, исполняемых в среде Windows, могут пользоваться этим API. В частности, это языки C++, Pascal, Visual Basic и многие другие. Эти функции в свою очередь могут быть разбиты на следующие основные категории:

  • Базовые службы (Base Services);
  • Службы компонентов (Component Services);
  • Службы пользовательского интерфейса (User Interface Services);
  • Графические и мультимедийные службы (Graphics and Multimedia Services);
  • Обмен сообщениями и совместная работа (Messaging and Collaboration);
  • Сеть (Networking);
  • Веб-службы (Web Services). [Источник 3]

В компании Microsoft и сторонними разработчиками для облегчения программирования под Windows было предпринято множество попыток создать библиотеки и среды программирования, частично или полностью скрывающие от программиста особенности Windows API, и предоставляющие ту или иную часть его возможностей в более удобном виде. В частности, сама Microsoft в разное время предлагала библиотеки Active Template Library (ATL)/Windows Template Library (WTL), MFC, .Net/WinForms/WPF, TXLib. Компания Borland (ныне Embarcadero, её преемник в части средств разработки) предлагала OWL и VCL. Есть кросс-платформенные библиотеки, такие как Qt, Tk и многие другие. Весомая часть этих библиотек сконцентрирована на облегчении программирования графического интерфейса пользователя.

История Microsoft API

На протяжении многих лет были внесены различные изменения и дополнения в системах Windows , и Windows API изменился и вырос. В API для Windows 1.0 поддерживаются менее 450 функций , в то время как современные версии насчитывают тысячи. Тем не менее, в целом интерфейс остается достаточно последовательным, и старый Windows 1.0 будет по- прежнему выглядеть знакомым для программиста, который использует современный Windows API.

Microsoft прилагает усилия, чтобы сохранить обратную совместимость. Для достижения этой цели при разработке новых версий Windows, Microsoft иногда реализует обходные пути, чтобы обеспечить совместимость с программным обеспечением сторонних производителей, которые использовали предыдущую версию незарегистрированным или даже нецелесообразным способом.

Одно из самых больших изменений в Windows API , был переход от Win16 (поставляется в Windows 3.1 и старше) в Win32 (Windows NT и Windows 95 и выше). В то время как Win32 первоначально была введена с Microsoft Windows NT 3.1 и Win32s разрешено использовать подмножество Win32. Для того, чтобы облегчить переход, в Windows 95, для разработчиков снаружи и внутри Microsoft ,была использована сложная схема API преобразователь , она может позволить 32-битный код для вызова в 16-битного кода (для большинства из Win16 API) , и наоборот. Плоские преобразователи позволили 32-битному коду вызывать 16-битные библиотеки, а схема широко использовалась в библиотеках Windows 95 , чтобы избежать переноса всей ОС для Win32 в одном пакете. В Windows NT, операционная система была чистой 32-битной, кроме частей для совместимости с 16-разрядными приложениями, и только родовыми преобразователями были доступны преобразователи от Win16 до Win32, как и для Windows 95. Platform SDK поставляются с компилятором , который может производить код , необходимый для этих преобразователей. Версии 64-битных ОС Windows также могут запускать 32-разрядные приложения с помощью WoW64. [Источник 4]

Читайте также:  Blank ico windows 10

Обзор

Функции, предоставляемые Windows API, могут быть представлены следующим образом:

  • Функции Windows API. Документированные, вызываемые подпрограммы в WindowsAPI. Например, CreateProcess, CreateFile и GetMessage.
  • Собственные системные службы (или системные вызовы). Недокументированные базовые службы в операционной системе, вызываемые при работе в пользовательском режиме. Например, NtCreateUserProcess является внутренней службой, которую функция Windows CreateProcess вызывает для создания нового процесса.
  • Функции поддержки ядра (или подпрограммы). Подпрограммы внутри операционной системы Windows, которые могут быть вызваны только из режима ядра. Например, ExAllocatePoolWithTag является подпрограммой, вызываемой драйверами устройств для выделения памяти из системных динамически распределяемых областей Windows (называемых пулами).
  • Службы Windows. Процессы, запускаемые Диспетчером управления службами (Windowsservicecontrolmanager). Например, служба Диспетчер задач запускается в виде процесса, работающего в пользовательском режиме, в котором поддерживается команда at (аналогичная UNIX-командам at или cron).
  • Библиотеки DLL (dynamic-link libraries — динамически подключаемые библиотеки). Набор вызываемых подпрограмм, связанных вместе в виде двоичного файла, который может быть загружен в динамическом режиме приложениями, которые используют эти подпрограммы. В качестве примера можно привести msvcrt.dll (библиотеку времени выполнения для приложений, написанных на языке C) и kernel32.dll (одну из библиотек подсистемы Windows API). DLL-библиотеки широко используются компонентами и приложениями Windows, которые работают в пользовательском режиме. Преимущество, предоставляемое DLL-библиотеками по сравнению со статическими библиотеками, заключается в том, что они могут использоваться сразу несколькими приложениями, и Windows обеспечивает наличие в памяти только одной копии кода DLL-библиотеки для тех приложений, в которых имеются ссылки на эту библиотеку. Следует заметить, что неисполняемые .NET-сборки компилируются как DLL-библиотеки, но без каких-либо экспортируемых подпрограмм. CLR анализирует скомпилированные метаданные для доступа к соответствующим типам и элементам классов.

Взаимодействие программ

Windows API , предназначен в основном для взаимодействия операционной системы с приложениями. Для связи между различными приложениями Microsoft разработала ряд технологий наряду с основной Windows API. Это началось с динамическим обменом данных (DDE), которая была заменена Object Linking и Embedding (OLE) , а затем с помощью модели компонентных объектов (COM), объектов автоматизации , ActiveX управления, и .NET Framework. Существует не всегда четкое различие между этими технологиями, и есть много совпадений.

Разнообразие терминов в основном является результатом группировки программных механизмов, которые имеют отношение к данному аспекту разработки программного обеспечения. Автоматизация конкретно относится к экспорту функции приложения или компонента ( в качестве интерфейса прикладного программирования (API)) , так что он может быть под контролем других приложений, а не только пользователей, .NET является автономным общей методологии и технологии разработки настольных веб — приложений , написанных на различных точно в срок (JIT) , составленный языков.

Версии Windows API

Почти каждая новая версия Microsoft Windows представила свои собственные дополнения и изменения в Windows API.

  • Win16 — первая версия Windows API для 16-разрядных версий Windows. Изначально назывался просто Windows API, затем стал называться Win16 для отличия от Win32.
  • Win32 — 32-разрядный API для современных версий Windows. Самая популярная ныне версия. Базовые функции этого API реализованы в динамически подключаемых библиотеках kernel32.dll и advapi32.dll ; базовые модули графического интерфейса пользователя — в user32.dll и gdi32.dll . Win32 появился вместе с Microsoft Windows NT и затем был перенесён в несколько ограниченном виде в системы серии Microsoft Windows 9x. В современных версиях Windows, происходящих от Windows NT, работу Win32 GUI обеспечивают два модуля: csrss.exe (процесс исполнения клиент-сервер), работающий в пользовательском режиме, и win32k.sys в режиме ядра. Работу же системных Win32 API обеспечивает ядро — ntoskrnl.exe .
  • Win32s — подмножество Win32, устанавливаемое на семейство 16-разрядных систем Microsoft Windows 3.x, и реализующее ограниченный набор функций Win32 API для этих систем.
  • Win64 — 64-разрядная версия Win32, содержащая дополнительные функции для использования на 64-разрядных компьютерах. Win64 API можно найти только в 64-разрядных версиях Microsoft Windows XP, Microsoft Windows Server 2003, Microsoft Windows Vista, Microsoft Windows Server 2008, Microsoft Windows Server 2008 R2, Microsoft Windows 7 и Microsoft Windows 8.
  • WinCE является реализацией Windows API для Windows CE операционной системы. [Источник 5]

Мультимедиа

В рамках каждой версии Windows , начиная с Microsoft Windows 95. OSR2, Microsoft предоставила Microsoft DirectX API , — набор графических и игровых услуг, который включает в себя:

  • Direct2D — для аппаратного ускорения 2D векторной графики;
  • Direct3D — для аппаратного ускорения 3D графики;
  • DirectSound — для доступа звуковой карты низкого уровня аппаратного ускорения;
  • DirectInput — для связи с устройствами ввода, таких как джойстики и геймпады;
  • DirectPlay — многопользовательская игровая инфраструктура. Этот компонент был устаревшим DirectX 9 и Microsoft больше не рекомендует использовать его для разработки игр.

Microsoft также предоставляет несколько интерфейсов API для кодирования медиа и воспроизведения:

  • DirectShow — строит и запускает общие мультимедийные источники информации. Часто используются для визуализации в игре видео и создания медиа-плеера ( Windows Media Player базируется на нем). Но DirectShow больше не рекомендуется для разработки игр.
  • Media Foundation — новый цифровые медиа API предназначен для замены DirectShow.

Windows API

The Windows API is the name given by Microsoft to the core set of application programming interfaces available in the Microsoft Windows operating systems. It is designed for usage by C/C++ programs and is the most direct way to interact with a Windows system for software applications. Lower level access to a Windows system, mostly required for device drivers, is provided by the Windows Driver Model in current versions of Windows.

A software development kit (SDK) is available for Windows, which provides documentation and tools to enable developers to create software using the Windows API and associated Windows technologies.

Contents

Overview of the Windows API Components

The functionality provided by the Windows API can be grouped into seven categories:

Base Services Provide access to the fundamental resources available to a Windows system. Included are things like file systems, devices, processes and threads, access to the Windows registry, and error handling. These functions reside in kernel.exe, krnl286.exe or krnl386.exe files on 16-bit Windows, and kernel32.dll and advapi32.dll on 32-bit Windows. Graphics Device Interface Provide the functionality for outputting graphical content to monitors, printers and other output devices. It resides in gdi.exe on 16-bit Windows, and gdi32.dll on 32-bit Windows. User Interface Provides the functionality to manage windows and most basic controls, such as buttons and scrollbars, receive mouse and keyboard input, and other functionality associated with the GUI part of Windows. This functional unit resides in user.exe on 16-bit Windows, and user32.dll on 32-bit Windows. Since Windows XP, the basic controls reside in comctl32.dll, together with the common controls. Common Dialog Box Library Provides applications the standard dialog boxes for opening and saving files, choosing color and font, etc. The library resides in a file called commdlg.dll on 16-bit Windows, and comdlg32.dll on 32-bit Windows. It is grouped under the User Interface category of the API. Common Control Library Gives applications access to some advanced controls provided by the operating system. These include things like status bars, progress bars, toolbars and tabs. The library resides in a DLL file called commctrl.dll on 16-bit Windows, and comctl32.dll on 32-bit Windows. It is grouped under the User Interface category of the API. Windows Shell Component of the Windows API allows applications to access the functionality provided by the operating system shell, as well as change and enhance it. The component resides in shell.dll on 16-bit Windows, and shell32.dll and shlwapi.dll on 32-bit Windows. It is grouped under the User Interface category of the API. Network Services Give access to the various networking capabilities of the operating system. Its sub-components include NetBIOS, Winsock, NetDDE, RPC and many others.

Читайте также:  Проверка пакетов обновления windows

The Internet Explorer web browser also exposes many APIs that are often used by applications, and as such could be considered a part of the Windows API. Internet Explorer has been an integrated component of the operating system since Windows 98, and provides web related services to applications. The integration will stop with Windows Vista. Specifically, it provides:

  • An embeddable web browser control, contained in shdocvw.dll and mshtml.dll.
  • The URL monikers service, held in urlmon.dll, which provides COM objects for applications to resolving URLs. Applications can also provide their own URL handlers for others to use.
  • A library for assisting with multi-language and international text support (mlang.dll).
  • DirectX Transforms, a set of image filter components.
  • XML support (the MSXML components).
  • Access to the Windows Address Book.

Microsoft provide the DirectX set of APIs as part of every Windows installation. DirectX provides a loosely related set of multimedia and gaming services, including:

  • Direct3D as an alternative to OpenGL for access to 3D acceleration hardware.
  • DirectDraw for hardware accelerated access to the 2D frame-buffer. This component has been deprecated as of DirectX 9.
  • DirectSound for low level hardware accelerated sound card access.
  • DirectInput for communication with input devices such as joysticks and gamepads.
  • DirectPlay as a multiplayer gaming infrastructure. This component has been deprecated as of DirectX 9 and Microsoft no longer recommends its use for game development.
  • DirectShow which builds and runs generic multimedia pipelines. It is comparable to the GStreamer framework and is often used to render in-game videos and build media players (Windows Media Player is based upon it). DirectShow is no longer recommended for game development.
  • DirectMusic

Besides DirectX, there is a classic API contained in mmsystem.dll (since Windows 3.1) or winmm.dll (Win32). It supports both a high-level API (function names starting with mci) and some low-level APIs (most often used: functions starting with wave). Starting with Windows 95, low-level wave output of multiple applications will be mixed by the system, whereas Windows 3.x granted exclusive access to wave-output hardware to one process only.

APIs for interaction between programs

The Windows API mostly concerns itself with the interaction between the Operating System and an application. For communication between the different Windows applications among themselves, Microsoft has developed a series of technologies alongside the main Windows API. This started out with Dynamic Data Exchange (DDE), which was superseded by Object Linking and Embedding (OLE) and later by the Component Object Model (COM).

Wrapper Libraries

Various wrappers were developed by Microsoft that took over some of the more low level functions of the Windows API, and allowed applications to interact with the API in a more abstract manner. Microsoft Foundation Classes (MFC) wrapped Windows API functionality in C++ classes, and thus allows a more object oriented way of interacting with the API. The Active Template Library (ATL) is a template oriented wrapper for COM. The Windows Template Library (WTL) was developed as an extension to ATL, and intended as a lightweight alternative to MFC.

Also notable are some of Borland’s offerings. Object Windows Library (OWL) was released as a competing product to MFC, and offered a similar object-oriented wrapper. Borland later deprecated it in favour of the Visual Component Library (VCL).

History

The Windows API has always exposed a large part of the underlying structure of the various Windows systems for which it has been built to the programmer. This has had the advantage of giving Windows programmers a great deal of flexibility and power over their applications. However, it also has given Windows applications a great deal of responsibility in handling various low-level, sometimes tedious, operations that are associated with a Graphical user interface.

Charles Petzold, writer of various well read Windows API books, has said:

The original hello-world program in the Windows 1.0 SDK was a bit of a scandal. HELLO.C was about 150 lines long, and the HELLO.RC resource script had another 20 or so more lines. (. ) Veteran C programmers often curled up in horror or laughter when encountering the Windows hello-world program.

A hello world program is a frequently used programming example, usually designed to show the easiest possible application on a system that can actually do something (i.e. print a line that says «Hello World»). Today (using current a recent Win32 API), the hello world file size is approximately 80 lines long, while in other programming languages like Java and generic C++, it nears 5 [Wikipedia ].

Over the years, various changes and additions were made to the Windows Operating System, and the Windows API changed and grew to reflect this. The Windows API for Windows 1.0 supported fewer than 450 function calls, where in modern versions of the Windows API there are thousands. However, in general, the interface remained fairly consistent, and an old Windows 1.0 application will still look familiar to a programmer who is used to the modern Windows API.

A large emphasis has been put by Microsoft on maintaining software backwards compatibility. To achieve this, Microsoft sometime even went as far as supporting software that was using the API in a undocumented or even (programmatically) illegal way. Raymond Chen, a Microsoft developer who works on the Windows API, has said that he:

could probably write for months solely about bad things apps do and what we had to do to get them to work again (often in spite of themselves). Which is why I get particularly furious when people accuse Microsoft of maliciously breaking applications during OS upgrades. If any application failed to run on Windows 95, I took it as a personal failure.

— Raymond Chen, What about BOZOSLIVEHERE and TABTHETEXTOUTFORWIMPS?

One of the largest changes the Windows API underwent was the transition from Win16 (shipped in Windows 3.1 and older) to Win32 (Windows NT and Windows 95 and up). While Win32 was originally introduced with Windows NT 3.1 and Win32s allowed usage of a Win32 subset before Windows 95, it was not until Windows 95 that many applications began being ported to Win32. To ease the transition, in Windows 95, both for external developers and for Microsoft itself, a complex scheme of API thunks was used that could allow 32 bit code to call into 16 bit code and (in limited cases) vice-versa. So-called flat thunks allowed 32 bit code to call into 16 bit libraries, and the scheme was used extensively inside Windows 95 to avoid porting the whole OS to Win32 itself in one chunk. In Windows NT, the OS was pure 32-bit (except the parts for compatibility with 16-bit applications) and the only thunk available was generic thunks which only thunks from Win16 to Win32 and worked in Windows 95 too. The Platform SDK shipped with a compiler that could produce the code necessary for these thunks.

Читайте также:  Exchange mail from linux

Versions

Almost every new version of Microsoft Windows has introduced its own additions and changes to the Windows API. The name of the API however was kept consistent between different Windows version, and name changes were kept limited to major architectural and platform changes for Windows. Microsoft eventually changed the name of the then current Win32 API family into Windows API, and made it into a catch-all term for both past and future versions of the API.

  • Win16 was the API for the first, 16-bit versions of Microsoft Windows. These were initially referred to as simply the Windows API, but were later renamed to Win16 in an effort to distinguish it from the newer, 32-bit version of the Windows API. The functions of Win16 API mainly reside in the core files of the OS: kernel.exe (or krnl286.exe or krnl386.exe), user.exe and gdi.exe. Despite the file extension of exe, these actually are dynamically linked libraries.
  • Win32 is the 32-bitAPI for modern versions of Windows. The API consists of functions implemented, as with Win16, in system DLLs. The core DLLs of Win32 are kernel32.dll, user32.dll, and gdi32.dll. Win32 was introduced with Windows NT. The version of Win32 that was shipped with Windows 95 was initially referred to as Win32c, with the ‘c’ standing for ‘compatibility’, but this term was later abandoned by Microsoft in favour of Win32. In Windows NT and its successors (including all modern Windows versions), Win32 calls are executed by two modules, csrss.exe (Client/Server Runtime Server Subsystem) in user mode and win32k.sys in kernel mode.
  • Win32s is an extension for the Windows 3.1x family of Microsoft Windows that implemented a subset of the Win32 API for these systems. The ‘s’ stands for ‘subset’.
  • Win32 for 64-bit Windows, previously known as Win64, is the version of the API targeted for 64-bit versions of Windows — namely, Windows XP Professional x64 Edition and Windows Server 2003 x64 Edition (for AMD64 processors) and Windows XP 64-bit Edition and Windows Server 2003 for Itanium-series. The 64-bit versions are just two more supported platforms within Windows NT architecture so both 32-bit and 64-bit versions of an application can still be compiled from single code base. All memory pointers are 64-bit by default though, so the source code has to be checked for compatibility with 64-bit pointer arithmetic and rewritten as necessary. There are no new functions specific to 64-bit versions of Windows.
  • WinFX is a new object oriented API, that «embraces and extends» the Microsoft .NET platform. It is designed to give software applications access to the full range of features available in Windows Vista. Like .NET applications, WinFX applications will run as so-called managed code on the Common Language Runtime, a virtual machine that runs on top of the Windows API. The GUI API set for WinFX is called the Windows Presentation Foundation and requires high-end graphics cards to properly render some effects.

Other implementations

Although Microsoft’s implementation of the Windows API is copyrighted, it is generally accepted that other vendors can emulate Windows by providing an identical API, without breaching copyright.

The Wine project is an attempt to provide a Win32 API Compatibility layer for Unix-like platforms. ReactOS goes a step further and provides an emulation of the entire Windows operating system, working closely with the Wine project to promote code re-use and compatibility.

The Mono Project implements much of the .NET Framework and the C# programming language.

Compiler support

To develop software that utilizes the Windows API, a compiler must be able to handle and import the Microsoft-specific DLLs and COM-objects. The compiler must accept a C or C++ language dialect and handle IDL (interface definition language) files and header files that expose the interior API function names. Collectively, these prerequisites (compilers, tools, libraries, and headers) are known as the Windows Platform SDK. For a long time the proprietary Microsoft Visual Studio family of compilers and tools and Borland’s compilers were the only tools that could provide this (although at least in the case of Windows, the SDK itself is downloadable for free separately from the entire IDE suite, from Microsoft Platform SDK Update). Nowadays the MinGW and Cygwin projects also provide such an environment based on the GNU Compiler Collection, using a stand-alone header file collection to make linking against Microsoft DLLs possible. LCC-Win32 is a «free for non-commercial use» C compiler maintained by Jacob Navia (a comp.lang.c regular). Masm32 is a mature project to support the Windows API utilizing the 32 bit Microsoft assembler with custom made or converted headers and libraries from the Platform SDK.

Windows specific compiler support is also required for the Structured Exception Handling feature (SEH). This system serves a dual purpose: it provides a substrate upon which language-specific exception handling can be implemented, and it is how the kernel notifies applications of exceptional conditions such as dereferencing an invalid pointer or stack overflow. The Microsoft/Borland C++ compilers had the ability to use this system as soon as it was introduced in Windows 95 and NT, however the actual implementation was undocumented and had to be reverse engineered for the Wine project and free compilers. SEH is based on pushing exception handler frames onto the stack, then adding them to a linked list stored in thread local storage (the first field of the thread environment block). When an exception is thrown, the kernel and base libraries unwind the stack running handlers and filters as they are encountered. Eventually, every exception unhandled by the application itself will be dealt with by the default backstop handler which pops up the Windows common crash dialog.

Example of API implementation in Visual Basic: (this shortened example causes the Command button to be able to be moved around on the form by the user)

Оцените статью