MCPcopy Create free account
hub / github.com/PowerShell/DSC / deps_to_multi_string

Function deps_to_multi_string

resources/windows_service/src/service.rs:577–588  ·  view source on GitHub ↗

Build a double-null-terminated UTF-16 multi-string from a list of dependency names.

(deps: &[String])

Source from the content-addressed store, hash-verified

575
576/// Build a double-null-terminated UTF-16 multi-string from a list of dependency names.
577fn deps_to_multi_string(deps: &[String]) -> Vec<u16> {
578 let mut buf = Vec::new();
579 for dep in deps {
580 buf.extend(dep.encode_utf16());
581 buf.push(0); // null terminator for each string
582 }
583 if buf.is_empty() {
584 buf.push(0); // first null for empty multi-string
585 }
586 buf.push(0); // final null terminator (double-null)
587 buf
588}
589
590/// Apply the desired service configuration and status changes, then return the final state.
591/// Check whether the given account name is a built-in service account.

Callers 1

set_serviceFunction · 0.85

Calls 2

newFunction · 0.50
is_emptyMethod · 0.45

Tested by

no test coverage detected