Lines Matching refs:stdio
50 WinStdioChardev *stdio = WIN_STDIO_CHARDEV(opaque); in DECLARE_INSTANCE_CHECKER() local
56 ret = ReadConsoleInput(stdio->hStdIn, buf, ARRAY_SIZE(buf), &dwSize); in DECLARE_INSTANCE_CHECKER()
60 qemu_del_wait_object(stdio->hStdIn, NULL, NULL); in DECLARE_INSTANCE_CHECKER()
83 WinStdioChardev *stdio = WIN_STDIO_CHARDEV(param); in win_stdio_thread() local
90 ret = ReadFile(stdio->hStdIn, &stdio->win_stdio_buf, 1, &dwSize, NULL); in win_stdio_thread()
101 if (stdio->win_stdio_buf == '\r') { in win_stdio_thread()
106 if (!SetEvent(stdio->hInputReadyEvent)) { in win_stdio_thread()
109 if (WaitForSingleObject(stdio->hInputDoneEvent, INFINITE) in win_stdio_thread()
115 qemu_del_wait_object(stdio->hInputReadyEvent, NULL, NULL); in win_stdio_thread()
122 WinStdioChardev *stdio = WIN_STDIO_CHARDEV(opaque); in win_stdio_thread_wait_func() local
125 qemu_chr_be_write(chr, &stdio->win_stdio_buf, 1); in win_stdio_thread_wait_func()
128 SetEvent(stdio->hInputDoneEvent); in win_stdio_thread_wait_func()
133 WinStdioChardev *stdio = WIN_STDIO_CHARDEV(chr); in qemu_chr_set_echo_win_stdio() local
136 GetConsoleMode(stdio->hStdIn, &dwMode); in qemu_chr_set_echo_win_stdio()
139 SetConsoleMode(stdio->hStdIn, dwMode | ENABLE_ECHO_INPUT); in qemu_chr_set_echo_win_stdio()
141 SetConsoleMode(stdio->hStdIn, dwMode & ~ENABLE_ECHO_INPUT); in qemu_chr_set_echo_win_stdio()
150 ChardevStdio *opts = backend->u.stdio.data; in qemu_chr_open_stdio()
152 WinStdioChardev *stdio = WIN_STDIO_CHARDEV(chr); in qemu_chr_open_stdio() local
156 stdio->hStdIn = GetStdHandle(STD_INPUT_HANDLE); in qemu_chr_open_stdio()
157 if (stdio->hStdIn == INVALID_HANDLE_VALUE) { in qemu_chr_open_stdio()
162 is_console = GetConsoleMode(stdio->hStdIn, &dwMode) != 0; in qemu_chr_open_stdio()
163 stdio->dwOldMode = dwMode; in qemu_chr_open_stdio()
166 if (qemu_add_wait_object(stdio->hStdIn, in qemu_chr_open_stdio()
174 stdio->hInputReadyEvent = CreateEvent(NULL, FALSE, FALSE, NULL); in qemu_chr_open_stdio()
175 stdio->hInputDoneEvent = CreateEvent(NULL, FALSE, FALSE, NULL); in qemu_chr_open_stdio()
176 if (stdio->hInputReadyEvent == INVALID_HANDLE_VALUE in qemu_chr_open_stdio()
177 || stdio->hInputDoneEvent == INVALID_HANDLE_VALUE) { in qemu_chr_open_stdio()
181 if (qemu_add_wait_object(stdio->hInputReadyEvent, in qemu_chr_open_stdio()
186 stdio->hInputThread = CreateThread(NULL, 0, win_stdio_thread, in qemu_chr_open_stdio()
189 if (stdio->hInputThread == INVALID_HANDLE_VALUE) { in qemu_chr_open_stdio()
207 SetConsoleMode(stdio->hStdIn, dwMode); in qemu_chr_open_stdio()
214 qemu_del_wait_object(stdio->hInputReadyEvent, NULL, NULL); in qemu_chr_open_stdio()
216 CloseHandle(stdio->hInputReadyEvent); in qemu_chr_open_stdio()
217 CloseHandle(stdio->hInputDoneEvent); in qemu_chr_open_stdio()
219 qemu_del_wait_object(stdio->hStdIn, NULL, NULL); in qemu_chr_open_stdio()
224 WinStdioChardev *stdio = WIN_STDIO_CHARDEV(obj); in char_win_stdio_finalize() local
226 if (stdio->hStdIn != INVALID_HANDLE_VALUE) { in char_win_stdio_finalize()
227 SetConsoleMode(stdio->hStdIn, stdio->dwOldMode); in char_win_stdio_finalize()
229 if (stdio->hInputReadyEvent != INVALID_HANDLE_VALUE) { in char_win_stdio_finalize()
230 CloseHandle(stdio->hInputReadyEvent); in char_win_stdio_finalize()
232 if (stdio->hInputDoneEvent != INVALID_HANDLE_VALUE) { in char_win_stdio_finalize()
233 CloseHandle(stdio->hInputDoneEvent); in char_win_stdio_finalize()
235 if (stdio->hInputThread != INVALID_HANDLE_VALUE) { in char_win_stdio_finalize()
236 TerminateThread(stdio->hInputThread, 0); in char_win_stdio_finalize()