code: def add_existing_session(self, dwProcessId, bStarted = False):
          
  
          # Register the process object with the snapshot.
          if not self.system.has_process(dwProcessId):
              aProcess = Process(dwProcessId)
              self.system._add_process(aProcess)
          else:
              aProcess = self.system.get_process(dwProcessId)
  
          # Test for debug privileges on the target process.
          # Raises WindowsException on error.
          aProcess.get_handle()
  
          # Register the process ID with the debugger.
          if bStarted:
              self.__attachedDebugees.add(dwProcessId)
          else:
              self.__startedDebugees.add(dwProcessId)
  
          # Match the system kill-on-exit flag to our own.
          self.__setSystemKillOnExitMode()
  
          # Scan the process threads and loaded modules.
          # This is prefered because the thread and library events do not
          # properly give some information, like the filename for each module.
          aProcess.scan_threads()
          aProcess.scan_modules()
docs: Use this method only when for some reason the debugger's been attached
          to the target outside of WinAppDbg (for example when integrating with
          other tools).
  
          You don't normally need to call this method. Most users should call
          L{attach}, L{execv} or L{execl} instead.
  
          @type  dwProcessId: int
          @param dwProcessId: Global process ID.
  
          @type  bStarted: bool
          @param bStarted: C{True} if the process was started by the debugger,
              or C{False} if the process was attached to instead.
  
          @raise WindowsError: The target process does not exist, is not attached
              to the debugger anymore.