artifactize-core 0.27.1

The library behind artifactize: Artifacts, evals, reviews, the monitor and review models, and the shared operations every interface calls.
Documentation
//! Security attributes for the Verify local endpoint.

use std::{io, mem, path::Path};
use windows_sys::Win32::Security::SECURITY_ATTRIBUTES;

/// Create a named-pipe instance with the same owner-only security used for private files.
pub(crate) fn private_pipe(
    options: &tokio::net::windows::named_pipe::ServerOptions,
    address: &Path,
) -> io::Result<tokio::net::windows::named_pipe::NamedPipeServer> {
    let descriptor = artifactize_foundation::platform::private::owner_descriptor()?;
    let mut attributes = SECURITY_ATTRIBUTES {
        nLength: mem::size_of::<SECURITY_ATTRIBUTES>() as u32,
        lpSecurityDescriptor: descriptor.as_ptr(),
        bInheritHandle: 0,
    };
    // SAFETY: valid SECURITY_ATTRIBUTES and descriptor kept alive through the create call.
    unsafe { options.create_with_security_attributes_raw(address, (&raw mut attributes).cast()) }
}