Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The ConvertSidToStringSid function converts a security identifier (SID) to a string format suitable for display, storage, or transmission.
To convert the string-format SID back to a valid, functional SID, call the ConvertStringSidToSid function.
BOOL ConvertSidToStringSidA(
[in] PSID Sid,
[out] LPSTR *StringSid
);
[in] Sid
A pointer to the SID structure to be converted.
[out] StringSid
A pointer to a variable that receives a pointer to a null-terminated SID string. To free the returned buffer, call the LocalFree function.
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError. The GetLastError function may return one of the following error codes.
Return code | Description |
---|---|
|
Insufficient memory. |
|
The SID is not valid. |
|
One of the parameters contains a value that is not valid. This is most often a pointer that is not valid. |
The ConvertSidToStringSid function uses the standard S-R-I-S-S… format for SID strings. For more information about SID string notation, see SID Components.
Note
The sddl.h header defines ConvertSidToStringSid as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
Requirement | Value |
---|---|
Minimum supported client | Windows XP [desktop apps | UWP apps] |
Minimum supported server | Windows Server 2003 [desktop apps | UWP apps] |
Target Platform | Windows |
Header | sddl.h |
Library | Advapi32.lib |
DLL | Advapi32.dll |
Basic Access Control Functions
ConvertSecurityDescriptorToStringSecurityDescriptor
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today