HOME

TheInfoList



OR:

The Windows API, informally WinAPI, is the foundational application programming interface (API) that allows a
computer program A computer program is a sequence or set of instructions in a programming language for a computer to Execution (computing), execute. It is one component of software, which also includes software documentation, documentation and other intangibl ...
to access the features of the
Microsoft Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
in which the program is running. Programs can access API functionality via shared-library technologies or via system-file access. Each major version of the Windows API has a distinct name that identifies a compatibility aspect of that version. For example, Win32 is the major version of Windows API that runs on 32-bit systems. The name, Windows API, collectively refers to all versions of this capability of Windows. Microsoft provides developer support via a software development kit, Microsoft Windows SDK, which includes documentation and tools for building software based on the Windows API.


Services

This section lists notable services provided by the Windows API.


Base Services

Base services include features such as the file system, devices, processes, threads, and error handling. These functions reside in kernel.exe, krnl286.exe or krnl386.exe files on 16-bit Windows, and kernel32.dll and KernelBase.dll on 32 and 64 bit Windows. These files reside in the folder \Windows\System32 on all versions of Windows. Microsoft Developer Network (July 2005).
Base Services.
' Retrieved August 28, 2005.


Advanced Services

Advanced services include features beyond the kernel like the
Windows registry The Windows Registry is a hierarchical database that stores low-level settings for the Microsoft Windows operating system and for applications that opt to use the registry. The kernel, device drivers, services, Security Accounts Manager, a ...
, shutdown/restart the system (or abort), start/stop/create a
Windows service In Windows NT operating systems, a Windows service is a computer program that operates in the background. It is similar in concept to a Unix daemon. A Windows service must conform to the interface rules and protocols of the Service Control Manag ...
, manage user accounts. These functions reside in advapi32.dll and advapires32.dll on 32-bit Windows.


Graphics Device Interface

The
Graphics Device Interface The Graphics Device Interface (GDI) is a legacy component of Microsoft Windows responsible for representing graphical objects and transmitting them to output devices such as monitors and printers. It was superseded by DirectDraw API and later ...
(GDI) component provides features to output graphics content to monitors, printers, and other
output device An output device is any piece of computer hardware that converts information or data into a human-perceptible form or, historically, into a physical machine-readable form for use with other non-computerized equipment. It can be text, graphics, ta ...
s. It resides in gdi.exe on 16-bit Windows, and gdi32.dll on 32-bit Windows in user-mode. Kernel-mode GDI support is provided by win32k.sys which communicates directly with the graphics driver. Microsoft Developer Network (July 2005).
Graphics Device Interface.
' Retrieved August 28, 2005.


User Interface

The
User Interface In the industrial design field of human–computer interaction, a user interface (UI) is the space where interactions between humans and machines occur. The goal of this interaction is to allow effective operation and control of the machine fro ...
component provides features to create and manage screen
windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
and most basic controls, such as buttons and
scrollbar A scrollbar is an interaction technique or widget (GUI), widget in which continuous text, pictures, or any other content can be Scrolling, scrolled in a predetermined direction (up, down, left, or right) on a computer display, window (computing) ...
s, receive mouse and keyboard input, and other functions associated with the
graphical user interface A graphical user interface, or GUI, is a form of user interface that allows user (computing), users to human–computer interaction, interact with electronic devices through Graphics, graphical icon (computing), icons and visual indicators such ...
(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 Windows XP is a major release of Microsoft's Windows NT operating system. It was released to manufacturing on August 24, 2001, and later to retail on October 25, 2001. It is a direct successor to Windows 2000 for high-end and business users a ...
versions, the basic controls reside in comctl32.dll, together with the common controls (Common Control Library). Microsoft Developer Network (July 2005).
User Interface.
' Retrieved August 28, 2005.


Common Dialog Box Library

The Common Dialog Box Library provides standard
dialog box In computing, a dialog box (also simply dialog) is a graphical control element in the form of a small window that communicates information to the user and prompts them for a response. Dialog boxes are classified as " modal" or "modeless", dep ...
es to open and save files, choose 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. Microsoft Developer Network (2005).
Common Dialog Box Library.
' Retrieved September 22, 2005.


Common Control Library

The Common Control Library provides access to advanced user interface controls, including 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. Microsoft Developer Network (July 2005).
Common Control Library.
' Retrieved August 28, 2005.


Windows Shell

The Windows Shell component provides access to the operating system shell. The component resides in shell.dll on 16-bit Windows, and shell32.dll on 32-bit Windows. The Shell Lightweight Utility Functions are in shlwapi.dll. It is grouped under the ''User Interface'' category of the API. Microsoft Developer Network (July 2005).
Windows Shell.
' Retrieved August 28, 2005.
Microsoft Developer Network (2005).
Shell Programmer's Guide.
' Retrieved August 28, 2005.


Network Services

Network Services provide access to the various networking abilities of the operating system. Its subcomponents include NetBIOS, Winsock, NetDDE,
remote procedure call In distributed computing, a remote procedure call (RPC) is when a computer program causes a procedure (subroutine) to execute in a different address space (commonly on another computer on a shared computer network), which is written as if it were a ...
(RPC) and many more. This component resides in netapi32.dll on 32-bit Windows. Microsoft Developer Network (July 2005).
Network Services.
' Retrieved August 28, 2005.


Web

The
Internet Explorer Internet Explorer (formerly Microsoft Internet Explorer and Windows Internet Explorer, commonly abbreviated as IE or MSIE) is a deprecation, retired series of graphical user interface, graphical web browsers developed by Microsoft that were u ...
(IE) web browser exposes APIs and as such could be considered part of the Windows API. IE has been included with the operating system since Windows 95 OSR2 and has provided web-related services to applications since
Windows 98 Windows 98 is a consumer-oriented operating system developed by Microsoft as part of its Windows 9x family of Microsoft Windows operating systems. It was the second operating system in the 9x line, as the successor to Windows 95. It was Software ...
. Microsoft Developer Network (January 2006);
Programming and reusing the browser
' Retrieved January 22, 2006.


Program interaction

The Windows API is a C language-based API. Functions and data structures are consumable via C syntax by including windows.h, but the API can be consumed via any programming language that can inter-operate with the API data structures and calling conventions for function calls and callbacks. Of note, the implementation of API functions has been developed in several languages other than C. Despite the fact that C is not an
object-oriented programming Object-oriented programming (OOP) is a programming paradigm based on the concept of '' objects''. Objects can contain data (called fields, attributes or properties) and have actions they can perform (called procedures or methods and impl ...
(OOP) language, the Windows API is somewhat object-oriented due to its use of handles. Various other technologies from Microsoft and others make this object-oriented aspect more apparent by using an OOP language such as C++ — see
Microsoft Foundation Class Library Microsoft Foundation Class Library (MFC) is a C++ object-oriented library for developing desktop applications for Windows. MFC was introduced by Microsoft in 1992 and quickly gained widespread use. While Microsoft has introduced alternative a ...
(MFC),
Visual Component Library The Visual Component Library (VCL) is a visual component-based object-oriented framework for developing the user interface of Microsoft Windows applications. It is written in Object Pascal. History The VCL was developed by Borland for use i ...
(VCL), GDI+. Of note,
Windows 8 Windows 8 is a major release of the Windows NT operating system developed by Microsoft. It was Software release life cycle#Release to manufacturing (RTM), released to manufacturing on August 1, 2012, made available for download via Microsoft ...
provides the Windows API and the WinRT API, which is implemented in C++ and is object-oriented by design. Windows.pas is a
Delphi Delphi (; ), in legend previously called Pytho (Πυθώ), was an ancient sacred precinct and the seat of Pythia, the major oracle who was consulted about important decisions throughout the ancient Classical antiquity, classical world. The A ...
unit that exposes the features of Windows API the Pascal equivalent of windows.h.


Related technologies

Many Microsoft technologies use the Windows API -- as most software running on Windows does. As middle-ware between Windows API and an application, the following technologies provide some access to Windows API. Some technologies are described as wrapping Windows API, but this is debatable since they don't provide or expose all of the capabilities of Windows API. *
Microsoft Foundation Class Library Microsoft Foundation Class Library (MFC) is a C++ object-oriented library for developing desktop applications for Windows. MFC was introduced by Microsoft in 1992 and quickly gained widespread use. While Microsoft has introduced alternative a ...
(MFC) exposes some of Windows API functionality in C++ classes, and thus allows a more object-oriented way to interact with the API * Active Template Library (ATL) is a C++ template library that provides some Windows API access * Windows Template Library (WTL) was developed as an extension to ATL, and intended as a smaller alternative to MFC * Most
application framework In computer programming, an application framework consists of a software framework used by software developers to implement the standard structure of application software. Application frameworks became popular with the rise of graphical user inte ...
s for Windows provide some access to Windows API; including .NET runtime and
Java virtual machine A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally descr ...
and any other
programming language A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
s targeting Windows * Various technologies for communicating between components and applications starting with Dynamic Data Exchange (DDE), which was superseded by Object Linking and Embedding (OLE) and later by the
Component Object Model Component Object Model (COM) is a binary-interface technology for software components from Microsoft that enables using objects in a language-neutral way between different programming languages, programming contexts, processes and machines ...
(COM), Automation Objects,
ActiveX ActiveX is a deprecated software framework created by Microsoft that adapts its earlier Component Object Model (COM) and Object Linking and Embedding (OLE) technologies for content downloaded from a network, particularly from the World Wide W ...
controls, and the .NET Framework Although almost all Windows programs use the Windows API, on the Windows NT line of operating systems, programs that start early in the
Windows startup process The booting process of Microsoft Windows varies between different releases. DOS-based Windows Windows 1.x/2.x In Windows versions 1.01 to Windows 2.11, the system was loaded when WIN.COM was executed within MS-DOS. It then loaded WIN100.BIN ...
use the Native API instead.


History

The Windows API has always exposed a large part of the underlying structure of the Windows systems to programmers. This had the advantage of giving them much flexibility and power over their applications, but also creates great responsibility in how applications handle various low-level, sometimes tedious, operations that are associated with a
graphical user interface A graphical user interface, or GUI, is a form of user interface that allows user (computing), users to human–computer interaction, interact with electronic devices through Graphics, graphical icon (computing), icons and visual indicators such ...
. For example, a beginning C programmer will often write the simple "hello world" as their first assignment. The working part of the program is only a single printf line within the main subroutine. The overhead for linking to the standard I/O library is also only one line: #include int main(void) Charles Petzold, who wrote several books about programming for the Windows API, 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 programmers often curled up in horror or laughter when encountering the Windows hello-world program." Charles Petzold (December 2001). ''Programming Microsoft Windows with C#''. Microsoft Press. Beyond the Console, page 47. Petzold explains that while it was the first Windows sample programs developers were introduced to, it was quite "fancy" and more complex than needed. Tired of people ridiculing the length of the sample, he eventually reduced it to a simple MessageBox call. Over the years, various changes and additions were made to Windows systems, and the Windows API changed and grew to reflect this.
Detailed analysis of changes in the Windows API from XP to 10.
' Retrieved September 08, 2016.
The Windows API for Windows 1.0 supported fewer than 450 function calls, whereas modern versions of the Windows API support 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. Charles Petzold (November 11, 1998). ''Programming Windows, Fifth Edition''. Microsoft Press. APIs and Memory Models, page 9. Microsoft has made an effort to maintain
backward compatibility In telecommunications and computing, backward compatibility (or backwards compatibility) is a property of an operating system, software, real-world product, or technology that allows for interoperability with an older legacy system, or with Input ...
. To achieve this, when developing new versions of Windows, Microsoft sometimes implemented workarounds to allow compatibility with third-party software that used the prior version in an undocumented or even inadvisable way. Raymond Chen, a Microsoft developer who works on the Windows API, has said: "I 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 (October 15, 2003).
What about BOZOSLIVEHERE and TABTHETEXTOUTFORWIMPS?
' Retrieved June 29, 2022.
One of the largest changes to the Windows API 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 Win32s is a 32-bit application runtime environment for the Microsoft Windows 3.1 and 3.11 operating systems. It allowed some 32-bit applications to run on the 16-bit operating system using call thunks. A beta version of Win32s was available in ...
allowed use of a Win32 subset before Windows 95, it was not until Windows 95 that widespread porting of applications to Win32 began. To ease the transition, in Windows 95, for developers outside and inside Microsoft, a complex scheme of API thunks was used that could allow 32-bit code to call into 16-bit code (for most of Win16 APIs) and vice versa. ''Flat thunks'' allowed 32-bit code to call into 16-bit libraries, and the scheme was used extensively inside Windows 95's libraries to avoid porting the whole OS to Win32 in one batch. In Windows NT, the OS was pure 32-bit, except parts for compatibility with 16-bit applications, and only generic thunks were available to thunk from Win16 to Win32, as for Windows 95. The Platform SDK shipped with a compiler that could produce the code needed for these thunks. Versions of 64-bit
Windows Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
are also able to run 32-bit applications via WoW64. The SysWOW64 folder located in the Windows folder on the OS drive contains several tools to support 32-bit applications.


Major versions

Each version of Microsoft Windows contains a version of Windows API, and almost every new version of Microsoft Windows has introduced additions and changes to the Windows API.The Iseran Project (1996–2001).
History of the Windows API.
' Retrieved October 7, 2005.
The name, Windows API, refers to essentially the same capability in each version of Windows, but there is another name for this capability that is based on major architectural aspects of the Windows version that contains it. When there was only one version, it was simply called Windows API. Then, when the first major update was made, Microsoft gave it the name Win32 and gave the first version the name Win16. The term Windows API refers to both versions and all subsequently developed major versions. Microsoft Developer Network (July 2005).
Overview of the Windows API.
' Retrieved August 28, 2005.
* Win16 is in the
16-bit 16-bit microcomputers are microcomputers that use 16-bit microprocessors. A 16-bit register can store 216 different values. The range of integer values that can be stored in 16 bits depends on the integer representation used. With the two ...
versions of Windows. The functions reside mainly in core files of the OS: ''kernel.exe'' (or ''krnl286.exe'' or ''krnl386.exe''), ''user.exe'' and ''gdi.exe''. Despite the file extension of exe, such a file is accessed as a DLL. * Win32 is in the
32-bit In computer architecture, 32-bit computing refers to computer systems with a processor, memory, and other major system components that operate on data in a maximum of 32- bit units. Compared to smaller bit widths, 32-bit computers can perform la ...
versions of Windows (NT, 95, and later). The functions are implemented in system DLL files including kernel32.dll, user32.dll, and gdi32.dll. Win32 was introduced with
Windows NT Windows NT is a Proprietary software, proprietary Graphical user interface, graphical operating system produced by Microsoft as part of its Windows product line, the first version of which, Windows NT 3.1, was released on July 27, 1993. Original ...
. In
Windows 95 Windows 95 is a consumer-oriented operating system developed by Microsoft and the first of its Windows 9x family of operating systems, released to manufacturing on July 14, 1995, and generally to retail on August 24, 1995. Windows 95 merged ...
, it was initially referred to as Win32c, with ''c'' meaning ''compatibility''. This term was later abandoned by Microsoft in favor of Win32. *
Win32s Win32s is a 32-bit application runtime environment for the Microsoft Windows 3.1 and 3.11 operating systems. It allowed some 32-bit applications to run on the 16-bit operating system using call thunks. A beta version of Win32s was available in ...
is an extension for the Windows 3.1x family of Microsoft Windows that implemented a
subset In mathematics, a Set (mathematics), set ''A'' is a subset of a set ''B'' if all Element (mathematics), elements of ''A'' are also elements of ''B''; ''B'' is then a superset of ''A''. It is possible for ''A'' and ''B'' to be equal; if they a ...
of the Win32 API for these systems. The "s" stands for "subset". * Win64 is the version in the 64-bit platforms of the Windows architecture (,
x86-64 x86-64 (also known as x64, x86_64, AMD64, and Intel 64) is a 64-bit extension of the x86 instruction set architecture, instruction set. It was announced in 1999 and first available in the AMD Opteron family in 2003. It introduces two new ope ...
and
AArch64 AArch64, also known as ARM64, is a 64-bit version of the ARM architecture family, a widely used set of computer processor designs. It was introduced in 2011 with the ARMv8 architecture and later became part of the ARMv9 series. AArch64 allows ...
). Both 32-bit and 64-bit versions of an application can be compiled from one
codebase In software development, a codebase (or code base) is a collection of source code used to build a particular software system, application, or software component. Typically, a codebase includes only human-written source code system files; thu ...
, although some older API functions have been deprecated, and some of the API functions that were deprecated in Win32 were removed. All memory pointers are 64-bit by default (the LLP64 model), so porting Win32-compatible source code includes updating for 64-bit pointer arithmetic. * WinCE is the version in the Windows CE operating system.


Other implementations

The
Wine Wine is an alcoholic drink made from Fermentation in winemaking, fermented fruit. Yeast in winemaking, Yeast consumes the sugar in the fruit and converts it to ethanol and carbon dioxide, releasing heat in the process. Wine is most often made f ...
project provides a Win32 API
compatibility layer In software engineering, a compatibility layer is an interface that allows binaries for a legacy or foreign system to run on a host system. This translates system calls for the foreign system into native system calls for the host system. With s ...
for
Unix-like A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
platforms, between Linux kernel API and programs written for the Windows API.
ReactOS ReactOS is a Free and open-source software, free and open-source operating system for i586/amd64 personal computers that is intended to be binary-code compatibility, binary-compatible with computer programs and device drivers developed for Wind ...
goes a step further and aims to implement the full Windows operating system, working closely with the Wine project to promote code re-use and compatibility. DosWin32 and HX DOS Extender are other projects which emulate the Windows API to allow executing simple Windows programs from a DOS command line.
Odin Odin (; from ) is a widely revered god in Norse mythology and Germanic paganism. Most surviving information on Odin comes from Norse mythology, but he figures prominently in the recorded history of Northern Europe. This includes the Roman Em ...
is a project to emulate Win32 on
OS/2 OS/2 is a Proprietary software, proprietary computer operating system for x86 and PowerPC based personal computers. It was created and initially developed jointly by IBM and Microsoft, under the leadership of IBM software designer Ed Iacobucci, ...
, superseding the original Win-OS/2 emulation which was based on Microsoft code. Other minor implementations include the MEWEL and
Zinc Zinc is a chemical element; it has symbol Zn and atomic number 30. It is a slightly brittle metal at room temperature and has a shiny-greyish appearance when oxidation is removed. It is the first element in group 12 (IIB) of the periodic tabl ...
libraries which were intended to implement a subset of the Win16 API on DOS (see List of platform-independent GUI libraries). Windows Interface Source Environment (WISE) was a licensing program from Microsoft which allowed developers to recompile and run Windows-based applications on
Unix Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
and
Macintosh Mac is a brand of personal computers designed and marketed by Apple Inc., Apple since 1984. The name is short for Macintosh (its official name until 1999), a reference to the McIntosh (apple), McIntosh apple. The current product lineup inclu ...
platforms. WISE SDKs were based on an emulator of the Windows API that could run on those platforms.WISE
Efforts toward standardization included Sun's Public Windows Interface (PWI) for Win16 (see also: Sun Windows Application Binary Interface ( Wabi)), Willows Software's Application Programming Interface for Windows (APIW) for Win16 and Win32 (see also: Willows TWIN), and ECMA-234, which attempted to standardize the Windows API bindingly.


Compiler support

To develop software that uses the Windows API, a compiler must be able to use the Microsoft-specific DLLs listed above (COM-objects are outside Win32 and assume a certain vtable layout). The compiler must either handle the header files that expose the interior API function names, or supply such files. For the language C++, Zortech (later Symantec, then Digital Mars), Watcom and
Borland Borland Software Corporation was a computing technology company founded in 1983 by Niels Jensen, Ole Henriksen, Mogens Glad, and Philippe Kahn. Its main business was developing and selling software development and software deployment products. B ...
have all produced well-known commercial compilers that have been used often with Win16, Win32s, and Win32. Some of them supplied ''memory extenders'', allowing Win32 programs to run on Win16 with Microsoft's redistributable Win32s DLL. The Zortech compiler was probably one of the first stable and usable C++ compilers for Windows programming, before Microsoft had a C++ compiler. For certain classes of applications, the compiler system should also be able to handle interface description language (IDL) files. Collectively, these prerequisites (compilers, tools, libraries, and headers) are known as the '' Microsoft Platform SDK''. For a time, the Microsoft Visual Studio and
Borland Borland Software Corporation was a computing technology company founded in 1983 by Niels Jensen, Ole Henriksen, Mogens Glad, and Philippe Kahn. Its main business was developing and selling software development and software deployment products. B ...
's integrated development system were the only
integrated development environment An integrated development environment (IDE) is a Application software, software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, an ...
s (IDEs) that could provide this (although, the SDK is downloadable for free separately from the entire IDE suite, fro
Microsoft Windows SDK for Windows 7 and .NET Framework 4
. , the MinGW and Cygwin projects also provide such an environment based on the
GNU Compiler Collection The GNU Compiler Collection (GCC) is a collection of compilers from the GNU Project that support various programming languages, Computer architecture, hardware architectures, and operating systems. The Free Software Foundation (FSF) distributes ...
(GCC), using a stand-alone header file set, to make linking against the Win32-specific DLLs simple. LCC-Win32 is a C compiler maintained by Jacob Navia, freeware for non-commercial use. Pelles C is a freeware C compiler maintained by Pelle Orinius. Free Pascal is a
free software Free software, libre software, libreware sometimes known as freedom-respecting software is computer software distributed open-source license, under terms that allow users to run the software for any purpose as well as to study, change, distribut ...
Object Pascal Object Pascal is an extension to the programming language Pascal (programming language), Pascal that provides object-oriented programming (OOP) features such as Class (computer programming), classes and Method (computer programming), methods. T ...
compiler that supports the Windows API. The MASM32 package is a mature project providing support for the Windows API under Microsoft Macro Assembler (MASM) by using custom made or converted headers and libraries from the Platform SDK. Flat assembler FASM allows building Windows programs without using an external linker, even when running on Linux. Windows specific compiler support is also needed for Structured Exception Handling (SEH). This system serves two purposes: it provides a substrate on which language-specific
exception handling In computing and computer programming, exception handling is the process of responding to the occurrence of ''exceptions'' – anomalous or exceptional conditions requiring special processing – during the execution of a program. In general, an ...
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 In computer programming, thread-local storage (TLS) is a memory management method that uses static memory allocation, static or global computer storage, memory local to a thread (computing), thread. The concept allows storage of data that appear ...
(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 will be dealt with by the default backstop handler, which pops up the Windows common crash dialog.


See also

* * * * * *


Notes


References


External links


MSDN Windows API indexWindows API Microsoft Code SamplesECMA-234
ECMA standard for a subset of the Windows API * ews://comp.os.ms-windows.programmer.win32 Advanced Win32 API newsgroup* ews://fr.comp.os.ms-windows.programmation French Win32 API newsgroup {{GUI builders Microsoft application programming interfaces Articles with example C code