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

Method new_with_handle

crates/vm/src/stdlib/_winapi.rs:905–923  ·  view source on GitHub ↗
(handle: HANDLE)

Source from the content-addressed store, hash-verified

903 #[pyclass(with(Constructor))]
904 impl Overlapped {
905 fn new_with_handle(handle: HANDLE) -> Self {
906 use windows_sys::Win32::System::Threading::CreateEventW;
907
908 let event = unsafe { CreateEventW(null(), 1, 0, null()) };
909 let mut overlapped: windows_sys::Win32::System::IO::OVERLAPPED =
910 unsafe { core::mem::zeroed() };
911 overlapped.hEvent = event;
912
913 Overlapped {
914 inner: PyMutex::new(OverlappedInner {
915 overlapped: Box::new(overlapped),
916 handle,
917 pending: false,
918 completed: false,
919 read_buffer: None,
920 write_buffer: None,
921 }),
922 }
923 }
924
925 #[pymethod]
926 fn GetOverlappedResult(&self, wait: bool, vm: &VirtualMachine) -> PyResult<(u32, u32)> {

Callers

nothing calls this directly

Calls 2

CreateEventWFunction · 0.85
newFunction · 0.85

Tested by

no test coverage detected