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

Function raw_set_handle_inheritable

crates/vm/src/stdlib/nt.rs:1813–1827  ·  view source on GitHub ↗
(handle: intptr_t, inheritable: bool)

Source from the content-addressed store, hash-verified

1811 }
1812
1813 pub fn raw_set_handle_inheritable(handle: intptr_t, inheritable: bool) -> std::io::Result<()> {
1814 let flags = if inheritable {
1815 Foundation::HANDLE_FLAG_INHERIT
1816 } else {
1817 0
1818 };
1819 let res = unsafe {
1820 Foundation::SetHandleInformation(handle as _, Foundation::HANDLE_FLAG_INHERIT, flags)
1821 };
1822 if res == 0 {
1823 Err(std::io::Error::last_os_error())
1824 } else {
1825 Ok(())
1826 }
1827 }
1828
1829 #[pyfunction]
1830 fn listdrives(vm: &VirtualMachine) -> PyResult<PyListRef> {

Callers 5

_initMethod · 0.85
dupFunction · 0.85
set_handle_inheritableFunction · 0.85
dupFunction · 0.85
dup2Function · 0.85

Calls 1

ErrClass · 0.50

Tested by

no test coverage detected