internal static Exception CreateForestTrustCollisionException(IntPtr collisionInfo) { ForestTrustRelationshipCollisionCollection collisions = new ForestTrustRelationshipCollisionCollection(); LSA_FOREST_TRUST_COLLISION_INFORMATION structure = new LSA_FOREST_TRUST_COLLISION_INFORMATION(); Marshal.PtrToStructure(collisionInfo, structure); int recordCount = structure.RecordCount; IntPtr zero = IntPtr.Zero; for (int i = 0; i < recordCount; i++) { zero = Marshal.ReadIntPtr(structure.Entries, i * Marshal.SizeOf(typeof(IntPtr))); LSA_FOREST_TRUST_COLLISION_RECORD lsa_forest_trust_collision_record = new LSA_FOREST_TRUST_COLLISION_RECORD(); Marshal.PtrToStructure(zero, lsa_forest_trust_collision_record); ForestTrustCollisionType collisionType = lsa_forest_trust_collision_record.Type; string record = Marshal.PtrToStringUni(lsa_forest_trust_collision_record.Name.Buffer, lsa_forest_trust_collision_record.Name.Length / 2); TopLevelNameCollisionOptions none = TopLevelNameCollisionOptions.None; DomainCollisionOptions domainFlag = DomainCollisionOptions.None; switch (collisionType) { case ForestTrustCollisionType.TopLevelName: none = (TopLevelNameCollisionOptions) lsa_forest_trust_collision_record.Flags; break; case ForestTrustCollisionType.Domain: domainFlag = (DomainCollisionOptions) lsa_forest_trust_collision_record.Flags; break; } ForestTrustRelationshipCollision collision = new ForestTrustRelationshipCollision(collisionType, none, domainFlag, record); collisions.Add(collision); } return new ForestTrustCollisionException(Res.GetString("ForestTrustCollision"), null, collisions); }
internal static Exception CreateForestTrustCollisionException(IntPtr collisionInfo) { ForestTrustRelationshipCollisionCollection forestTrustRelationshipCollisionCollection = new ForestTrustRelationshipCollisionCollection(); LSA_FOREST_TRUST_COLLISION_INFORMATION lSAFORESTTRUSTCOLLISIONINFORMATION = new LSA_FOREST_TRUST_COLLISION_INFORMATION(); Marshal.PtrToStructure(collisionInfo, lSAFORESTTRUSTCOLLISIONINFORMATION); int recordCount = lSAFORESTTRUSTCOLLISIONINFORMATION.RecordCount; for (int i = 0; i < recordCount; i++) { IntPtr intPtr = Marshal.ReadIntPtr(lSAFORESTTRUSTCOLLISIONINFORMATION.Entries, i * Marshal.SizeOf(typeof(IntPtr))); LSA_FOREST_TRUST_COLLISION_RECORD lSAFORESTTRUSTCOLLISIONRECORD = new LSA_FOREST_TRUST_COLLISION_RECORD(); Marshal.PtrToStructure(intPtr, lSAFORESTTRUSTCOLLISIONRECORD); ForestTrustCollisionType type = lSAFORESTTRUSTCOLLISIONRECORD.Type; string stringUni = Marshal.PtrToStringUni(lSAFORESTTRUSTCOLLISIONRECORD.Name.Buffer, lSAFORESTTRUSTCOLLISIONRECORD.Name.Length / 2); TopLevelNameCollisionOptions flags = TopLevelNameCollisionOptions.None; DomainCollisionOptions domainCollisionOption = DomainCollisionOptions.None; if (type != ForestTrustCollisionType.TopLevelName) { if (type == ForestTrustCollisionType.Domain) { domainCollisionOption = (DomainCollisionOptions)lSAFORESTTRUSTCOLLISIONRECORD.Flags; } } else { flags = (TopLevelNameCollisionOptions)lSAFORESTTRUSTCOLLISIONRECORD.Flags; } ForestTrustRelationshipCollision forestTrustRelationshipCollision = new ForestTrustRelationshipCollision(type, flags, domainCollisionOption, stringUni); forestTrustRelationshipCollisionCollection.Add(forestTrustRelationshipCollision); } ForestTrustCollisionException forestTrustCollisionException = new ForestTrustCollisionException(Res.GetString("ForestTrustCollision"), null, forestTrustRelationshipCollisionCollection); return(forestTrustCollisionException); }
public int IndexOf(ForestTrustRelationshipCollision collision) { if (collision == null) throw new ArgumentNullException("collision"); return InnerList.IndexOf(collision); }
public bool Contains(ForestTrustRelationshipCollision collision) { if (collision == null) throw new ArgumentNullException("collision"); return InnerList.Contains(collision); }
internal static Exception CreateForestTrustCollisionException(IntPtr collisionInfo) { ForestTrustRelationshipCollisionCollection collisions = new ForestTrustRelationshipCollisionCollection(); LSA_FOREST_TRUST_COLLISION_INFORMATION structure = new LSA_FOREST_TRUST_COLLISION_INFORMATION(); Marshal.PtrToStructure(collisionInfo, structure); int recordCount = structure.RecordCount; IntPtr zero = IntPtr.Zero; for (int i = 0; i < recordCount; i++) { zero = Marshal.ReadIntPtr(structure.Entries, i * Marshal.SizeOf(typeof(IntPtr))); LSA_FOREST_TRUST_COLLISION_RECORD lsa_forest_trust_collision_record = new LSA_FOREST_TRUST_COLLISION_RECORD(); Marshal.PtrToStructure(zero, lsa_forest_trust_collision_record); ForestTrustCollisionType collisionType = lsa_forest_trust_collision_record.Type; string record = Marshal.PtrToStringUni(lsa_forest_trust_collision_record.Name.Buffer, lsa_forest_trust_collision_record.Name.Length / 2); TopLevelNameCollisionOptions none = TopLevelNameCollisionOptions.None; DomainCollisionOptions domainFlag = DomainCollisionOptions.None; switch (collisionType) { case ForestTrustCollisionType.TopLevelName: none = (TopLevelNameCollisionOptions)lsa_forest_trust_collision_record.Flags; break; case ForestTrustCollisionType.Domain: domainFlag = (DomainCollisionOptions)lsa_forest_trust_collision_record.Flags; break; } ForestTrustRelationshipCollision collision = new ForestTrustRelationshipCollision(collisionType, none, domainFlag, record); collisions.Add(collision); } return(new ForestTrustCollisionException(Res.GetString("ForestTrustCollision"), null, collisions)); }
public int IndexOf(ForestTrustRelationshipCollision collision) { Contract.Requires(collision != null); Contract.Ensures(Contract.Result<int>() >= -1); Contract.Ensures(Contract.Result<int>() < this.Count); return default(int); }
public bool Contains(ForestTrustRelationshipCollision collision) { if (collision == null) { throw new ArgumentNullException("collision"); } return(base.InnerList.Contains(collision)); }
public int IndexOf(ForestTrustRelationshipCollision collision) { if (collision == null) { throw new ArgumentNullException("collision"); } return(base.InnerList.IndexOf(collision)); }
public int IndexOf(ForestTrustRelationshipCollision collision) { Contract.Requires(collision != null); Contract.Ensures(Contract.Result <int>() >= -1); Contract.Ensures(Contract.Result <int>() < this.Count); return(default(int)); }
public bool Contains(ForestTrustRelationshipCollision collision) { if (collision != null) { return base.InnerList.Contains(collision); } else { throw new ArgumentNullException("collision"); } }
public int IndexOf(ForestTrustRelationshipCollision collision) { if (collision != null) { return base.InnerList.IndexOf(collision); } else { throw new ArgumentNullException("collision"); } }
internal static Exception CreateForestTrustCollisionException(IntPtr collisionInfo) { ForestTrustRelationshipCollisionCollection collection = new ForestTrustRelationshipCollisionCollection(); LSA_FOREST_TRUST_COLLISION_INFORMATION collision = new LSA_FOREST_TRUST_COLLISION_INFORMATION(); Marshal.PtrToStructure(collisionInfo, collision); int count = collision.RecordCount; IntPtr addr = (IntPtr)0; for (int i = 0; i < count; i++) { addr = Marshal.ReadIntPtr(collision.Entries, i * IntPtr.Size); LSA_FOREST_TRUST_COLLISION_RECORD record = new LSA_FOREST_TRUST_COLLISION_RECORD(); Marshal.PtrToStructure(addr, record); ForestTrustCollisionType type = record.Type; string recordName = Marshal.PtrToStringUni(record.Name.Buffer, record.Name.Length / 2); TopLevelNameCollisionOptions TLNFlag = TopLevelNameCollisionOptions.None; DomainCollisionOptions domainFlag = DomainCollisionOptions.None; if (type == ForestTrustCollisionType.TopLevelName) { TLNFlag = (TopLevelNameCollisionOptions)record.Flags; } else if (type == ForestTrustCollisionType.Domain) { domainFlag = (DomainCollisionOptions)record.Flags; } ForestTrustRelationshipCollision tmp = new ForestTrustRelationshipCollision(type, TLNFlag, domainFlag, recordName); collection.Add(tmp); } ForestTrustCollisionException exception = new ForestTrustCollisionException(SR.ForestTrustCollision, null, collection); return(exception); }
internal static Exception CreateForestTrustCollisionException(IntPtr collisionInfo) { ForestTrustRelationshipCollisionCollection collection = new ForestTrustRelationshipCollisionCollection(); LSA_FOREST_TRUST_COLLISION_INFORMATION collision = new LSA_FOREST_TRUST_COLLISION_INFORMATION(); Marshal.PtrToStructure(collisionInfo, collision); int count = collision.RecordCount; IntPtr addr = (IntPtr)0; for (int i = 0; i < count; i++) { addr = Marshal.ReadIntPtr(collision.Entries, i * Marshal.SizeOf(typeof(IntPtr))); LSA_FOREST_TRUST_COLLISION_RECORD record = new LSA_FOREST_TRUST_COLLISION_RECORD(); Marshal.PtrToStructure(addr, record); ForestTrustCollisionType type = record.Type; string recordName = Marshal.PtrToStringUni(record.Name.Buffer, record.Name.Length / 2); TopLevelNameCollisionOptions TLNFlag = TopLevelNameCollisionOptions.None; DomainCollisionOptions domainFlag = DomainCollisionOptions.None; if (type == ForestTrustCollisionType.TopLevelName) { TLNFlag = (TopLevelNameCollisionOptions)record.Flags; } else if (type == ForestTrustCollisionType.Domain) { domainFlag = (DomainCollisionOptions)record.Flags; } ForestTrustRelationshipCollision tmp = new ForestTrustRelationshipCollision(type, TLNFlag, domainFlag, recordName); collection.Add(tmp); } ForestTrustCollisionException exception = new ForestTrustCollisionException(Res.GetString(Res.ForestTrustCollision), null, collection); return exception; }
public bool Contains(ForestTrustRelationshipCollision collision) { Contract.Requires(collision != null); return(default(bool)); }
internal int Add(ForestTrustRelationshipCollision collision) { return(base.InnerList.Add(collision)); }
public bool Contains (ForestTrustRelationshipCollision collision) { throw new NotImplementedException (); }
public void CopyTo(ForestTrustRelationshipCollision[] array, int index) { Contract.Requires(array != null); }
public int IndexOf (ForestTrustRelationshipCollision collision) { throw new NotImplementedException (); }
public bool Contains(ForestTrustRelationshipCollision collision) { Contract.Requires(collision != null); return default(bool); }
public void CopyTo (ForestTrustRelationshipCollision[] array, int index) { throw new NotImplementedException (); }
public void CopyTo(ForestTrustRelationshipCollision[] array, int index) { base.InnerList.CopyTo(array, index); }
public bool Contains(ForestTrustRelationshipCollision collision) { throw new NotImplementedException(); }
public int IndexOf(ForestTrustRelationshipCollision collision) { throw new NotImplementedException(); }
internal int Add(ForestTrustRelationshipCollision collision) { return base.InnerList.Add(collision); }
internal static Exception CreateForestTrustCollisionException(IntPtr collisionInfo) { ForestTrustRelationshipCollisionCollection forestTrustRelationshipCollisionCollection = new ForestTrustRelationshipCollisionCollection(); LSA_FOREST_TRUST_COLLISION_INFORMATION lSAFORESTTRUSTCOLLISIONINFORMATION = new LSA_FOREST_TRUST_COLLISION_INFORMATION(); Marshal.PtrToStructure(collisionInfo, lSAFORESTTRUSTCOLLISIONINFORMATION); int recordCount = lSAFORESTTRUSTCOLLISIONINFORMATION.RecordCount; for (int i = 0; i < recordCount; i++) { IntPtr intPtr = Marshal.ReadIntPtr(lSAFORESTTRUSTCOLLISIONINFORMATION.Entries, i * Marshal.SizeOf(typeof(IntPtr))); LSA_FOREST_TRUST_COLLISION_RECORD lSAFORESTTRUSTCOLLISIONRECORD = new LSA_FOREST_TRUST_COLLISION_RECORD(); Marshal.PtrToStructure(intPtr, lSAFORESTTRUSTCOLLISIONRECORD); ForestTrustCollisionType type = lSAFORESTTRUSTCOLLISIONRECORD.Type; string stringUni = Marshal.PtrToStringUni(lSAFORESTTRUSTCOLLISIONRECORD.Name.Buffer, lSAFORESTTRUSTCOLLISIONRECORD.Name.Length / 2); TopLevelNameCollisionOptions flags = TopLevelNameCollisionOptions.None; DomainCollisionOptions domainCollisionOption = DomainCollisionOptions.None; if (type != ForestTrustCollisionType.TopLevelName) { if (type == ForestTrustCollisionType.Domain) { domainCollisionOption = (DomainCollisionOptions)lSAFORESTTRUSTCOLLISIONRECORD.Flags; } } else { flags = (TopLevelNameCollisionOptions)lSAFORESTTRUSTCOLLISIONRECORD.Flags; } ForestTrustRelationshipCollision forestTrustRelationshipCollision = new ForestTrustRelationshipCollision(type, flags, domainCollisionOption, stringUni); forestTrustRelationshipCollisionCollection.Add(forestTrustRelationshipCollision); } ForestTrustCollisionException forestTrustCollisionException = new ForestTrustCollisionException(Res.GetString("ForestTrustCollision"), null, forestTrustRelationshipCollisionCollection); return forestTrustCollisionException; }