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

Function OpenMutexW

crates/vm/src/stdlib/_winapi.rs:710–728  ·  view source on GitHub ↗
(
        desired_access: u32,
        inherit_handle: bool,
        name: PyStrRef,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

708
709 #[pyfunction]
710 fn OpenMutexW(
711 desired_access: u32,
712 inherit_handle: bool,
713 name: PyStrRef,
714 vm: &VirtualMachine,
715 ) -> PyResult<WinHandle> {
716 let name_wide = name.as_wtf8().to_wide_with_nul();
717 let handle = unsafe {
718 windows_sys::Win32::System::Threading::OpenMutexW(
719 desired_access,
720 i32::from(inherit_handle),
721 name_wide.as_ptr(),
722 )
723 };
724 if handle.is_null() {
725 return Err(vm.new_last_os_error());
726 }
727 Ok(WinHandle(handle))
728 }
729
730 #[pyfunction]
731 fn ReleaseMutex(handle: WinHandle) -> WindowsSysResult<i32> {

Callers

nothing calls this directly

Calls 6

WinHandleClass · 0.85
to_wide_with_nulMethod · 0.80
new_last_os_errorMethod · 0.80
ErrClass · 0.50
as_wtf8Method · 0.45
as_ptrMethod · 0.45

Tested by

no test coverage detected