ReactOS 0.4.16-dev-297-gc569aee
terminate.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <eh.h>
Include dependency graph for terminate.cpp:

Go to the source code of this file.

Classes

struct  C< T1, T2 >
 

Functions

int Test ()
 
void Bar (void)
 
void Test2 (void)
 
void __cdecl Terminate2 (void)
 
void __cdecl Terminate1 (void)
 
int main (void)
 

Variables

int FGenSEHException
 

Function Documentation

◆ Bar()

◆ main()

int main ( void  )

Definition at line 100 of file terminate.cpp.

101{
102 int i;
103
104 // First check that we don't terminate on an SEH exception
106 __try
107 {
108 i = Test();
109 }
110 __except (1)
111 {
112 printf("caught SEH exception in %s\n", __FUNCTION__);
113 }
114
115 // Now set our own terminate handler and throw a C++ EH exception
118 i = Test();
119
120 // Should never get here
121 printf("termination handler not called\n");
122 return i;
123}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_CRTIMP terminate_function __cdecl set_terminate(terminate_function _NewPtFunc)
int Test()
Definition: terminate.cpp:43
void __cdecl Terminate1(void)
Definition: terminate.cpp:90
int FGenSEHException
Definition: terminate.cpp:21

◆ Terminate1()

void __cdecl Terminate1 ( void  )

Definition at line 90 of file terminate.cpp.

91{
92 printf("termination handler (%s) called\n", __FUNCTION__);
93
94 // Set a new handler and run a second C++ EH test case.
96 Test2();
97 exit(0);
98}
void Test2(void)
Definition: terminate.cpp:76
void __cdecl Terminate2(void)
Definition: terminate.cpp:84
#define exit(n)
Definition: config.h:202

Referenced by main().

◆ Terminate2()

void __cdecl Terminate2 ( void  )

Definition at line 84 of file terminate.cpp.

85{
86 printf("termination handler (%s) called\n", __FUNCTION__);
87 exit(0);
88}

Referenced by Terminate1().

◆ Test()

int Test ( )

Definition at line 43 of file terminate.cpp.

44{
45 try
46 {
47 C c;
48 throw 1;
49 }
50 catch (int)
51 {
52 printf("Destructor was not invoked \n");
53 }
54 catch (char)
55 {
56 printf("Destructor exited using an exception\n");
57 }
58#if 0
59 catch (...)
60 {
61 printf("Throw caught by wrong handler\n");
62 }
63#endif
64
65 printf("terminate() was not called\n");
66
67 return 1;
68}
Definition: terminate.cpp:24
#define c
Definition: ke_i.h:80

Referenced by main().

◆ Test2()

void Test2 ( void  )

Definition at line 76 of file terminate.cpp.

77{
78 printf("in %s\n", __FUNCTION__);
79 C c;
80 Bar();
81 return;
82}
void Bar(void)
Definition: terminate.cpp:70

Referenced by InitTests(), MainWndProc(), SymlinkCreateTests(), and Terminate1().

Variable Documentation

◆ FGenSEHException

int FGenSEHException

Definition at line 21 of file terminate.cpp.

Referenced by main(), and C< T1, T2 >::~C().