Function windows_acl::helper::name_to_sid [] [src]

pub fn name_to_sid(name: &str, system: Option<&str>) -> Result<Vec<BYTE>, DWORD>

Resolves a system username (either in the format of "user" or "DOMAIN\user") into a raw SID. The raw SID is represented by a Vec<u8> object.

Arguments

Errors

On error, a Windows error code is returned with the Err type.

Note: If the error code is 0, GetLastError() returned ERROR_INSUFFICIENT_BUFFER after invoking LookupAccountNameW or the sid_size is 0.