mentioned that the _penter function must compile along,
I countered another problem,
I need to use functions from other libraries in _penter function, for example
// function from dbghelp.lib
SymFromAddr(GetCurrentProcess(), dwAddr, &dwDisplacement, pSymbol);
... // save registers
... // pop registers
I have compiled this file along, event tried to compile a static library(containing dbghelp.lib).
Both way, when the program runs, SymFromAddr would trigger _penter, which causing a stack overflow.
Is there a way to told the compiler not to trigger _penter in the following function calls?