(
desired_access: u32,
inherit_handle: bool,
name: PyStrRef,
vm: &VirtualMachine,
)
| 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> { |
nothing calls this directly
no test coverage detected