|  |  |  | @ -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;*/ | 
		
	
		
			
				|  |  |  |  | } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
	
		
			
				
					|  |  |  | 
 |