</ItemGroup>
<ItemGroup Condition="'$(TargetsWindows)' == 'true'">
<Compile Include="$(BclSourcesRoot)\Interop\Windows\Kernel32\Interop.GetSystemDirectoryW.cs" />
+ <Compile Include="$(BclSourcesRoot)\System\ApplicationModel.Windows.cs" />
<Compile Include="$(BclSourcesRoot)\System\Diagnostics\DebugProvider.Windows.cs" />
<Compile Include="$(BclSourcesRoot)\System\Globalization\CultureInfo.Windows.cs" />
<Compile Include="$(BclSourcesRoot)\System\Globalization\GlobalizationMode.Windows.cs" />
private IntPtr _pDomain; // this is an unmanaged pointer (AppDomain * m_pDomain)` used from the VM.
-#if FEATURE_APPX
- private static APPX_FLAGS s_flags;
-
- //
- // Keep in async with vm\appdomainnative.cpp
- //
- [Flags]
- private enum APPX_FLAGS
- {
- APPX_FLAGS_INITIALIZED = 0x01,
-
- APPX_FLAGS_APPX_MODEL = 0x02,
- }
-
- private static APPX_FLAGS Flags
- {
- get
- {
- if (s_flags == 0)
- s_flags = nGetAppXFlags();
-
- Debug.Assert(s_flags != 0);
- return s_flags;
- }
- }
-
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [return: MarshalAs(UnmanagedType.I4)]
- private static extern APPX_FLAGS nGetAppXFlags();
-#endif
-
/// <summary>
/// If this AppDomain is configured to have an AppDomain manager then create the instance of it.
/// This method is also called from the VM to create the domain manager in the default domain.
}
}
- /// <summary>
- /// Returns whether the current AppDomain follows the AppX rules.
- /// </summary>
- [Pure]
- internal static bool IsAppXModel()
- {
-#if FEATURE_APPX
- return (Flags & APPX_FLAGS.APPX_FLAGS_APPX_MODEL) != 0;
-#else
- return false;
-#endif
- }
-
- /// <summary>
- /// Checks (and throws on failure) if the domain supports Assembly.LoadFrom.
- /// </summary>
- [Pure]
- internal static void CheckLoadFromSupported()
- {
-#if FEATURE_APPX
- if (IsAppXModel())
- throw new NotSupportedException(SR.Format(SR.NotSupported_AppX, "Assembly.LoadFrom"));
-#endif
- }
-
- /// <summary>
- /// Checks (and throws on failure) if the domain supports Assembly.LoadFile.
- /// </summary>
- [Pure]
- internal static void CheckLoadFileSupported()
- {
-#if FEATURE_APPX
- if (IsAppXModel())
- throw new NotSupportedException(SR.Format(SR.NotSupported_AppX, "Assembly.LoadFile"));
-#endif
- }
-
- /// <summary>
- /// Checks (and throws on failure) if the domain supports Assembly.Load(byte[] ...).
- /// </summary>
- [Pure]
- internal static void CheckLoadByteArraySupported()
- {
-#if FEATURE_APPX
- if (IsAppXModel())
- throw new NotSupportedException(SR.Format(SR.NotSupported_AppX, "Assembly.Load(byte[], ...)"));
-#endif
- }
-
public static AppDomain CurrentDomain => Thread.GetDomain();
[MethodImpl(MethodImplOptions.InternalCall)]
- private extern Assembly[] nGetAssemblies(bool forIntrospection);
-
- internal Assembly[] GetAssemblies(bool forIntrospection)
- {
- return nGetAssemblies(forIntrospection);
- }
-
- [MethodImpl(MethodImplOptions.InternalCall)]
internal static extern void PublishAnonymouslyHostedDynamicMethodsAssembly(RuntimeAssembly assemblyHandle);
[Obsolete("AppDomain.GetCurrentThreadId has been deprecated because it does not provide a stable Id when managed threads are running on fibers (aka lightweight threads). To get a stable identifier for a managed thread, use the ManagedThreadId property on Thread. http://go.microsoft.com/fwlink/?linkid=14202", false)]
[MethodImpl(MethodImplOptions.InternalCall)]
private extern void nSetupFriendlyName(string friendlyName);
- [MethodImpl(MethodImplOptions.InternalCall)]
- internal extern string IsStringInterned(string str);
-
- [MethodImpl(MethodImplOptions.InternalCall)]
- internal extern string GetOrInternString(string str);
-
public int Id => GetId();
[MethodImpl(MethodImplOptions.InternalCall)]
--- /dev/null
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+namespace System
+{
+ internal static class ApplicationModel
+ {
+#if FEATURE_APPX
+ // Cache the value in readonly static that can be optimized out by the JIT
+ internal readonly static bool IsUap = IsAppXProcess();
+
+ [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
+ private static extern bool IsAppXProcess();
+#endif
+ }
+}
return GetEnvironmentVariableCore(variable);
#if FEATURE_WIN32_REGISTRY
- if (AppDomain.IsAppXModel())
+ if (ApplicationModel.IsUap)
#endif
{
return null;
internal static IEnumerable<KeyValuePair<string, string>> EnumerateEnvironmentVariablesFromRegistry(EnvironmentVariableTarget target)
{
#if FEATURE_WIN32_REGISTRY
- if (AppDomain.IsAppXModel())
+ if (ApplicationModel.IsUap)
#endif
{
// Without registry support we have nothing to return
}
#if FEATURE_WIN32_REGISTRY
- if (AppDomain.IsAppXModel())
+ if (ApplicationModel.IsUap)
#endif
{
// other targets ignored
string tmpStackTraceString;
#if FEATURE_APPX
- if (AppDomain.IsAppXModel())
+ if (ApplicationModel.IsUap)
{
// Call our internal GetStackTrace in AppX so we can parse the result should
// we need to strip file/line info from it to make it PII-free. Calling the
get
{
#if FEATURE_APPX
- if (AppDomain.IsAppXModel())
+ if (ApplicationModel.IsUap)
{
CultureInfo culture = GetCultureInfoForUserPreferredLanguageInAppX();
if (culture != null)
{
throw new ArgumentNullException(nameof(value));
}
-
+
#if FEATURE_APPX
- if (AppDomain.IsAppXModel())
+ if (ApplicationModel.IsUap)
{
if (SetCultureInfoForUserPreferredLanguageInAppX(value))
{
get
{
#if FEATURE_APPX
- if (AppDomain.IsAppXModel())
+ if (ApplicationModel.IsUap)
{
CultureInfo culture = GetCultureInfoForUserPreferredLanguageInAppX();
if (culture != null)
CultureInfo.VerifyCultureName(value, true);
#if FEATURE_APPX
- if (AppDomain.IsAppXModel())
+ if (ApplicationModel.IsUap)
{
if (SetCultureInfoForUserPreferredLanguageInAppX(value))
{
public static Assembly Load(byte[] rawAssembly,
byte[] rawSymbolStore)
{
- AppDomain.CheckLoadByteArraySupported();
-
if (rawAssembly == null)
throw new ArgumentNullException(nameof(rawAssembly));
+
+#if FEATURE_APPX
+ if (ApplicationModel.IsUap)
+ throw new NotSupportedException(SR.Format(SR.NotSupported_AppX, "Assembly.Load(byte[], ...)"));
+#endif
+
AssemblyLoadContext alc = new IndividualAssemblyLoadContext();
MemoryStream assemblyStream = new MemoryStream(rawAssembly);
MemoryStream symbolStream = (rawSymbolStore != null) ? new MemoryStream(rawSymbolStore) : null;
public static Assembly LoadFile(string path)
{
- AppDomain.CheckLoadFileSupported();
-
- Assembly result = null;
if (path == null)
throw new ArgumentNullException(nameof(path));
+#if FEATURE_APPX
+ if (ApplicationModel.IsUap)
+ throw new NotSupportedException(SR.Format(SR.NotSupported_AppX, "Assembly.LoadFile"));
+#endif
+
if (PathInternal.IsPartiallyQualified(path))
{
throw new ArgumentException(SR.Argument_AbsolutePathRequired, nameof(path));
string normalizedPath = Path.GetFullPath(path);
+ Assembly result = null;
lock (s_loadfile)
{
if (s_loadfile.TryGetValue(normalizedPath, out result))
#region Constructor
- internal AssemblyBuilder(AppDomain domain,
- AssemblyName name,
+ internal AssemblyBuilder(AssemblyName name,
AssemblyBuilderAccess access,
ref StackCrawlMark stackMark,
IEnumerable<CustomAttributeBuilder> unsafeAssemblyAttributes)
assemblyAttributes = new List<CustomAttributeBuilder>(unsafeAssemblyAttributes);
}
- _internalAssemblyBuilder = (InternalAssemblyBuilder)nCreateDynamicAssembly(domain,
- name,
- ref stackMark,
- access);
+ _internalAssemblyBuilder = (InternalAssemblyBuilder)nCreateDynamicAssembly(name,
+ ref stackMark,
+ access);
_assemblyData = new AssemblyBuilderData(_internalAssemblyBuilder, access);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern Assembly nCreateDynamicAssembly(AppDomain domain,
- AssemblyName name,
+ private static extern Assembly nCreateDynamicAssembly(AssemblyName name,
ref StackCrawlMark stackMark,
AssemblyBuilderAccess access);
lock (typeof(AssemblyBuilderLock))
{
// We can only create dynamic assemblies in the current domain
- return new AssemblyBuilder(AppDomain.CurrentDomain,
- name,
+ return new AssemblyBuilder(name,
access,
ref stackMark,
unsafeAssemblyAttributes);
if (assemblyRef == null)
throw new ArgumentNullException(nameof(assemblyRef));
- if (assemblyRef.CodeBase != null)
+#if FEATURE_APPX
+ if (ApplicationModel.IsUap)
{
- AppDomain.CheckLoadFromSupported();
+ if (assemblyRef.CodeBase != null)
+ {
+ throw new NotSupportedException(SR.Format(SR.NotSupported_AppX, "Assembly.LoadFrom"));
+ }
}
+#endif
assemblyRef = (AssemblyName)assemblyRef.Clone();
if (assemblyRef.ProcessorArchitecture != ProcessorArchitecture.None)
internal const string ResFileExtension = ".resources";
internal const int ResFileExtensionLength = 10;
- private static volatile bool s_IsAppXModel;
-
[System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
private void Init()
{
Debug.Assert(_bUsingModernResourceManagement);
Debug.Assert(_WinRTResourceManager != null);
Debug.Assert(_PRIonAppXInitialized);
- Debug.Assert(AppDomain.IsAppXModel());
+ Debug.Assert(ApplicationModel.IsUap);
if (stringName.Length == 0)
return null;
{
if (resourcesAssembly != typeof(object).Assembly) // We are not loading resources for mscorlib
{
- // Cannot load the WindowsRuntimeResourceManager when in a compilation process, since it
- // lives in System.Runtime.WindowsRuntime and only mscorlib may be loaded for execution.
- if (AppDomain.IsAppXModel())
+ if (ApplicationModel.IsUap)
{
- s_IsAppXModel = true;
-
// If we have the type information from the ResourceManager(Type) constructor, we use it. Otherwise, we use BaseNameField.
string reswFilename = _locationInfo == null ? BaseNameField : _locationInfo.FullName;
throw new ArgumentNullException(nameof(name));
#if FEATURE_APPX
- if (s_IsAppXModel)
+ if (ApplicationModel.IsUap)
{
// If the caller explictily passed in a culture that was obtained by calling CultureInfo.CurrentUICulture,
// null it out, so that we re-compute it. If we use modern resource lookup, we may end up getting a "better"
throw new ArgumentNullException(nameof(name));
#if FEATURE_APPX
- if (s_IsAppXModel)
+ if (ApplicationModel.IsUap)
{
// If the caller explictily passed in a culture that was obtained by calling CultureInfo.CurrentUICulture,
// null it out, so that we re-compute it based on the Win32 value and not the AppX language list value.
internal static bool ReportUnhandledError(Exception e)
{
// Only report to the WinRT global exception handler in modern apps
- if (!AppDomain.IsAppXModel())
+ if (!ApplicationModel.IsUap)
{
return false;
}
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
private static extern void LoadFromPath(IntPtr ptrNativeAssemblyLoadContet, string ilPath, string niPath, ObjectHandleOnStack retAssembly);
- public static Assembly[] GetLoadedAssemblies()
- {
- return AppDomain.CurrentDomain.GetAssemblies(false);
- }
+ [MethodImpl(MethodImplOptions.InternalCall)]
+ public static extern Assembly[] GetLoadedAssemblies();
// These methods load assemblies into the current AssemblyLoadContext
// They may be used in the implementation of an AssemblyLoadContext derivation
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal extern bool TryGetTrailByte(out byte data);
+ [MethodImpl(MethodImplOptions.InternalCall)]
+ private extern string Intern();
+ [MethodImpl(MethodImplOptions.InternalCall)]
+ private extern string IsInterned();
+
public static string Intern(string str)
{
if (str == null)
throw new ArgumentNullException(nameof(str));
}
- return Thread.GetDomain().GetOrInternString(str);
+ return str.Intern();
}
public static string IsInterned(string str)
throw new ArgumentNullException(nameof(str));
}
- return Thread.GetDomain().IsStringInterned(str);
+ return str.IsInterned();
}
// Copies the source String (byte buffer) to the destination IntPtr memory allocated with len bytes.
SynchronizationContext context = Thread.CurrentThread.SynchronizationContext;
#if FEATURE_APPX
- if (context == null && AppDomain.IsAppXModel())
+ if (context == null && ApplicationModel.IsUap)
context = GetWinRTContext();
#endif
private static SynchronizationContext GetWinRTContext()
{
Debug.Assert(Environment.IsWinRTSupported);
- Debug.Assert(AppDomain.IsAppXModel());
+ Debug.Assert(ApplicationModel.IsUap);
//
// We call into the VM to get the dispatcher. This is because:
// Only do the IStringable cast when running under AppX for better compat
// Otherwise we could do a IStringable cast in classic apps which could introduce
// a thread transition which would lead to deadlock.
- if (AppDomain.IsAppXModel())
+ if (ApplicationModel.IsUap)
{
// Check whether the type implements IStringable.
if (this is IStringable stringableType)
END_QCALL;
}
-
-FCIMPL4(Object*, AppDomainNative::CreateDynamicAssembly, AppDomainBaseObject* refThisUNSAFE, AssemblyNameBaseObject* assemblyNameUNSAFE, StackCrawlMark* stackMark, INT32 access)
+FCIMPL3(Object*, AppDomainNative::CreateDynamicAssembly, AssemblyNameBaseObject* assemblyNameUNSAFE, StackCrawlMark* stackMark, INT32 access)
{
FCALL_CONTRACT;
//</TODO>
CreateDynamicAssemblyArgs args;
- args.refThis = (APPDOMAINREF) refThisUNSAFE;
args.assemblyName = (ASSEMBLYNAMEREF) assemblyNameUNSAFE;
args.loaderAllocator = NULL;
HELPER_METHOD_FRAME_BEGIN_RET_PROTECT((CreateDynamicAssemblyArgsGC&)args);
- AppDomain* pAppDomain = ValidateArg(args.refThis);
-
- Assembly *pAssembly = Assembly::CreateDynamic(pAppDomain, &args);
+ Assembly *pAssembly = Assembly::CreateDynamic(GetAppDomain(), &args);
refRetVal = (ASSEMBLYREF) pAssembly->GetExposedObject();
FCIMPLEND
#ifdef FEATURE_APPX
-
-//
-// Keep in sync with bcl\system\appdomain.cs
-//
-enum
-{
- APPX_FLAGS_INITIALIZED = 0x01,
-
- APPX_FLAGS_APPX_MODEL = 0x02,
-};
-
// static
-INT32 QCALLTYPE AppDomainNative::GetAppXFlags()
+BOOL QCALLTYPE AppDomainNative::IsAppXProcess()
{
QCALL_CONTRACT;
- UINT32 flags = APPX_FLAGS_INITIALIZED;
+ BOOL result;
BEGIN_QCALL;
- if (AppX::IsAppXProcess())
- {
- flags |= APPX_FLAGS_APPX_MODEL;
- }
+ result = AppX::IsAppXProcess();
END_QCALL;
- return flags;
+ return result;
}
-
#endif // FEATURE_APPX
-FCIMPL2(Object*, AppDomainNative::GetAssemblies, AppDomainBaseObject* refThisUNSAFE, CLR_BOOL forIntrospection);
+FCIMPL0(Object*, AppDomainNative::GetLoadedAssemblies)
{
FCALL_CONTRACT;
struct _gc
{
PTRARRAYREF AsmArray;
- APPDOMAINREF refThis;
} gc;
gc.AsmArray = NULL;
- gc.refThis = (APPDOMAINREF) refThisUNSAFE;
HELPER_METHOD_FRAME_BEGIN_RET_PROTECT(gc);
MethodTable * pAssemblyClass = MscorlibBinder::GetClass(CLASS__ASSEMBLY);
- AppDomain * pApp = ValidateArg(gc.refThis);
+ AppDomain * pApp = GetAppDomain();
// Allocate an array with as many elements as there are assemblies in this
// appdomain. This will usually be correct, but there may be assemblies
}
FCIMPLEND
-FCIMPL2(Object*, AppDomainNative::IsStringInterned, AppDomainBaseObject* refThisUNSAFE, StringObject* pStringUNSAFE)
+FCIMPL1(Object*, AppDomainNative::IsStringInterned, StringObject* pStringUNSAFE)
{
FCALL_CONTRACT;
- APPDOMAINREF refThis = (APPDOMAINREF)ObjectToOBJECTREF(refThisUNSAFE);
STRINGREF refString = ObjectToSTRINGREF(pStringUNSAFE);
STRINGREF* prefRetVal = NULL;
- HELPER_METHOD_FRAME_BEGIN_RET_2(refThis, refString);
-
- ValidateArg(refThis);
+ HELPER_METHOD_FRAME_BEGIN_RET_1(refString);
if (refString == NULL)
COMPlusThrow(kArgumentNullException, W("ArgumentNull_String"));
- prefRetVal = refThis->GetDomain()->IsStringInterned(&refString);
+ prefRetVal = GetAppDomain()->IsStringInterned(&refString);
HELPER_METHOD_FRAME_END();
}
FCIMPLEND
-FCIMPL2(Object*, AppDomainNative::GetOrInternString, AppDomainBaseObject* refThisUNSAFE, StringObject* pStringUNSAFE)
+FCIMPL1(Object*, AppDomainNative::GetOrInternString, StringObject* pStringUNSAFE)
{
FCALL_CONTRACT;
STRINGREF refRetVal = NULL;
- APPDOMAINREF refThis = (APPDOMAINREF) refThisUNSAFE;
STRINGREF pString = (STRINGREF) pStringUNSAFE;
- HELPER_METHOD_FRAME_BEGIN_RET_2(refThis, pString);
-
- ValidateArg(refThis);
+ HELPER_METHOD_FRAME_BEGIN_RET_1(pString);
if (pString == NULL)
COMPlusThrow(kArgumentNullException, W("ArgumentNull_String"));
- STRINGREF* stringVal = refThis->GetDomain()->GetOrInternString(&pString);
+ STRINGREF* stringVal = GetAppDomain()->GetOrInternString(&pString);
if (stringVal != NULL)
{
refRetVal = *stringVal;
}
FCIMPLEND
-
-FCIMPL1(Object*, AppDomainNative::GetDynamicDir, AppDomainBaseObject* refThisUNSAFE)
-{
- FCALL_CONTRACT;
-
- STRINGREF str = NULL;
- return OBJECTREFToObject(str);
-}
-FCIMPLEND
-
-FCIMPL2(StringObject*, AppDomainNative::nApplyPolicy, AppDomainBaseObject* refThisUNSAFE, AssemblyNameBaseObject* refAssemblyNameUNSAFE)
-{
- FCALL_CONTRACT;
-
- struct _gc
- {
- APPDOMAINREF refThis;
- ASSEMBLYNAMEREF assemblyName;
- STRINGREF rv;
- } gc;
-
- gc.refThis = (APPDOMAINREF)refThisUNSAFE;
- gc.assemblyName = (ASSEMBLYNAMEREF) refAssemblyNameUNSAFE;
- gc.rv = NULL;
-
- HELPER_METHOD_FRAME_BEGIN_RET_PROTECT(gc);
-
- AppDomain* pDomain;
- pDomain = ValidateArg(gc.refThis);
-
- if (gc.assemblyName == NULL)
- {
- COMPlusThrow(kArgumentNullException, W("ArgumentNull_AssemblyName"));
- }
- if( (gc.assemblyName->GetSimpleName() == NULL) )
- {
- COMPlusThrow(kArgumentException, W("Format_StringZeroLength"));
- }
- Thread *pThread = GetThread();
- CheckPointHolder cph(pThread->m_MarshalAlloc.GetCheckpoint()); //hold checkpoint for autorelease
-
- // Initialize spec
- AssemblySpec spec;
- spec.InitializeSpec(&(pThread->m_MarshalAlloc),
- &gc.assemblyName,
- FALSE /*fIsStringized*/
- );
-
- StackSString sDisplayName;
-
- spec.GetFileOrDisplayName(0,sDisplayName);
-
- gc.rv = StringObject::NewString(sDisplayName);
-
- HELPER_METHOD_FRAME_END();
- return (StringObject*)OBJECTREFToObject(gc.rv);
-}
-FCIMPLEND
-
FCIMPL1(UINT32, AppDomainNative::GetAppDomainId, AppDomainBaseObject* refThisUNSAFE)
{
FCALL_CONTRACT;
}
FCIMPLEND
#endif // FEATURE_APPDOMAIN_RESOURCE_MONITORING
-
-
static AppDomain *ValidateArg(APPDOMAINREF pThis);
static FCDECL2(void, SetupFriendlyName, AppDomainBaseObject* refThisUNSAFE, StringObject* strFriendlyNameUNSAFE);
- static FCDECL4(Object*, CreateDynamicAssembly, AppDomainBaseObject* refThisUNSAFE, AssemblyNameBaseObject* assemblyNameUNSAFE, StackCrawlMark* stackMark, INT32 access);
- static FCDECL2(Object*, GetAssemblies, AppDomainBaseObject* refThisUNSAFE, CLR_BOOL fForIntrospection);
- static FCDECL2(Object*, GetOrInternString, AppDomainBaseObject* refThisUNSAFE, StringObject* pStringUNSAFE);
- static FCDECL1(void, CreateContext, AppDomainBaseObject *refThisUNSAFE);
+ static FCDECL3(Object*, CreateDynamicAssembly, AssemblyNameBaseObject* assemblyNameUNSAFE, StackCrawlMark* stackMark, INT32 access);
+ static FCDECL0(Object*, GetLoadedAssemblies);
+ static FCDECL1(Object*, GetOrInternString, StringObject* pStringUNSAFE);
static void QCALLTYPE SetupBindingPaths(__in_z LPCWSTR wszTrustedPlatformAssemblies, __in_z LPCWSTR wszPlatformResourceRoots, __in_z LPCWSTR wszAppPaths, __in_z LPCWSTR wszAppNiPaths, __in_z LPCWSTR appLocalWinMD);
- static FCDECL1(Object*, GetDynamicDir, AppDomainBaseObject* refThisUNSAFE);
static FCDECL1(INT32, GetId, AppDomainBaseObject* refThisUNSAFE);
- static FCDECL1(void, ForceToSharedDomain, Object* pObjectUNSAFE);
- static FCDECL1(LPVOID, GetFusionContext, AppDomainBaseObject* refThis);
- static FCDECL2(Object*, IsStringInterned, AppDomainBaseObject* refThis, StringObject* pString);
- static FCDECL3(void, UpdateContextProperty, LPVOID fusionContext, StringObject* key, Object* value);
- static FCDECL2(StringObject*, nApplyPolicy, AppDomainBaseObject* refThisUNSAFE, AssemblyNameBaseObject* assemblyNameUNSAFE);
- static FCDECL2(FC_BOOL_RET, IsFrameworkAssembly, AppDomainBaseObject* refThisUNSAFE, AssemblyNameBaseObject* refAssemblyNameUNSAFE);
+ static FCDECL1(Object*, IsStringInterned, StringObject* pString);
static FCDECL1(UINT32, GetAppDomainId, AppDomainBaseObject* refThisUNSAFE);
static FCDECL1(void , PublishAnonymouslyHostedDynamicMethodsAssembly, AssemblyBaseObject * pAssemblyUNSAFE);
static void QCALLTYPE SetNativeDllSearchDirectories(__in_z LPCWSTR wszAssembly);
static FCDECL0(INT64, GetLastSurvivedProcessMemorySize);
#endif // FEATURE_APPDOMAIN_RESOURCE_MONITORING
-private:
- static INT32 ExecuteAssemblyHelper(Assembly* pAssembly,
- BOOL bCreatedConsole,
- PTRARRAYREF *pStringArgs);
-
-public:
#ifdef FEATURE_APPX
static
- INT32 QCALLTYPE GetAppXFlags();
+ INT32 QCALLTYPE IsAppXProcess();
#endif
};
struct CreateDynamicAssemblyArgsGC
{
- APPDOMAINREF refThis;
ASSEMBLYNAMEREF assemblyName;
LOADERALLOCATORREF loaderAllocator;
};
FCFuncElement("IsAscii", COMString::IsAscii)
FCFuncElement("SetTrailByte", COMString::FCSetTrailByte)
FCFuncElement("TryGetTrailByte", COMString::FCTryGetTrailByte)
+ FCFuncElement("IsInterned", AppDomainNative::IsStringInterned)
+ FCFuncElement("Intern", AppDomainNative::GetOrInternString)
FCFuncEnd()
FCFuncStart(gValueTypeFuncs)
QCFuncElement("DefineCustomAttribute", COMDynamicWrite::DefineCustomAttribute)
FCFuncEnd()
-
FCFuncStart(gCompatibilitySwitchFuncs)
FCFuncElement("GetValueInternalCall", CompatibilitySwitch::GetValue)
FCFuncEnd()
-
FCFuncStart(gAppDomainFuncs)
- FCFuncElement("IsStringInterned", AppDomainNative::IsStringInterned)
-
-#ifdef FEATURE_APPX
- QCFuncElement("nGetAppXFlags", AppDomainNative::GetAppXFlags)
-#endif
FCFuncElement("nSetupFriendlyName", AppDomainNative::SetupFriendlyName)
- FCFuncElement("nGetAssemblies", AppDomainNative::GetAssemblies)
FCFuncElement("GetId", AppDomainNative::GetId)
- FCFuncElement("GetOrInternString", AppDomainNative::GetOrInternString)
QCFuncElement("nSetupBindingPaths", AppDomainNative::SetupBindingPaths)
QCFuncElement("nSetNativeDllSearchDirectories", AppDomainNative::SetNativeDllSearchDirectories)
FCFuncElement("PublishAnonymouslyHostedDynamicMethodsAssembly", AppDomainNative::PublishAnonymouslyHostedDynamicMethodsAssembly)
#endif //FEATURE_APPDOMAIN_RESOURCE_MONITORING
FCFuncEnd()
+#ifdef FEATURE_APPX
+FCFuncStart(gApplicationModelFuncs)
+ QCFuncElement("IsAppXProcess", AppDomainNative::IsAppXProcess)
+FCFuncEnd()
+#endif
FCFuncStart(gMdUtf8String)
FCFuncElement("EqualsCaseSensitive", MdUtf8String::EqualsCaseSensitive)
QCFuncElement("InternalLoadUnmanagedDllFromPath", AssemblyNative::InternalLoadUnmanagedDllFromPath)
QCFuncElement("LoadFromStream", AssemblyNative::LoadFromStream)
QCFuncElement("GetLoadContextForAssembly", AssemblyNative::GetLoadContextForAssembly)
+ FCFuncElement("GetLoadedAssemblies", AppDomainNative::GetLoadedAssemblies)
#if defined(FEATURE_MULTICOREJIT)
QCFuncElement("InternalSetProfileRoot", MultiCoreJITNative::InternalSetProfileRoot)
QCFuncElement("InternalStartProfile", MultiCoreJITNative::InternalStartProfile)
// The sorting is case-sensitive
FCClassElement("AppDomain", "System", gAppDomainFuncs)
+#ifdef FEATURE_APPX
+FCClassElement("ApplicationModel", "System", gApplicationModelFuncs)
+#endif
FCClassElement("ArgIterator", "System", gVarArgFuncs)
FCClassElement("Array", "System", gArrayFuncs)
FCClassElement("ArrayWithOffset", "System.Runtime.InteropServices", gArrayWithOffsetFuncs)