GetSidSubAuthority (advapi32)
Last changed: Peter Ritchie-192.197.82.203

.
Summary
The GetSidSubAuthority function returns a pointer to a specified subauthority in a security identifier (SID). The subauthority value is a relative identifier (RID).

C# Signature:

[DllImport("advapi32.dll", SetLastError=true)]
static extern TODO GetSidSubAuthority(TODO);

VB Signature:

Declare Function GetSidSubAuthority Lib "advapi32.dll" (ByVal psid As IntPtr, ByVal nSubAuthority As Integer) As IntPtr

User-Defined Types:

None.

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

' Note: the following code is an example but shouldn't be used in real life.

' The SubAuthority may be too big for an integer and needs an UInt32 but Marshal has nothing for unsigned types

Dim subAuthority As Integer = Runtime.InteropServices.Marshal.ReadInt32(GetSidSubAuthority(pSID, i), 0)

Alternative Managed API:

Do you know one? Please contribute it!

Documentation