<CDefines Condition="'$(FeatureCominteropTlbSupport)' == 'true'">$(CDefines);FEATURE_COMINTEROP_TLB_SUPPORT</CDefines>
<CDefines Condition="'$(FeatureCominteropUnmanagedActivation)' == 'true'">$(CDefines);FEATURE_COMINTEROP_UNMANAGED_ACTIVATION</CDefines>
<CDefines Condition="'$(FeatureCominteropWinRTManagedActivation)' == 'true'">$(CDefines);FEATURE_COMINTEROP_WINRT_MANAGED_ACTIVATION</CDefines> <!-- Enables code required to activate managed winrt from native-->
- <CDefines Condition="'$(FeatureCominteropWinRTDesktopHost)' == 'true'">$(CDefines);FEATURE_COMINTEROP_WINRT_DESKTOP_HOST</CDefines>
<CDefines Condition="'$(FeatureCompressedstack)' == 'true'">$(CDefines);FEATURE_COMPRESSEDSTACK</CDefines>
<CDefines Condition="'$(FeatureCoreFxGlobalization)' == 'true'">$(CDefines);FEATURE_COREFX_GLOBALIZATION</CDefines>
<CDefines Condition="'$(FeatureCrypto)' == 'true'">$(CDefines);FEATURE_CRYPTO</CDefines>
<DefineConstants Condition="'$(FeatureCominteropApartmentSupport)' == 'true'">$(DefineConstants);FEATURE_COMINTEROP_APARTMENT_SUPPORT</DefineConstants>
<DefineConstants Condition="'$(FeatureCominteropUnmanagedActivation)' == 'true'">$(DefineConstants);FEATURE_COMINTEROP_UNMANAGED_ACTIVATION</DefineConstants>
<DefineConstants Condition="'$(FeatureCominteropWinRTManagedActivation)' == 'true'">$(DefineConstants);FEATURE_COMINTEROP_WINRT_MANAGED_ACTIVATION</DefineConstants>
- <DefineConstants Condition="'$(FeatureCominteropWinRTDesktopHost)' == 'true'">$(DefineConstants);FEATURE_COMINTEROP_WINRT_DESKTOP_HOST</DefineConstants>
<DefineConstants Condition="'$(FeatureCompressedstack)' == 'true'">$(DefineConstants);FEATURE_COMPRESSEDSTACK</DefineConstants>
<DefineConstants Condition="'$(FeatureCoreFxGlobalization)' == 'true'">$(DefineConstants);FEATURE_COREFX_GLOBALIZATION</DefineConstants>
<DefineConstants Condition="'$(FeatureCrypto)' == 'true'">$(DefineConstants);FEATURE_CRYPTO</DefineConstants>
<FeatureCominteropTlbSupport>true</FeatureCominteropTlbSupport>
<FeatureCominteropUnmanagedActivation>true</FeatureCominteropUnmanagedActivation>
<FeatureCominteropWinRTManagedActivation>true</FeatureCominteropWinRTManagedActivation>
- <FeatureCominteropWinRTDesktopHost>true</FeatureCominteropWinRTDesktopHost>
<FeatureCompressedstack>true</FeatureCompressedstack>
<FeatureCrypto>true</FeatureCrypto>
<FeatureDbgPublish>true</FeatureDbgPublish>
Interop.COM_TypeMismatch = Type mismatch between source and destination types.
Interop_Marshal_Unmappable_Char = Cannot marshal: Encountered unmappable character.
-#if FEATURE_COMINTEROP_WINRT_DESKTOP_HOST
-WinRTHostDomainName = Windows Runtime Object Host Domain for '{0}'
-#endif
-
;
; Loader Exceptions
;
return activationFactory;
}
-#if FEATURE_COMINTEROP_WINRT_DESKTOP_HOST
- // Currently we use only a single class activator since we have a requirement that all class activations come from the same
- // app base and we haven't sorted through the various code sharing implications of spinning up multiple AppDomains. This
- // holds the IWinRTClassActivator* that is used for the process
- private static IntPtr s_pClassActivator = IntPtr.Zero;
-
- internal static IntPtr GetClassActivatorForApplication(string appBase)
- {
- if (s_pClassActivator == IntPtr.Zero)
- {
- AppDomainSetup hostDomainSetup = new AppDomainSetup()
- {
- ApplicationBase = appBase,
- };
-
- AppDomain hostDomain = AppDomain.CreateDomain(Environment.GetResourceString("WinRTHostDomainName", appBase), null, hostDomainSetup);
- WinRTClassActivator activator = (WinRTClassActivator)hostDomain.CreateInstanceAndUnwrap(typeof(WinRTClassActivator).Assembly.FullName, typeof(WinRTClassActivator).FullName);
- IntPtr pActivator = activator.GetIWinRTClassActivator();
-
- if (Interlocked.CompareExchange(ref s_pClassActivator, pActivator, IntPtr.Zero) != IntPtr.Zero)
- {
- Marshal.Release(pActivator);
- activator = null;
-
- try
- {
- AppDomain.Unload(hostDomain);
- }
- catch (CannotUnloadAppDomainException) { }
- }
- }
-
- Marshal.AddRef(s_pClassActivator);
- return s_pClassActivator;
- }
-#endif // FEATURE_COMINTEROP_WINRT_DESKTOP_HOST
#endif // FEATURE_COMINTEROP_WINRT_MANAGED_ACTIVATION