Export (0) Print
Expand All
Expand Minimize

EqualDomainSid function

The EqualDomainSid function determines whether two SIDs are from the same domain.

Syntax


BOOL WINAPI EqualDomainSid(
  _In_   PSID pSid1,
  _In_   PSID pSid2,
  _Out_  BOOL *pfEqual
);

Parameters

pSid1 [in]

A pointer to one of the two SIDs to compare. This SID must be either an account domain SID or a BUILTIN SID.

pSid2 [in]

A pointer to one of the two SIDs to compare. This SID must be either an account domain SID or a BUILTIN SID.

pfEqual [out]

A pointer to a BOOL that EqualDomainSid sets to TRUE if the domains of the two SIDs are equal or FALSE if they are not equal. This value cannot be NULL.

Return value

If both SIDs are account domain SIDs and/or BUILTIN SIDs, the return value is nonzero. In addition, *pfEqual is set to TRUE if the domains of the two SIDs are equal; otherwise *pfEqual is set to FALSE.

If one or more of the SIDS is neither an account domain SID nor a BUILTIN SID, then the return value is FALSE. To get extended error information, call GetLastError. GetLastError returns ERROR_NON_DOMAIN_SID if either SID is not an account domain SID or BUILTIN SID.

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

See also

EqualPrefixSid
EqualSid

 

 

Community Additions

ADD
Show:
© 2014 Microsoft