错误信息是 i386\chkesp.c的42行,具体如下:
The value of ESP was not properly saved across a funtion call.This is usually a result of calling a funciton declared with one calling convention with a function pointer declared with a different calling convention.

解决方案 »

  1.   

    如果调用和返回正常的话,那么调用前后栈指针应该不变现在变化了,说明不正常提示中所说的calling convention 问题是最常见的一个原因
      

  2.   

    __cdeclThis is the default calling convention for C and C++ programs. Because the stack is cleaned up by the caller, it can do vararg functions. The __cdecl calling convention creates larger executables than __stdcall, because it requires each function call to include stack cleanup code. The following list shows the implementation of this calling convention.Argument-passing order: Right to left 
    Stack-maintenance responsibility: Calling function pops the arguments from the stack ==========__fastcallThe __fastcall calling convention specifies that arguments to functions are to be passed in registers, when possible. The following list shows the implementation of this calling conventionArgument-passing order: The first two DWORD or smaller arguments are passed in ECX and EDX registers; all other arguments are passed right to left. Stack-maintenance responsibility: Called function pops the arguments from the stack. =========__stdcallThe __stdcall calling convention is used to call Win32 API functions. The callee cleans the stack, so the compiler makes vararg functions __cdecl. Functions that use this calling convention require a function prototype. The following list shows the implementation of this calling convention.Argument-passing order: Right to left. 
    Argument-passing convention: By value, unless a pointer or reference type is passed. 
    Stack-maintenance responsibility: Called function pops its own arguments from the stack 
      

  3.   

    打开call stacks,看看程序错在哪一句。
      

  4.   

    可能的情况之一是:比如dll的函数可能为__stdcall,而你在调用的时候用了一个(默认)为__cdecl的函数(指针)