public SidInfo(int pos, SID_AND_ATTRIBUTES sa) { this.Position = pos; this.Attributes = (SID_ATTRIBUTE_INFORMATION)sa.Attributes; SecurityIdentifier sid = new SecurityIdentifier(sa.PSiD); ResolveSid(sid); }
private void DecodeGroups() { IntPtr ipsids = TGP.Sids; for (int sidcnt = 1; sidcnt <= TGP.SidCount; sidcnt++) { SID_AND_ATTRIBUTES sa = (SID_AND_ATTRIBUTES)Marshal.PtrToStructure(ipsids, typeof(SID_AND_ATTRIBUTES)); SidInfo sinfo = new SidInfo(sidcnt, sa); this.SidList.AddSafe(sinfo.Sid); this.Groups.AddSafe(sinfo); try { ipsids = (IntPtr)((Int64)ipsids + Marshal.SizeOf(typeof(SID_AND_ATTRIBUTES))); } catch (Exception) { break; } } }