internal static int GetLastRidFromSid(IntPtr pSid) { IntPtr pRidCount = UnsafeNativeMethods.GetSidSubAuthorityCount(pSid); int ridCount = Marshal.ReadByte(pRidCount); IntPtr pLastRid = UnsafeNativeMethods.GetSidSubAuthority(pSid, ridCount - 1); int lastRid = Marshal.ReadInt32(pLastRid); return(lastRid); }
internal static int GetLastRidFromSid(IntPtr pSid) { IntPtr sidSubAuthorityCount = UnsafeNativeMethods.GetSidSubAuthorityCount(pSid); int num = Marshal.ReadByte(sidSubAuthorityCount); IntPtr sidSubAuthority = UnsafeNativeMethods.GetSidSubAuthority(pSid, num - 1); int num1 = Marshal.ReadInt32(sidSubAuthority); return(num1); }