mirror of https://github.com/x64dbg/TitanEngine
don't close process and file handles in ForceClose
This commit is contained in:
parent
ef020ed39d
commit
ab037ef1c5
|
|
@ -9,17 +9,8 @@
|
|||
__declspec(dllexport) void TITCALL ForceClose()
|
||||
{
|
||||
//manage process list
|
||||
int processcount = (int)hListProcess.size();
|
||||
for(int i = 0; i < processcount; i++)
|
||||
{
|
||||
EngineCloseHandle(hListProcess.at(i).hFile);
|
||||
EngineCloseHandle(hListProcess.at(i).hProcess);
|
||||
}
|
||||
ClearProcessList();
|
||||
//manage thread list
|
||||
int threadcount = (int)hListThread.size();
|
||||
for(int i = 0; i < threadcount; i++)
|
||||
EngineCloseHandle(hListThread.at(i).hThread);
|
||||
ClearThreadList();
|
||||
//manage library list
|
||||
int libcount = (int)hListLibrary.size();
|
||||
|
|
|
|||
|
|
@ -517,14 +517,24 @@ __declspec(dllexport) void* TITCALL InitDLLDebugW(wchar_t* szFileName, bool Rese
|
|||
|
||||
__declspec(dllexport) bool TITCALL StopDebug()
|
||||
{
|
||||
if(dbgProcessInformation.hProcess != NULL)
|
||||
bool result = false;
|
||||
HANDLE hProcess = TitanOpenProcess(PROCESS_TERMINATE, FALSE, dbgProcessInformation.dwProcessId);
|
||||
if(hProcess)
|
||||
{
|
||||
TerminateThread(dbgProcessInformation.hThread, NULL);
|
||||
TerminateProcess(dbgProcessInformation.hProcess, NULL);
|
||||
Sleep(10); //allow thread switching
|
||||
return true;
|
||||
TerminateProcess(hProcess, 0);
|
||||
CloseHandle(hProcess);
|
||||
result = true;
|
||||
}
|
||||
return false;
|
||||
|
||||
HANDLE hThread = TitanOpenThread(THREAD_TERMINATE, FALSE, dbgProcessInformation.dwThreadId);
|
||||
if(hThread)
|
||||
{
|
||||
TerminateThread(hThread, 0);
|
||||
CloseHandle(hThread);
|
||||
Sleep(10); //allow thread switching
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
__declspec(dllexport) bool TITCALL AttachDebugger(DWORD ProcessId, bool KillOnExit, LPVOID DebugInfo, LPVOID CallBack)
|
||||
|
|
|
|||
Loading…
Reference in New Issue