From ea2dca0e28d2cc9c013bfda5c0343241b15abbda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 14 Sep 2009 20:47:20 +0000 Subject: [PATCH] revert process debug call, it's slow and dangerous --- library/DFCommon.h | 2 +- library/DFProcess.cpp | 25 ++++++++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/library/DFCommon.h b/library/DFCommon.h index 025acf884..1bd272f6b 100644 --- a/library/DFCommon.h +++ b/library/DFCommon.h @@ -44,7 +44,7 @@ using namespace std; #include #include #else -#define WINVER 0x0501 // OpenThread(), PSAPI, Toolhelp32 +#define WINVER 0x0500 // OpenThread(), PSAPI, Toolhelp32 #define WIN32_LEAN_AND_MEAN #include #include diff --git a/library/DFProcess.cpp b/library/DFProcess.cpp index 66ea54898..07ce74903 100644 --- a/library/DFProcess.cpp +++ b/library/DFProcess.cpp @@ -121,16 +121,22 @@ void Process::freeResources() //FIXME: should support stopping and resuming the process bool Process::attach() -{ +{ + if(attached) + { + return false; + } + /* if(DebugActiveProcess(my_pid)) - { + { + */ attached = true; g_pProcess = this; g_ProcessHandle = my_handle; return true; - } - return false; + /*} + return false;*/ } @@ -139,15 +145,16 @@ bool Process::detach() if(!attached) { return false; - } - if(DebugActiveProcessStop(my_pid)) - { + } + //TODO: find a safer way to suspend processes + /*if(DebugActiveProcessStop(my_pid)) + {*/ attached = false; g_pProcess = NULL; g_ProcessHandle = 0; return true; - } - return false; + /*} + return false;*/ }