GetWindowsAccountDomainSid function (securitybaseapi.h)

The GetWindowsAccountDomainSid function receives a security identifier (SID) and returns a SID representing the domain of that SID.

Syntax

BOOL GetWindowsAccountDomainSid(
  [in]            PSID  pSid,
  [out, optional] PSID  pDomainSid,
  [in, out]       DWORD *cbDomainSid
);

Parameters

[in] pSid

A pointer to the SID to examine.

[out, optional] pDomainSid

Pointer that GetWindowsAccountDomainSid fills with a pointer to a SID representing the domain.

[in, out] cbDomainSid

A pointer to a DWORD that GetWindowsAccountDomainSid fills with the size of the domain SID, in bytes.

Return value

Returns TRUE if successful.

Otherwise, returns FALSE. For extended error information, call GetLastError.

Requirements

Requirement Value
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