if (de.dwDebugEventCode == EXIT_PROCESS_DEBUG_EVENT)
{
break; // debugee 结束
}
else if (de.dwDebugEventCode == CREATE_PROCESS_DEBUG_EVENT)
{
// Handle to the process's image file
CloseHandle(de.u.CreateProcessInfo.hFile);
// Handle to the process
CloseHandle(de.u.CreateProcessInfo.hProcess);
// Handle to the initial thread of the process identified by the hProcess member
CloseHandle(de.u.CreateProcessInfo.hThread);
}
else if (de.dwDebugEventCode == CREATE_THREAD_DEBUG_EVENT)
{
// Handle to the thread whose creation caused the debugging event
CloseHandle(de.u.CreateThread.hThread);
}
else if (de.dwDebugEventCode == LOAD_DLL_DEBUG_EVENT)
{
// Handle to the loaded DLL
CloseHandle(de.u.LoadDll.hFile);
}
else if (de.dwDebugEventCode == EXCEPTION_DEBUG_EVENT)
{
dwExceptionNum++; // 第一次异常需要注意
if (dwExceptionNum == 1) dwContinueStatus = DBG_CONTINUE;
}
...