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()
|
__declspec(dllexport) void TITCALL ForceClose()
|
||||||
{
|
{
|
||||||
//manage process list
|
//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();
|
ClearProcessList();
|
||||||
//manage thread list
|
//manage thread list
|
||||||
int threadcount = (int)hListThread.size();
|
|
||||||
for(int i = 0; i < threadcount; i++)
|
|
||||||
EngineCloseHandle(hListThread.at(i).hThread);
|
|
||||||
ClearThreadList();
|
ClearThreadList();
|
||||||
//manage library list
|
//manage library list
|
||||||
int libcount = (int)hListLibrary.size();
|
int libcount = (int)hListLibrary.size();
|
||||||
|
|
|
||||||
|
|
@ -517,14 +517,24 @@ __declspec(dllexport) void* TITCALL InitDLLDebugW(wchar_t* szFileName, bool Rese
|
||||||
|
|
||||||
__declspec(dllexport) bool TITCALL StopDebug()
|
__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(hProcess, 0);
|
||||||
TerminateProcess(dbgProcessInformation.hProcess, NULL);
|
CloseHandle(hProcess);
|
||||||
Sleep(10); //allow thread switching
|
result = true;
|
||||||
return 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)
|
__declspec(dllexport) bool TITCALL AttachDebugger(DWORD ProcessId, bool KillOnExit, LPVOID DebugInfo, LPVOID CallBack)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue