Lines Matching defs:handle
49 char _get_console_type(HANDLE handle) {
52 if (handle == INVALID_HANDLE_VALUE)
55 if (!GetConsoleMode(handle, &mode))
58 /* Peek at the handle to see whether it is an input or output handle */
59 if (GetNumberOfConsoleInputEvents(handle, &peek_count))
68 HANDLE handle = _Py_get_osfhandle_noraise(fd);
69 if (handle == INVALID_HANDLE_VALUE)
71 return _get_console_type(handle);
261 HANDLE handle = NULL;
334 handle = _Py_get_osfhandle_noraise(fd);
354 handle = CreateFileW(name, GENERIC_READ | GENERIC_WRITE,
356 if (handle == INVALID_HANDLE_VALUE)
357 handle = CreateFileW(name, access,
361 if (handle == INVALID_HANDLE_VALUE) {
367 self->fd = _Py_open_osfhandle_noraise(handle, _O_WRONLY | _O_BINARY);
369 self->fd = _Py_open_osfhandle_noraise(handle, _O_RDONLY | _O_BINARY);
371 CloseHandle(handle);
378 console_type = _get_console_type(handle);
528 read_console_w(HANDLE handle, DWORD maxlen, DWORD *readlen) {
544 BOOL res = ReadConsoleW(handle, &buf[off], len, &n, NULL);
647 HANDLE handle = _Py_get_osfhandle(self->fd);
648 if (handle == INVALID_HANDLE_VALUE)
672 wchar_t *wbuf = read_console_w(handle, wlen, &n);
778 HANDLE handle;
783 handle = _Py_get_osfhandle(self->fd);
784 if (handle == INVALID_HANDLE_VALUE)
818 subbuf = read_console_w(handle, bufsize - len, &n);
958 HANDLE handle;
965 handle = _Py_get_osfhandle(self->fd);
966 if (handle == INVALID_HANDLE_VALUE)
982 handle partial writes.
1014 res = WriteConsoleW(handle, wbuf, wlen, &n, NULL);