Exemple #1
0
 internal void ExecuteApplicationStart(object sender, EventArgs e)
 {
     ExTraceGlobals.CoreCallTracer.TraceDebug(0L, "Global.Application_Start");
     try
     {
         if (OwaApplicationBase.IsRunningDfpowa)
         {
             string          localPath   = new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath;
             DirectoryInfo[] directories = Directory.GetParent(Directory.GetParent(localPath).FullName).GetDirectories("Config");
             if (directories.Length > 0)
             {
                 VariantConfiguration.Initialize(directories[0].FullName);
             }
         }
         Globals.Initialize(this.OwaVDirType);
         Kerberos.FlushTicketCache();
         SmallIconManager.Initialize();
         ThemeManager.Initialize();
         FormsRegistryManager.Initialize(HttpRuntime.AppDomainAppPath);
         ADCustomPropertyParser.Initialize(HttpRuntime.AppDomainAppPath);
         PerformanceCounterManager.InitializePerformanceCounters();
         ProxyEventHandler.Initialize();
         ExRpcModule.Bind();
         UIExtensionManager.Initialize();
         HelpProvider.Initialize(HelpProvider.HelpAppName.Owa);
         this.ExecuteApplicationSpecificStart();
     }
     catch (OwaSmallIconManagerInitializationException initializationError)
     {
         ExTraceGlobals.CoreTracer.TraceDebug(0L, "Application initialization failed");
         Globals.InitializationError = initializationError;
         return;
     }
     catch (OwaThemeManagerInitializationException initializationError2)
     {
         ExTraceGlobals.CoreTracer.TraceDebug(0L, "Application initialization failed");
         Globals.InitializationError = initializationError2;
         return;
     }
     catch (OwaFormsRegistryInitializationException initializationError3)
     {
         ExTraceGlobals.CoreTracer.TraceDebug(0L, "Application initialization failed");
         Globals.InitializationError = initializationError3;
         return;
     }
     catch (OwaInvalidConfigurationException ex)
     {
         ExTraceGlobals.CoreTracer.TraceDebug(0L, "Application initialization failed because of a problem with configuration: " + ex.Message);
         Globals.InitializationError = ex;
         return;
     }
     catch (OwaWin32Exception ex2)
     {
         ExTraceGlobals.CoreTracer.TraceDebug <int>(0L, "Application initialization failed with a win32 error: {0}", ex2.LastError);
         Globals.InitializationError = ex2;
         return;
     }
     catch (Exception initializationError4)
     {
         ExTraceGlobals.CoreTracer.TraceDebug(0L, "Application initialization failed");
         Globals.InitializationError = initializationError4;
         throw;
     }
     Globals.IsInitialized = true;
     ExTraceGlobals.CoreTracer.TraceDebug(0L, "Application initialization succeeded");
     if (Globals.IsPreCheckinApp)
     {
         OwaDiagnostics.Logger.LogEvent(ClientsEventLogConstants.Tuple_DfpOwaStartedSuccessfully, string.Empty, new object[0]);
         return;
     }
     OwaDiagnostics.Logger.LogEvent(ClientsEventLogConstants.Tuple_OwaStartedSuccessfully, string.Empty, new object[0]);
 }
Exemple #2
0
        // Token: 0x06000356 RID: 854 RVA: 0x0000D224 File Offset: 0x0000B424
        internal void ExecuteApplicationStart(object sender, EventArgs e)
        {
            ExTraceGlobals.CoreCallTracer.TraceDebug(0L, "Global.Application_Start");
            try
            {
                int num = Privileges.RemoveAllExcept(new string[]
                {
                    "SeAuditPrivilege",
                    "SeChangeNotifyPrivilege",
                    "SeCreateGlobalPrivilege",
                    "SeImpersonatePrivilege",
                    "SeIncreaseQuotaPrivilege",
                    "SeAssignPrimaryTokenPrivilege"
                }, "MSExchangeOWAAppPool");
                if (num != 0)
                {
                    throw new OwaWin32Exception(num, "Failed to remove unnecessary privileges");
                }
                if (BaseApplication.IsRunningDfpowa)
                {
                    string          localPath   = new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath;
                    DirectoryInfo[] directories = Directory.GetParent(Directory.GetParent(localPath).FullName).GetDirectories("Config");
                    if (directories.Length > 0)
                    {
                        VariantConfiguration.Initialize(directories[0].FullName);
                    }
                }
                string applicationName = this.IsPreCheckinApp ? "PCDFOWA" : "OWA";
                Globals.InitializeMultiPerfCounterInstance(applicationName);
                Globals.Initialize();
                Kerberos.FlushTicketCache();
                ExRpcModule.Bind();
                this.ExecuteApplicationSpecificStart();
            }
            catch (OwaWin32Exception ex)
            {
                ExTraceGlobals.CoreTracer.TraceDebug <int>(0L, "Application initialization failed with a win32 error: {0}", ex.LastError);
                Globals.InitializationError = ex;
                return;
            }
            catch (Exception initializationError)
            {
                ExTraceGlobals.CoreTracer.TraceDebug(0L, "Application initialization failed");
                Globals.InitializationError = initializationError;
                throw;
            }
            Globals.IsInitialized = true;
            ExTraceGlobals.CoreTracer.TraceDebug(0L, "Application initialization succeeded");
            int id = Process.GetCurrentProcess().Id;

            if (Globals.IsPreCheckinApp)
            {
                OwaDiagnostics.Logger.LogEvent(ClientsEventLogConstants.Tuple_DfpOwaStartedSuccessfully, string.Empty, new object[]
                {
                    id
                });
                return;
            }
            OwaDiagnostics.Logger.LogEvent(ClientsEventLogConstants.Tuple_OwaStartedSuccessfully, string.Empty, new object[]
            {
                id
            });
            OwaDiagnostics.PublishMonitoringEventNotification(ExchangeComponent.Owa.Name, "OwaWebAppStarted", "Outlook Web App started successfully", ResultSeverityLevel.Error);
        }