コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: Utils.cs プロジェクト: modulexcite/pash-1
        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);
        }