Export (0) Print
Expand All
Expand Minimize

ConvertSidToStringSid function

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 codeDescription
ERROR_NOT_ENOUGH_MEMORY

Insufficient memory.

ERROR_INVALID_SID

The SID is not valid.

ERROR_INVALID_PARAMETER

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 [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Sddl.h

Library

Advapi32.lib

DLL

Advapi32.dll

Unicode and ANSI names

ConvertSidToStringSidW (Unicode) and ConvertSidToStringSidA (ANSI)

See also

Access Control Overview
Basic Access Control Functions
ConvertSecurityDescriptorToStringSecurityDescriptor
ConvertStringSecurityDescriptorToSecurityDescriptor
ConvertStringSidToSid
SID

 

 

Community Additions

ADD
Show:
© 2014 Microsoft