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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
		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;
		}
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
 public ForestTrustCollisionException(string message, Exception inner, ForestTrustRelationshipCollisionCollection collisions) : base(message, inner)
 {
     _collisions = collisions;
 }
 public ForestTrustCollisionException() : base(Res.GetString("ForestTrustCollision"))
 {
     this.collisions = new ForestTrustRelationshipCollisionCollection();
 }
 public ForestTrustCollisionException(string message, Exception inner, ForestTrustRelationshipCollisionCollection collisions)
 {
 }
 public ForestTrustCollisionException(string message, Exception inner, ForestTrustRelationshipCollisionCollection collisions)
 {
 }
Exemplo n.º 10
0
        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;
        }
Exemplo n.º 11
0
		public ForestTrustCollisionException (string message, Exception inner, ForestTrustRelationshipCollisionCollection collisions) : base(message, inner)
		{
			throw new NotImplementedException ();
		}
 protected ForestTrustCollisionException(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     this.collisions = new ForestTrustRelationshipCollisionCollection();
 }
 public ForestTrustCollisionException(string message, Exception inner) : base(message, inner)
 {
     this.collisions = new ForestTrustRelationshipCollisionCollection();
 }
 public ForestTrustCollisionException(string message, Exception inner, ForestTrustRelationshipCollisionCollection collisions) : base(message, inner)
 {
     throw new NotImplementedException();
 }
 public ForestTrustCollisionException(string message, Exception inner, ForestTrustRelationshipCollisionCollection collisions) : base(message, inner)
 {
     this.collisions = new ForestTrustRelationshipCollisionCollection();
     this.collisions = collisions;
 }
 protected ForestTrustCollisionException(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     this.collisions = new ForestTrustRelationshipCollisionCollection();
 }
 public ForestTrustCollisionException(string message) : base(message)
 {
     this.collisions = new ForestTrustRelationshipCollisionCollection();
 }
 public ForestTrustCollisionException() : base(Res.GetString("ForestTrustCollision"))
 {
     this.collisions = new ForestTrustRelationshipCollisionCollection();
 }