MCPcopy Index your code
hub / github.com/RustPython/RustPython / GetStdHandle

Function GetStdHandle

crates/vm/src/stdlib/_winapi.rs:135–149  ·  view source on GitHub ↗
(
        std_handle: windows_sys::Win32::System::Console::STD_HANDLE,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

133
134 #[pyfunction]
135 fn GetStdHandle(
136 std_handle: windows_sys::Win32::System::Console::STD_HANDLE,
137 vm: &VirtualMachine,
138 ) -> PyResult<Option<WinHandle>> {
139 let handle = unsafe { windows_sys::Win32::System::Console::GetStdHandle(std_handle) };
140 if handle == windows_sys::Win32::Foundation::INVALID_HANDLE_VALUE {
141 return Err(vm.new_last_os_error());
142 }
143 Ok(if handle.is_null() {
144 // NULL handle - return None
145 None
146 } else {
147 Some(WinHandle(handle))
148 })
149 }
150
151 #[pyfunction]
152 fn CreatePipe(

Callers 2

windows_console.pyFile · 0.85

Calls 4

WinHandleClass · 0.85
new_last_os_errorMethod · 0.80
ErrClass · 0.50
SomeClass · 0.50

Tested by

no test coverage detected