Article ID: 822039 - View products that this article applies to.
When you run the debug build of your application with the /RTCs compiler option enabled, you may receive the following exception error message:
You receive this error message when the following conditions are true:
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
When you pass a parameter that is 64 KB or larger to a function that does not use the __cdecl modifier, the compiler generates incorrect code. When the function that is called tries to return control to the calling function, the compiler triggers the error that is mentioned in the "Symptoms" section. The compiler generates a 16-bit immediate return (RET) that has an operand that is limited to 64 KB. If the parameters that are passed to the function are larger than 64 KB, the stack becomes corrupted when the function returns.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Steps to reproduce the behavior
For more information, visit the following Microsoft Developer Network (MSDN) Web sites:
/RTC (Run-time error checks)
Contact us for more help
Connect with Answer Desk for expert help.