This chapter describes the prolog and epilog used with far functions in applications and dynamic-link libraries (DLLs) for the Microsoft Windows operating system. Compiler vendors can use this information to enable their compilers to generate prolog and epilog code that is suitable for Windows.
In Windows version 3.0 and earlier, the prolog and epilog for far functions must
include instructions to mark the stack frame, indicating that the frame belongs to
a far function. This makes it possible for real-mode Windows to locate segment addresses on the stack and update those addresses when it moves or discards the corresponding segments. Marking stack frames for far functions also allows
debugging applications, such as Microsoft CodeViewÒ for Windows (CVW) and Microsoft Windows 80386 Debugger (WDEB386.EXE), to display meaningful
information about the contents of an application's stack.
Marking stack frames for far functions is optional for Windows 3.1 applications. Old debugging applications that do not access TOOLHELP.DLL, however, still need marking. Debugging applications that use TOOLHELP.DLL do not require stack frames for far functions to be marked.