The RtlConvertSidToUnicodeString routine generates a printable Unicode string representation of a security identifier (SID).
NTSYSAPI NTSTATUS RtlConvertSidToUnicodeString( PUNICODE_STRING UnicodeString, PSID Sid, BOOLEAN AllocateDestinationString );
A pointer to a UNICODE_STRING structure to contain the generated Unicode string. The UnicodeString->MaximumLength member is set only if AllocateDestinationString is TRUE.
A pointer to the SID structure that is to be converted to Unicode (the SID structure is unaffected).
A Boolean flag that indicates whether this routine will allocate the UnicodeString buffer. If TRUE, only the UnicodeString->Buffer member is allocated and the rest of the UnicodeString structure must be allocated by the caller.
The RtlConvertSidToUnicodeString routine can return one of the following values:
||The conversion was successful.|
||This is returned if AllocateDestinationString is FALSE and the caller supplied UnicodeString buffer is too small to hold the converted Unicode string.|
||This is returned if AllocateDestinationString is TRUE and there is insufficient memory to allocate the UnicodeString buffer.|
||The specified SID structure is not structurally valid.|
The generated Unicode string will take one of two forms. If the value of the IdentifierAuthority member of the SID is less than or equal to 2^32, the IdentifierAuthority member will be generated as decimal. For example, a SID with an IdentifierAuthority of 281,736 generates:
If AllocateDestinationString is TRUE, the allocated buffer must be deallocated by using RtlFreeUnicodeString.
|Windows version||Available in Windows 2000 and later Windows operating systems.|
|Header||ntifs.h (include Ntifs.h, FltKernel.h)|