This topic has not yet been rated - Rate this topic

GetWindowsAccountDomainSid function

Applies to: desktop apps only

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

Syntax

BOOL WINAPI GetWindowsAccountDomainSid(
  __in       PSID pSid,
  __out_opt  PSID ppDomainSid,
  __inout    DWORD *cbSid
);

Parameters

pSid [in]

A pointer to the SID to examine.

ppDomainSid [out, optional]

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

cbSid [in, out]

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

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Header

Winbase.h (include Windows.h)

Library

Advapi32.lib

DLL

Advapi32.dll

 

 

Send comments about this topic to Microsoft

Build date: 3/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
C# syntax
[DllImport("advapi32.dll", CharSet=CharSet.Unicode, SetLastError=true)]
internal static extern int GetWindowsAccountDomainSid(byte[] sid, [Out] byte[] resultSid, ref uint resultSidLength);
vb.net syntax
<DllImport("advapi32.dll", CharSet:=CharSet.Unicode, SetLastError:=True)> _
Public Shared Function GetWindowsAccountDomainSid(ByVal sid As Byte(), <Out> ByVal resultSid As Byte(), ByRef resultSidLength As UInt32) As Integer
End Function