コード例 #1
0
        internal ProcessHostMapPath(IProcessHostSupportFunctions functions)
        {
            // if the functions are null and we're
            // not in a worker process, init the mgdeng config system
            if (null == functions)
            {
                ProcessHostConfigUtils.InitStandaloneConfig();
            }

            // we need to explicit create a COM proxy in this app domain
            // so we don't go back to the default domain or have lifetime issues
            if (null != functions)
            {
                _functions = Misc.CreateLocalSupportFunctions(functions);
            }

            // proactive set the config functions for
            // webengine in case this is a TCP init path
            if (null != _functions)
            {
                IntPtr configSystem = _functions.GetNativeConfigurationSystem();
                Debug.Assert(IntPtr.Zero != configSystem, "null != configSystem");

                if (IntPtr.Zero != configSystem)
                {
                    // won't fail if valid pointer
                    // no cleanup needed, we don't own instance
                    UnsafeIISMethods.MgdSetNativeConfiguration(configSystem);
                }
            }
        }
コード例 #2
0
        ProcessHostServerConfig()
        {
            if (null == HostingEnvironment.SupportFunctions)
            {
                ProcessHostConfigUtils.InitStandaloneConfig();
            }
            else
            {
                IProcessHostSupportFunctions fns = HostingEnvironment.SupportFunctions;
                if (null != fns)
                {
                    IntPtr configSystem = fns.GetNativeConfigurationSystem();
                    Debug.Assert(IntPtr.Zero != configSystem, "null != configSystem");

                    if (IntPtr.Zero != configSystem)
                    {
                        // won't fail if valid pointer
                        // no cleanup needed, we don't own instance
                        UnsafeIISMethods.MgdSetNativeConfiguration(configSystem);
                    }
                }
            }
            _siteNameForCurrentApplication = HostingEnvironment.SiteNameNoDemand;
            if (_siteNameForCurrentApplication == null)
            {
                _siteNameForCurrentApplication = ProcessHostConfigUtils.GetSiteNameFromId(ProcessHostConfigUtils.DEFAULT_SITE_ID_UINT);
            }
        }
コード例 #3
0
 private ProcessHostServerConfig()
 {
     if (HostingEnvironment.SupportFunctions == null)
     {
         ProcessHostConfigUtils.InitStandaloneConfig();
     }
     else
     {
         IProcessHostSupportFunctions supportFunctions = HostingEnvironment.SupportFunctions;
         if (supportFunctions != null)
         {
             IntPtr nativeConfigurationSystem = supportFunctions.GetNativeConfigurationSystem();
             if (IntPtr.Zero != nativeConfigurationSystem)
             {
                 UnsafeIISMethods.MgdSetNativeConfiguration(nativeConfigurationSystem);
             }
         }
     }
     this._siteNameForCurrentApplication = HostingEnvironment.SiteNameNoDemand;
     if (this._siteNameForCurrentApplication == null)
     {
         this._siteNameForCurrentApplication = ProcessHostConfigUtils.GetSiteNameFromId(1);
     }
 }