ConvertSidToStringSid function
Applies to: desktop apps only
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.
Syntax
BOOL ConvertSidToStringSid( __in PSID Sid, __out LPTSTR *StringSid );
Parameters
- Sid [in]
-
A pointer to the SID structure to be converted.
- StringSid [out]
-
A pointer to a variable that receives a pointer to a null-terminated SID string. To free the returned buffer, call the LocalFree function.
Return value
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. |
Remarks
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.
Requirements
|
Minimum supported client | Windows XP |
|---|---|
|
Minimum supported server | Windows Server 2003 |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names | ConvertSidToStringSidW (Unicode) and ConvertSidToStringSidA (ANSI) |
See also
- Access Control Overview
- Basic Access Control Functions
- ConvertSecurityDescriptorToStringSecurityDescriptor
- ConvertStringSecurityDescriptorToSecurityDescriptor
- ConvertStringSidToSid
- SID
Send comments about this topic to Microsoft
Build date: 3/7/2012
The same truncation is also true of the ConvertStringSidToSid function which will truncate any stringified identifier authority larger than 0xFFFFFFFF down to that value.
For C++ functions that handle SIDs with these larger identifier authorities both from and to string form see http://www.cpplc.net/forum/index.php/topic,1555.0.html
- 3/31/2008
- adeyblue