Пример #1
0
		private bool ValidateDynamicParameters(string path, ADProviderCommonParameters parameters, ADSessionInfo sessionInfo)
		{
			bool flag;
			if (parameters != null)
			{
				try
				{
					parameters.ValidateParameters();
					goto Label0;
				}
				catch (ArgumentException argumentException1)
				{
					ArgumentException argumentException = argumentException1;
					base.WriteError(ADUtilities.GetErrorRecord(argumentException, "ADProvider:ValidateDynamicParameters:InvalidArgument", path));
					this.Trace(DebugLogLevel.Error, "Leaving ValidateDynamicParameters: ArgumentException: InvalidArgument");
					flag = false;
				}
				return flag;
			}
			return true;
		Label0:
			if (this.GetHostType(parameters, this.ExtendedDriveInfo) == ADPathHostType.GC)
			{
				ADRootDSE rootDSE = this.GetRootDSE(sessionInfo);
				if (rootDSE.ServerType != ADServerType.ADLDS)
				{
					if (sessionInfo.EffectivePortNumber != LdapConstants.LDAP_GC_PORT && sessionInfo.EffectivePortNumber != LdapConstants.LDAP_SSL_GC_PORT)
					{
						base.WriteError(ADUtilities.GetErrorRecord(new ArgumentException(StringResources.ADProviderGCInvalidWithAppendedPort), "ADProvider:ValidateDynamicParameters:GC with appened server port which is not equal to the GC port ", path));
						this.Trace(DebugLogLevel.Error, "Leaving ValidateDynamicParameters: ArgumentException: GC with appened server port which is not equal to the GC port ");
						return false;
					}
					else
					{
						return true;
					}
				}
				else
				{
					base.WriteError(ADUtilities.GetErrorRecord(new ArgumentException(StringResources.ADProviderGCInvalidForADLDS), "ADProvider:ValidateDynamicParameters:GC with ADLDS", path));
					this.Trace(DebugLogLevel.Error, "Leaving ValidateDynamicParameters: ArgumentException: GC with ADLDS");
					return false;
				}
			}
			else
			{
				return true;
			}
		}