(args: CreateNamedPipeArgs, vm: &VirtualMachine)
| 840 | /// CreateNamedPipe - Create a named pipe |
| 841 | #[pyfunction] |
| 842 | fn CreateNamedPipe(args: CreateNamedPipeArgs, vm: &VirtualMachine) -> PyResult<WinHandle> { |
| 843 | use windows_sys::Win32::System::Pipes::CreateNamedPipeW; |
| 844 | |
| 845 | let name_wide = args.name.as_wtf8().to_wide_with_nul(); |
| 846 | |
| 847 | let handle = unsafe { |
| 848 | CreateNamedPipeW( |
| 849 | name_wide.as_ptr(), |
| 850 | args.open_mode, |
| 851 | args.pipe_mode, |
| 852 | args.max_instances, |
| 853 | args.out_buffer_size, |
| 854 | args.in_buffer_size, |
| 855 | args.default_timeout, |
| 856 | null(), // security_attributes - NULL for now |
| 857 | ) |
| 858 | }; |
| 859 | |
| 860 | if handle == windows_sys::Win32::Foundation::INVALID_HANDLE_VALUE { |
| 861 | return Err(vm.new_last_os_error()); |
| 862 | } |
| 863 | |
| 864 | Ok(WinHandle(handle)) |
| 865 | } |
| 866 | |
| 867 | // ==================== Overlapped class ==================== |
| 868 | // Used for asynchronous I/O operations (ConnectNamedPipe, ReadFile, WriteFile) |
nothing calls this directly
no test coverage detected