Ejemplo n.º 1
0
        public static void DisableMinimization()
        {
            Exception ex = null;

            try
            {
                IRegistryWriter instance = RegistryWriter.Instance;
                instance.SetValue(Registry.LocalMachine, "SOFTWARE\\Microsoft\\ExchangeServer\\v15\\Replay\\Parameters", "DisableADObjectMinimize", 1, RegistryValueKind.DWord);
            }
            catch (IOException ex2)
            {
                ex = ex2;
            }
            catch (UnauthorizedAccessException ex3)
            {
                ex = ex3;
            }
            catch (SecurityException ex4)
            {
                ex = ex4;
            }
            if (ex != null)
            {
                ADObjectWrapperBase.Tracer.TraceError <Exception>(0L, "DisableMinimization caught {0}", ex);
            }
        }
Ejemplo n.º 2
0
        public IDictionary <Guid, FailureRec> GetQuarantinedJobs()
        {
            IRegistryReader instance  = RegistryReader.Instance;
            IRegistryWriter instance2 = RegistryWriter.Instance;

            string[] array = null;
            try
            {
                array = instance.GetSubKeyNames(Registry.LocalMachine, JobQuarantineProvider.KeyNameFormatQuarantinedJobRoot);
            }
            catch (ArgumentException)
            {
            }
            if (array == null)
            {
                return(new Dictionary <Guid, FailureRec>());
            }
            Dictionary <Guid, FailureRec> dictionary = new Dictionary <Guid, FailureRec>(array.Length);

            string[] array2 = array;
            int      i      = 0;

            while (i < array2.Length)
            {
                string text       = array2[i];
                Guid   key        = Guid.Empty;
                string subkeyName = Path.Combine(JobQuarantineProvider.KeyNameFormatQuarantinedJobRoot, text);
                try
                {
                    key = new Guid(text);
                }
                catch (FormatException)
                {
                    try
                    {
                        instance2.DeleteSubKeyTree(Registry.LocalMachine, subkeyName);
                    }
                    catch (ArgumentException)
                    {
                    }
                    goto IL_118;
                }
                goto IL_80;
IL_118:
                i++;
                continue;
IL_80:
                string value = instance.GetValue <string>(Registry.LocalMachine, subkeyName, "FailureType", string.Empty);
                string     value2 = instance.GetValue <string>(Registry.LocalMachine, subkeyName, "Message", string.Empty);
                string     value3 = instance.GetValue <string>(Registry.LocalMachine, subkeyName, "StackTrace", string.Empty);
                string     value4 = instance.GetValue <string>(Registry.LocalMachine, subkeyName, "DataContext", string.Empty);
                string     value5 = instance.GetValue <string>(Registry.LocalMachine, subkeyName, "InnerException", string.Empty);
                FailureRec value6 = FailureRec.Create(value, value2, value3, value4, value5);
                dictionary.Add(key, value6);
                goto IL_118;
            }
            return(dictionary);
        }
Ejemplo n.º 3
0
        public static Exception PublishDagNetConfig(string persistString)
        {
            Exception ex = RegistryUtil.RunRegistryFunction(delegate()
            {
                IRegistryWriter registryWriter = Dependencies.RegistryWriter;
                registryWriter.CreateSubKey(Registry.LocalMachine, DagNetEnvironment.RegistryRootKeyName);
                registryWriter.SetValue(Registry.LocalMachine, DagNetEnvironment.RegistryRootKeyName, "DagNetConfig", persistString);
            });

            if (ex != null)
            {
                DagNetEnvironment.Tracer.TraceError(0L, "PublishDagNetConfig fails: {0}", new object[]
                {
                    ex
                });
            }
            return(ex);
        }
Ejemplo n.º 4
0
        public static Exception WriteCompressionConfigString(string xmlString)
        {
            Exception result = null;

            try
            {
                IRegistryWriter instance = RegistryWriter.Instance;
                instance.SetValue(Registry.LocalMachine, "SOFTWARE\\Microsoft\\ExchangeServer\\v15\\Replay\\Parameters", "CompressionConfig", xmlString, RegistryValueKind.String);
            }
            catch (IOException ex)
            {
                result = ex;
            }
            catch (UnauthorizedAccessException ex2)
            {
                result = ex2;
            }
            catch (SecurityException ex3)
            {
                result = ex3;
            }
            return(result);
        }
Ejemplo n.º 5
0
        public static Exception WriteCompressionConfigString(string xmlString)
        {
            Exception result = null;

            try
            {
                IRegistryWriter instance = RegistryWriter.Instance;
                instance.SetValue(Registry.LocalMachine, Parameters.CurrentValues.RegistryRootKeyName, "CompressionConfig", xmlString, RegistryValueKind.String);
            }
            catch (IOException ex)
            {
                result = ex;
            }
            catch (UnauthorizedAccessException ex2)
            {
                result = ex2;
            }
            catch (SecurityException ex3)
            {
                result = ex3;
            }
            return(result);
        }