(
_security_attributes: PyObjectRef,
name: OptionalArg<Option<PyStrRef>>,
vm: &VirtualMachine,
)
| 617 | |
| 618 | #[pyfunction] |
| 619 | fn CreateJobObject( |
| 620 | _security_attributes: PyObjectRef, |
| 621 | name: OptionalArg<Option<PyStrRef>>, |
| 622 | vm: &VirtualMachine, |
| 623 | ) -> PyResult<WinHandle> { |
| 624 | let handle = unsafe { |
| 625 | match name.flatten() { |
| 626 | Some(name) => { |
| 627 | let name_wide = name.as_wtf8().to_wide_with_nul(); |
| 628 | windows_sys::Win32::System::JobObjects::CreateJobObjectW( |
| 629 | null(), |
| 630 | name_wide.as_ptr(), |
| 631 | ) |
| 632 | } |
| 633 | None => windows_sys::Win32::System::JobObjects::CreateJobObjectW(null(), null()), |
| 634 | } |
| 635 | }; |
| 636 | if handle.is_null() { |
| 637 | return Err(vm.new_last_os_error()); |
| 638 | } |
| 639 | Ok(WinHandle(handle)) |
| 640 | } |
| 641 | |
| 642 | #[pyfunction] |
| 643 | fn AssignProcessToJobObject( |
nothing calls this directly
no test coverage detected