funcs_any_win.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:petronia 作者: groboclown 项目源码 文件源码
def process__get_exit_code(thread_pid):
    """

    :param thread_pid:
    :return: None if the process hasn't exited, or the int exit code.
    """
    hproc = windll.kernel32.OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, False, thread_pid)
    try:
        exit_code = wintypes.DWORD()
        if GetExitCodeProcess(hproc, byref(exit_code)) != 0:
            if exit_code == STILL_ACTIVE:
                return None
            return int(exit_code)
        raise WinError()
    finally:
        windll.kernel32.CloseHandle(hproc)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号