Platform SDK: Access Control |
The InitializeSid function initializes a SID. (A SID is a security identifier.)
BOOL InitializeSid( PSID Sid, // SID PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, // SIA BYTE nSubAuthorityCount // count of subauthorities );
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.
Although the InitializeSid function sets the number of subauthorities for the SID, it does not set the subauthority values. This must be done separately, using functions, such as GetSidSubAuthority.
An application can use the AllocateAndInitializeSid function to initialize a SID and set its subauthority values.
Windows NT/2000: Requires Windows NT 3.1 or later.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Advapi32.lib.
Access Control Overview, Access Control Functions, AllocateAndInitializeSid, GetLengthSid, GetSidIdentifierAuthority, GetSidLengthRequired, GetSidSubAuthority, GetSidSubAuthorityCount, IsValidSid, SID, SID_IDENTIFIER_AUTHORITY