Possible Duplicate:
Weird MSC 8.0 error: “The value of ESP was not properly saved across a function call…”
I have an OBJ file for which I don't have any soure code. I have used it in another project without any problems. Now I am trying to use it in another project. Here is the way I declare it:
extern "C" bool FileCompare(char* file1, char* file2);
I use it in a function like this:
void myFunction() {
//some code
FileCompare(file1, file2); // file1 and 2 are char arrays
}
Then in my main code I call myFunction:
int main() {
... some code
myFunction()
}
When myFunction returns I get "The value of ESP was not properly saved across a function call." in Visual Studio 2010 debugger. However, I know for a fact that FileCompares (the function in the obj file) does its job. When I comment it out everything works fine. I have used this OBJ file in the past without any problems. Considering I don't have the source of the obj file, is there anything I can do to try to "patch" this problem?
Thank you very much
More details: I suspect that the code uses CALL without RET (its written in assembly).
EDIT: I don't know if what I say makes sense the way things work, but since the function corrupts the esp is there anyway to save it and restore it after the function returns?