wfp 0.0.6

A Rust library for the Windows Filtering Platform (WFP) API
Documentation
1
2
3
4
5
6
use std::{ffi::OsStr, iter, os::windows::ffi::OsStrExt};

/// Convert `s` to a null-terminated UTF-16 string
pub fn string_to_null_terminated_utf16<T: FromIterator<u16>>(s: impl AsRef<OsStr>) -> T {
    s.as_ref().encode_wide().chain(iter::once(0u16)).collect()
}