MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / clean_exit

Method clean_exit

pydevd_attach_to_process/winappdbg/process.py:3708–3734  ·  view source on GitHub ↗

Injects a new thread to call ExitProcess(). Optionally waits for the injected thread to finish. @warning: Setting C{bWait} to C{True} when the process is frozen by a debug event will cause a deadlock in your debugger. @type dwExitCode: int @par

(self, dwExitCode=0, bWait=False, dwTimeout=None)

Source from the content-addressed store, hash-verified

3706 return aThread
3707
3708 def clean_exit(self, dwExitCode=0, bWait=False, dwTimeout=None):
3709 """
3710 Injects a new thread to call ExitProcess().
3711 Optionally waits for the injected thread to finish.
3712
3713 @warning: Setting C{bWait} to C{True} when the process is frozen by a
3714 debug event will cause a deadlock in your debugger.
3715
3716 @type dwExitCode: int
3717 @param dwExitCode: Process exit code.
3718
3719 @type bWait: bool
3720 @param bWait: C{True} to wait for the process to finish.
3721 C{False} to return immediately.
3722
3723 @type dwTimeout: int
3724 @param dwTimeout: (Optional) Timeout value in milliseconds.
3725 Ignored if C{bWait} is C{False}.
3726
3727 @raise WindowsError: An exception is raised on error.
3728 """
3729 if not dwExitCode:
3730 dwExitCode = 0
3731 pExitProcess = self.resolve_label("kernel32!ExitProcess")
3732 aThread = self.start_thread(pExitProcess, dwExitCode)
3733 if bWait:
3734 aThread.wait(dwTimeout)
3735
3736 # ------------------------------------------------------------------------------
3737

Callers

nothing calls this directly

Calls 3

start_threadMethod · 0.80
resolve_labelMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected