CreateWellKnownSid function

The CreateWellKnownSid function creates a SID for predefined aliases.

Syntax

BOOL CreateWellKnownSid(
  WELL_KNOWN_SID_TYPE WellKnownSidType,
  PSID                DomainSid,
  PSID                pSid,
  DWORD               *cbSid
);

Parameters

WellKnownSidType

Member of the WELL_KNOWN_SID_TYPE enumeration that specifies what the SID will identify.

DomainSid

A pointer to a SID that identifies the domain to use when creating the SID. Pass NULL to use the local computer.

pSid

A pointer to memory where CreateWellKnownSid will store the new SID.

cbSid

A pointer to a DWORD that contains the number of bytes available at pSid. The CreateWellKnownSid function stores the number of bytes actually used at this location.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. For extended error information, call GetLastError.

Requirements

   
Minimum supported client Windows XP [desktop apps | UWP apps]
Minimum supported server Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header securitybaseapi.h (include Windows.h)
Library Advapi32.lib
DLL Advapi32.dll

See Also

EqualDomainSid

GetWindowsAccountDomainSid

IsWellKnownSid

WELL_KNOWN_SID_TYPE