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);
        }
コード例 #2
0
ファイル: ExceptionHelper.cs プロジェクト: modulexcite/pash-1
        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);
        }
コード例 #3
0
        public int IndexOf(ForestTrustRelationshipCollision collision)
        {
            if (collision == null)
                throw new ArgumentNullException("collision");

            return InnerList.IndexOf(collision);
        }
コード例 #4
0
        public bool Contains(ForestTrustRelationshipCollision collision)
        {
            if (collision == null)
                throw new ArgumentNullException("collision");

            return InnerList.Contains(collision);
        }
コード例 #5
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));
        }
    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));
        }
コード例 #10
0
		public bool Contains(ForestTrustRelationshipCollision collision)
		{
			if (collision != null)
			{
				return base.InnerList.Contains(collision);
			}
			else
			{
				throw new ArgumentNullException("collision");
			}
		}
コード例 #11
0
		public int IndexOf(ForestTrustRelationshipCollision collision)
		{
			if (collision != null)
			{
				return base.InnerList.IndexOf(collision);
			}
			else
			{
				throw new ArgumentNullException("collision");
			}
		}
コード例 #12
0
ファイル: Exception.cs プロジェクト: ThE-TiGeR/DotnetRuntime
        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);
        }
コード例 #13
0
ファイル: Exception.cs プロジェクト: chcosta/corefx
        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));
 }
コード例 #16
0
		public bool Contains (ForestTrustRelationshipCollision collision)
		{
			throw new NotImplementedException ();
		}
 public void CopyTo(ForestTrustRelationshipCollision[] array, int index)
 {
   Contract.Requires(array != null);
 }
コード例 #18
0
		public int IndexOf (ForestTrustRelationshipCollision collision)
		{
			throw new NotImplementedException ();
		}
    public bool Contains(ForestTrustRelationshipCollision collision)
    {
      Contract.Requires(collision != null);

      return default(bool);
    }
コード例 #20
0
		public void CopyTo (ForestTrustRelationshipCollision[] array, int index)
		{
			throw new NotImplementedException ();
		}
コード例 #21
0
		public void CopyTo(ForestTrustRelationshipCollision[] array, int index)
		{
			base.InnerList.CopyTo(array, index);
		}
コード例 #22
0
 public bool Contains(ForestTrustRelationshipCollision collision)
 {
     throw new NotImplementedException();
 }
コード例 #23
0
 public int IndexOf(ForestTrustRelationshipCollision collision)
 {
     throw new NotImplementedException();
 }
コード例 #24
0
		internal int Add(ForestTrustRelationshipCollision collision)
		{
			return base.InnerList.Add(collision);
		}
コード例 #25
0
ファイル: ExceptionHelper.cs プロジェクト: nickchal/pash
		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;
		}