Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a "Microsoft C++ exception"?

Tags:

c++

exception

This is mostly out of curiosity, but when debugging, I often see a line looking like that:

First-chance exception at 0x7583812f in MyApp.exe: Microsoft C++ exception: CTBadSupportFileException at memory location 0x039be09c..

And I wonder, why is it called a "Microsoft" C++ exception?

Is it really a normal C++ exception? What class does it derive from? Is "Microsoft C++ exception" the type of the exception, or is it a parent type from which exceptions like CTBadSupportFileException derive?

Why does the debugger log them like that?

like image 879
sashoalm Avatar asked Oct 21 '13 17:10

sashoalm


1 Answers

It is not a "Microsoft" C++ exception. It is a "Microsoft C++" exception.

When an operating system exception is raised with the RaiseException function, the caller specifies an exception code. There are some standard exception codes like 0xC00000FD for stack overflow or 0xC0000005 for access violation. But you can also raise custom exception codes, and the custom exception code used by the Microsoft C++ toolchain for all C++ exceptions is 0xE06d7363.

Note that operating system exceptions and C++ exceptions are different concepts. The message in the debugger is talking about operating system exceptions.

The debugger is doing you a courtesy and instead of reporting "Exception 0xE06d7363" it says "Microsoft C++ exception", and it even takes the extra step of decoding its parameters for you.

like image 68
Raymond Chen Avatar answered Oct 02 '22 12:10

Raymond Chen