Here is my code:
void signalHandler(int sigNum) {
OutputDebugStringA("i'm terminated\n");
exit(sigNum);
}
int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPTSTR lpCmdLine,
_In_ int nCmdShow)
{
signal(SIGTERM, signalHandler);
while (1)
{
Sleep(100);
}
return 0;
}
when i terminated it via the windows taskmgr,that DebugString did't show up. is something wrong with my code?