(self, dwProcessId, bIgnoreExceptions = False)
Detaches from a process currently being debugged.

        @note: On Windows 2000 and below the process is killed.

        @see: L{attach}, L{detach_from_all}

        @type  dwProcessId: int
        @param dwProcessId: Global ID of a process to detach from.

        @type  bIgnoreExceptions: bool
        @param bIgnoreExceptions: C{True} to ignore any exceptions that may be
            raised when detaching. C{False} to stop and raise an exception when
            encountering an error.

        @raise WindowsError: Raises an exception on error, unless
            C{bIgnoreExceptions} is C{True}.
Detaches from a process currently being debugged.
Detaches from a process currently being debugged .
def detach(self, dwProcessId, bIgnoreExceptions = False):
        """
        Detaches from a process currently being debugged.

        @note: On Windows 2000 and below the process is killed.

        @see: L{attach}, L{detach_from_all}

        @type  dwProcessId: int
        @param dwProcessId: Global ID of a process to detach from.

        @type  bIgnoreExceptions: bool
        @param bIgnoreExceptions: C{True} to ignore any exceptions that may be
            raised when detaching. C{False} to stop and raise an exception when
            encountering an error.

        @raise WindowsError: Raises an exception on error, unless
            C{bIgnoreExceptions} is C{True}.
        """

        # Keep a reference to the process. We'll need it later.
        try:
            aProcess = self.system.get_process(dwProcessId)
        except KeyError:
            aProcess = Process(dwProcessId)

        # Determine if there is support for detaching.
        # This check should only fail on Windows 2000 and older.
        try:
            win32.DebugActiveProcessStop
            can_detach = True
        except AttributeError:
            can_detach = False

        # Continue the last event before detaching.
        # XXX not sure about this...
        try:
            if can_detach and self.lastEvent and \
                                    self.lastEvent.get_pid() == dwProcessId:
                self.cont(self.lastEvent)
        except Exception:
            if not bIgnoreExceptions:
                raise
            e = sys.exc_info()[1]
            warnings.warn(str(e), RuntimeWarning)

        # Cleanup all data referring to the process.
        self.__cleanup_process(dwProcessId,
                               bIgnoreExceptions = bIgnoreExceptions)

        try:
            # Detach from the process.
            # On Windows 2000 and before, kill the process.
            if can_detach:
                try:
                    win32.DebugActiveProcessStop(dwProcessId)
                except Exception:
                    if not bIgnoreExceptions:
                        raise
                    e = sys.exc_info()[1]
                    warnings.warn(str(e), RuntimeWarning)
            else:
                try:
                    aProcess.kill()
                except Exception:
                    if not bIgnoreExceptions:
                        raise
                    e = sys.exc_info()[1]
                    warnings.warn(str(e), RuntimeWarning)

        finally:

            # Cleanup what remains of the process data.
            aProcess.clear()
def detach ( self , dwProcessId , bIgnoreExceptions = False ) : # Keep a reference to the process. We'll need it later. try : aProcess = self . system . get_process ( dwProcessId ) except KeyError : aProcess = Process ( dwProcessId ) # Determine if there is support for detaching. # This check should only fail on Windows 2000 and older. try : win32 . DebugActiveProcessStop can_detach = True except AttributeError : can_detach = False # Continue the last event before detaching. # XXX not sure about this... try : if can_detach and self . lastEvent and self . lastEvent . get_pid ( ) == dwProcessId : self . cont ( self . lastEvent ) except Exception : if not bIgnoreExceptions : raise e = sys . exc_info ( ) [ 1 ] warnings . warn ( str ( e ) , RuntimeWarning ) # Cleanup all data referring to the process. self . __cleanup_process ( dwProcessId , bIgnoreExceptions = bIgnoreExceptions ) try : # Detach from the process. # On Windows 2000 and before, kill the process. if can_detach : try : win32 . DebugActiveProcessStop ( dwProcessId ) except Exception : if not bIgnoreExceptions : raise e = sys . exc_info ( ) [ 1 ] warnings . warn ( str ( e ) , RuntimeWarning ) else : try : aProcess . kill ( ) except Exception : if not bIgnoreExceptions : raise e = sys . exc_info ( ) [ 1 ] warnings . warn ( str ( e ) , RuntimeWarning ) finally : # Cleanup what remains of the process data. aProcess . clear ( )