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

Function pwstr_to_string

resources/windows_service/src/service.rs:26–32  ·  view source on GitHub ↗

Convert a `PWSTR` to an `Option `. # Safety The pointer must be valid or null.

(p: PWSTR)

Source from the content-addressed store, hash-verified

24///
25/// The pointer must be valid or null.
26unsafe fn pwstr_to_string(p: PWSTR) -> Option<String> {
27 if p.is_null() {
28 None
29 } else {
30 unsafe { p.to_string().ok() }
31 }
32}
33
34/// Parse a double-null-terminated multi-string into individual strings.
35///

Callers 1

read_service_stateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected