Win32 API > Security > SecurityBaseAPI

Equals and OpenSCManager Functions

Last modified: February 13, 2023

Syntax

BOOL EqualsSid(
                      _In_ PSID Sid1,
                      _In_ PSID Sid2
                    );

Parameters

  • Sid1 [_In_]
    A pointer to the first SID structure.
  • Sid2 [_In_]
    A pointer to the second SID structure.

Return value

  • If the two SIDs are equal, the function returns TRUE.
  • If the two SIDs are not equal, the function returns FALSE.
  • If the function fails, it returns FALSE. To get extended error information, call GetLastError.

Remarks

  • The EqualsSid function compares two security identifiers (SIDs) to determine if they are identical.
  • The comparison includes the revision level, the identifier authority, and the count and values of the subauthorities.
  • This function is used to check if two SIDs represent the same security principal or group.
  • A SID is a variable-length structure used to uniquely identify subjects (users or processes) or security groups.

Requirements

Minimum supported client
Windows XP [desktop apps only]

Minimum supported server
Windows Server 2003 [desktop apps only]

Header
winbase.h (include windows.h)

Library
Advapi32.lib

DLL
Advapi32.dll