Create a new console displaying STDOUT. Useful in injection of GUI process
()
| 70 | |
| 71 | |
| 72 | def create_console(): |
| 73 | """Create a new console displaying STDOUT. |
| 74 | Useful in injection of GUI process""" |
| 75 | winproxy.AllocConsole() |
| 76 | stdout_handle = winproxy.GetStdHandle(gdef.STD_OUTPUT_HANDLE) |
| 77 | console_stdout = create_file_from_handle(stdout_handle, "w") |
| 78 | sys.stdout = console_stdout |
| 79 | |
| 80 | stdin_handle = winproxy.GetStdHandle(gdef.STD_INPUT_HANDLE) |
| 81 | console_stdin = create_file_from_handle(stdin_handle, "r") |
| 82 | sys.stdin = console_stdin |
| 83 | |
| 84 | stderr_handle = winproxy.GetStdHandle(gdef.STD_ERROR_HANDLE) |
| 85 | console_stderr = create_file_from_handle(stderr_handle, "w") |
| 86 | sys.stderr = console_stderr |
| 87 | |
| 88 | |
| 89 | def create_process(path, args=None, dwCreationFlags=0, show_windows=True): |
no test coverage detected