<FeatureWindowsPhone>true</FeatureWindowsPhone>
<FeatureManagedEtw>true</FeatureManagedEtw>
<FeatureManagedEtwChannels>true</FeatureManagedEtwChannels>
- <FeatureHostedBinder>true</FeatureHostedBinder>
<BinderDebugLog Condition="'$(_BuildType)'=='dbg'">true</BinderDebugLog>
<FeatureAppX>true</FeatureAppX>
<FeatureWinMDResilient>true</FeatureWinMDResilient>
<CDefines Condition="'$(FeatureFusion)' == 'true'">$(CDefines);FEATURE_FUSION</CDefines>
<CDefines Condition="'$(FeatureHijack)' == 'true'">$(CDefines);FEATURE_HIJACK</CDefines>
<CDefines Condition="'$(FeatureHostAssemblyResolver)' == 'true'">$(CDefines);FEATURE_HOST_ASSEMBLY_RESOLVER</CDefines>
- <CDefines Condition="'$(FeatureHostedBinder)' == 'true'">$(CDefines);FEATURE_HOSTED_BINDER</CDefines>
<CDefines Condition="'$(FeatureImpersonation)' == 'true'">$(CDefines);FEATURE_IMPERSONATION</CDefines>
<CDefines Condition="'$(FeatureIncludeAllInterfaces)' == 'true'">$(CDefines);FEATURE_INCLUDE_ALL_INTERFACES</CDefines>
<CDefines Condition="'$(FeatureInteropDebugging)' == 'true'">$(CDefines);FEATURE_INTEROP_DEBUGGING</CDefines>
<DefineConstants Condition="'$(FeatureExceptionNotifications)' == 'true'">$(DefineConstants);FEATURE_EXCEPTION_NOTIFICATIONS</DefineConstants>
<DefineConstants Condition="'$(FeatureFusion)' == 'true'">$(DefineConstants);FEATURE_FUSION</DefineConstants>
<DefineConstants Condition="'$(FeatureHostAssemblyResolver)' == 'true'">$(DefineConstants);FEATURE_HOST_ASSEMBLY_RESOLVER</DefineConstants>
- <DefineConstants Condition="'$(FeatureHostedBinder)' == 'true'">$(DefineConstants);FEATURE_HOSTED_BINDER</DefineConstants>
<DefineConstants Condition="'$(FeatureHosting)' == 'true'">$(DefineConstants);FEATURE_HOSTING</DefineConstants>
<DefineConstants Condition="'$(FeatureIdentityReference)' == 'true'">$(DefineConstants);FEATURE_IDENTITY_REFERENCE</DefineConstants>
<DefineConstants Condition="'$(FeatureImpersonation)' == 'true'">$(DefineConstants);FEATURE_IMPERSONATION</DefineConstants>
<FeatureFusion>true</FeatureFusion>
<FeatureHijack>true</FeatureHijack>
<FeatureHosting>true</FeatureHosting>
- <FeatureHostedBinder>true</FeatureHostedBinder>
<FeatureIdentityReference>true</FeatureIdentityReference>
<FeatureImpersonation>true</FeatureImpersonation>
<FeatureIncludeAllInterfaces>true</FeatureIncludeAllInterfaces>
add_definitions(-DFEATURE_HIJACK)
endif(NOT CLR_CMAKE_PLATFORM_UNIX_ARM AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
add_definitions(-DFEATURE_HOST_ASSEMBLY_RESOLVER)
-add_definitions(-DFEATURE_HOSTED_BINDER)
add_definitions(-DFEATURE_ICASTABLE)
if (CLR_CMAKE_PLATFORM_UNIX OR CLR_CMAKE_TARGET_ARCH_ARM64)
add_definitions(-DFEATURE_IMPLICIT_TLS)
#include <xcordebug.h>
#include "dacimpl.h"
-#if defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_APPX_BINDER)
+#if defined(FEATURE_APPX_BINDER)
#include <clrprivbinderappx.h>
-#endif // defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_APPX)
+#endif // defined(FEATURE_APPX)
#define STRSAFE_NO_DEPRECATE
#include <strsafe.h>
extern ICLRRuntimeInfo *g_pCLRRuntime;
#endif // !FEATURE_CORECLR && !CROSSGEN_COMPILE
-#ifdef FEATURE_HOSTED_BINDER
#include "clrprivhosting.h"
-#endif
#ifndef FEATURE_CORECLR
#include "clr/win32.h"
if (rclsid == CLSID_CorMetaDataDispenser || rclsid == CLSID_CorMetaDataDispenserRuntime ||
rclsid == CLSID_CorRuntimeHost || rclsid == CLSID_CLRRuntimeHost ||
rclsid == CLSID_TypeNameFactory
-#ifdef FEATURE_HOSTED_BINDER
|| rclsid == __uuidof(CLRPrivRuntime)
-#endif
)
{
hr = MetaDataDllGetClassObject(rclsid, riid, ppv);
#endif
#include "holder.h"
-#if defined(FEATURE_HOSTED_BINDER)
#include "clrprivhosting.h"
-#endif
#ifdef FEATURE_COMINTEROP
#include "activation.h" // WinRT activation.
, public CLRValidator
, public CorDebuggerInfo
, public ICLRRuntimeHost
-#endif // FEATURE_CORECLR
-#if defined(FEATURE_HOSTED_BINDER) && !defined(FEATURE_CORECLR)
, public ICLRPrivRuntime
-#endif
+#endif // FEATURE_CORECLR
, public CorExecutionManager
{
friend struct _DacGlobals;
#endif // !FEATURE_CORECLR
-#if defined(FEATURE_HOSTED_BINDER) && !defined(FEATURE_CORECLR)
+#if !defined(FEATURE_CORECLR)
/**********************************************************************************
** ICLRPrivRuntime Methods
**********************************************************************************/
ICLRPrivBinder * pBinder,
int * pRetVal);
-#endif // FEATURE_HOSTED_BINDER && !FEATURE_CORECLR
+#endif // !FEATURE_CORECLR
static IHostControl *GetHostControl ()
{
#endif // FEATURE_CORECLR
-#if defined(FEATURE_CORECLR) || defined(FEATURE_HOSTED_BINDER)
// Helpers for both ICLRRuntimeHost2 and ICLRPrivRuntime
HRESULT _CreateAppDomain(
LPCWSTR wszFriendlyName,
int nProperties,
LPCWSTR* pPropertyNames,
LPCWSTR* pPropertyValues,
-#if defined(FEATURE_HOSTED_BINDER) && !defined(FEATURE_CORECLR)
+#if !defined(FEATURE_CORECLR)
ICLRPrivBinder* pBinder,
#endif
DWORD* pAppDomainID);
LPCWSTR wszClassName,
LPCWSTR wszMethodName,
INT_PTR* fnPtr);
-#endif // defined(FEATURE_CORECLR) || defined(FEATURE_HOSTED_BINDER)
-#ifdef FEATURE_HOSTED_BINDER
// entrypoint helper to be wrapped in a filter to process unhandled exceptions
VOID ExecuteMainInner(Assembly* pRootAssembly);
-#endif // FEATURE_HOSTED_BINDER
static LONG m_RefCount;
DEFINE_DACVAR(ULONG, DWORD, AssemblyUsageLogManager__s_UsageLogFlags, AssemblyUsageLogManager::s_UsageLogFlags)
#endif // FEATURE_CORECLR
-#if defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_APPX_BINDER)
+#if defined(FEATURE_APPX_BINDER)
DEFINE_DACVAR(ULONG, PTR_CLRPrivBinderAppX, CLRPrivBinderAppX__s_pSingleton, CLRPrivBinderAppX::s_pSingleton)
-#endif //defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_APPX)
+#endif //defined(FEATURE_APPX)
#ifdef FEATURE_MINIMETADATA_IN_TRIAGEDUMPS
DEFINE_DACVAR(ULONG, DWORD, dac__g_MiniMetaDataBuffMaxSize, ::g_MiniMetaDataBuffMaxSize)
const class AssemblyLocation *_asAssemblyLocation;
#endif //FEATURE_FUSION
-#if defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_APPX)
+#if defined(FEATURE_APPX)
const class AppXBindResultImpl *_asAppXBindResultImpl;
#endif
#include "mscoree.h"
#include "corhost.h"
-#ifdef FEATURE_HOSTED_BINDER
#include "clrprivhosting.h"
-#endif
extern HRESULT TypeNameFactoryCreateObject(REFIID riid, void **ppUnk);
{ &CLSID_CorRuntimeHost, W("CorRuntimeHost"), CorHost::CreateObject },
{ &CLSID_CLRRuntimeHost, W("CLRRuntimeHost"), CorHost2::CreateObject },
-#ifdef FEATURE_HOSTED_BINDER
{ &__uuidof(CLRPrivRuntime), W("CLRPrivRuntime"), CorHost2::CreateObject },
-#endif
{ &CLSID_TypeNameFactory, NULL, (PFN_CREATE_OBJ)TypeNameFactoryCreateObject },
#endif // FEATURE_CORECLR && !CROSSGEN_COMPILE
{ NULL, NULL, NULL }
return InternalLoadAssemblyName(an, securityEvidence, null, ref stackMark, true /*thrownOnFileNotFound*/, forIntrospection, suppressSecurityChecks);
}
-#if FEATURE_HOSTED_BINDER
- // Wrapper function to wrap the typical use of InternalLoad. Matches exactly with the signature below if FEATURE_HOSTED_BINDER is not set
+ // Wrapper function to wrap the typical use of InternalLoad.
[System.Security.SecurityCritical] // auto-generated
internal static RuntimeAssembly InternalLoad(String assemblyString,
Evidence assemblySecurity,
{
return InternalLoad(assemblyString, assemblySecurity, ref stackMark, IntPtr.Zero, forIntrospection);
}
-#endif
+
[System.Security.SecurityCritical] // auto-generated
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
internal static RuntimeAssembly InternalLoad(String assemblyString,
Evidence assemblySecurity,
ref StackCrawlMark stackMark,
-#if FEATURE_HOSTED_BINDER
IntPtr pPrivHostBinder,
-#endif
bool forIntrospection)
{
RuntimeAssembly assembly;
}
return InternalLoadAssemblyName(an, assemblySecurity, null, ref stackMark,
-#if FEATURE_HOSTED_BINDER
pPrivHostBinder,
-#endif
true /*thrownOnFileNotFound*/, forIntrospection, false /* suppressSecurityChecks */);
}
return an;
}
-#if FEATURE_HOSTED_BINDER
- // Wrapper function to wrap the typical use of InternalLoadAssemblyName. Matches exactly with the signature below if FEATURE_HOSTED_BINDER is not set
+ // Wrapper function to wrap the typical use of InternalLoadAssemblyName.
[System.Security.SecurityCritical] // auto-generated
internal static RuntimeAssembly InternalLoadAssemblyName(
AssemblyName assemblyRef,
{
return InternalLoadAssemblyName(assemblyRef, assemblySecurity, reqAssembly, ref stackMark, IntPtr.Zero, true /*throwOnError*/, forIntrospection, suppressSecurityChecks);
}
-#endif
[System.Security.SecurityCritical] // auto-generated
internal static RuntimeAssembly InternalLoadAssemblyName(
Evidence assemblySecurity,
RuntimeAssembly reqAssembly,
ref StackCrawlMark stackMark,
-#if FEATURE_HOSTED_BINDER
IntPtr pPrivHostBinder,
-#endif
bool throwOnFileNotFound,
bool forIntrospection,
bool suppressSecurityChecks)
}
return nLoad(assemblyRef, codeBase, assemblySecurity, reqAssembly, ref stackMark,
-#if FEATURE_HOSTED_BINDER
pPrivHostBinder,
-#endif
throwOnFileNotFound, forIntrospection, suppressSecurityChecks);
}
String codeBase,
Evidence assemblySecurity,
RuntimeAssembly locationHint,
- ref StackCrawlMark stackMark,
-
-#if FEATURE_HOSTED_BINDER
+ ref StackCrawlMark stackMark,
IntPtr pPrivHostBinder,
-#endif
bool throwOnFileNotFound,
bool forIntrospection,
bool suppressSecurityChecks);
Evidence assemblySecurity,
RuntimeAssembly locationHint,
ref StackCrawlMark stackMark,
-#if FEATURE_HOSTED_BINDER
IntPtr pPrivHostBinder,
-#endif
bool throwOnFileNotFound,
bool forIntrospection,
bool suppressSecurityChecks)
{
return _nLoad(fileName, codeBase, assemblySecurity, locationHint, ref stackMark,
-#if FEATURE_HOSTED_BINDER
pPrivHostBinder,
-#endif
throwOnFileNotFound, forIntrospection, suppressSecurityChecks);
}
// also try versionless bind from the package
an.Version = null;
return nLoad(an, null, null, null, ref stackMark,
-#if FEATURE_HOSTED_BINDER
IntPtr.Zero,
-#endif
false, false, false);
}
return null;
RuntimeAssembly result = null;
try {
result = nLoad(an, null, securityEvidence, null, ref stackMark,
-#if FEATURE_HOSTED_BINDER
IntPtr.Zero,
-#endif
true, false, false);
}
catch(Exception e) {
{
an.Version = null;
result = nLoad(an, null, securityEvidence, null, ref stackMark,
-#if FEATURE_HOSTED_BINDER
IntPtr.Zero,
-#endif
false, false, false);
}
}
{
// present in the GAC, load it from there
retAssembly = nLoad(an, null, null, this, ref stackMark,
-#if FEATURE_HOSTED_BINDER
IntPtr.Zero,
-#endif
throwOnFileNotFound, false, false);
}
}
else if (!bIsAppXDevMode)
{
retAssembly = nLoad(an, null, null, this, ref stackMark,
-#if FEATURE_HOSTED_BINDER
IntPtr.Zero,
-#endif
throwOnFileNotFound, false, false);
}
}
#endif // !FEATURE_CORECLR
{
retAssembly = nLoad(an, null, null, this, ref stackMark,
-#if FEATURE_HOSTED_BINDER
IntPtr.Zero,
-#endif
throwOnFileNotFound, false, false);
}
{
retAssembly = useLoadFile ? nLoadFile(fileNameOrCodeBase, null) :
nLoad(loadFromAsmName, fileNameOrCodeBase, null, this, ref stackMark,
-#if FEATURE_HOSTED_BINDER
IntPtr.Zero,
-#endif
throwOnFileNotFound, false, false);
}
catch (FileNotFoundException)
{
retAssembly = useLoadFile ? nLoadFile(fileNameOrCodeBase, null) :
nLoad(loadFromAsmName, fileNameOrCodeBase, null, this, ref stackMark,
-#if FEATURE_HOSTED_BINDER
IntPtr.Zero,
-#endif
false /* do not throw on file not found */, false, false);
}
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
[SuppressUnmanagedCodeSecurity]
private extern static void GetTypeByName(string name, bool throwOnError, bool ignoreCase, bool reflectionOnly, StackCrawlMarkHandle stackMark,
-#if FEATURE_HOSTED_BINDER
IntPtr pPrivHostBinder,
-#endif
bool loadTypeFromPartialName, ObjectHandleOnStack type, ObjectHandleOnStack keepalive);
-#if FEATURE_HOSTED_BINDER
// Wrapper function to reduce the need for ifdefs.
internal static RuntimeType GetTypeByName(string name, bool throwOnError, bool ignoreCase, bool reflectionOnly, ref StackCrawlMark stackMark, bool loadTypeFromPartialName)
{
return GetTypeByName(name, throwOnError, ignoreCase, reflectionOnly, ref stackMark, IntPtr.Zero, loadTypeFromPartialName);
}
-#endif
[System.Security.SecuritySafeCritical] // auto-generated
internal static RuntimeType GetTypeByName(string name, bool throwOnError, bool ignoreCase, bool reflectionOnly, ref StackCrawlMark stackMark,
-#if FEATURE_HOSTED_BINDER
IntPtr pPrivHostBinder,
-#endif
bool loadTypeFromPartialName)
{
if (name == null || name.Length == 0)
Object keepAlive = null;
GetTypeByName(name, throwOnError, ignoreCase, reflectionOnly,
JitHelpers.GetStackCrawlMarkHandle(ref stackMark),
-#if FEATURE_HOSTED_BINDER
pPrivHostBinder,
-#endif
loadTypeFromPartialName, JitHelpers.GetObjectHandleOnStack(ref type), JitHelpers.GetObjectHandleOnStack(ref keepAlive));
GC.KeepAlive(keepAlive);
}
[Serializable]
-[System.Runtime.InteropServices.ComVisible(true)]
+ [System.Runtime.InteropServices.ComVisible(true)]
public unsafe struct RuntimeMethodHandle : ISerializable
{
// Returns handle for interop with EE. The handle is guaranteed to be non-null.
#include "../binder/inc/clrprivbindercoreclr.h"
#endif
-#if defined(FEATURE_APPX_BINDER) && defined(FEATURE_HOSTED_BINDER)
+#if defined(FEATURE_APPX_BINDER)
#include "appxutil.h"
#include "clrprivbinderappx.h"
#endif
-#ifdef FEATURE_HOSTED_BINDER
#include "clrprivtypecachewinrt.h"
-#endif
#ifndef FEATURE_CORECLR
#include "nlsinfo.h"
// This routine completes the initialization of the default domaine.
// After this call mananged code can be executed.
void SystemDomain::InitializeDefaultDomain(
- BOOL allowRedirects
-#ifdef FEATURE_HOSTED_BINDER
- , ICLRPrivBinder * pBinder
-#endif
- )
+ BOOL allowRedirects,
+ ICLRPrivBinder * pBinder)
{
STANDARD_VM_CONTRACT;
AppDomain* pDefaultDomain = SystemDomain::System()->DefaultDomain();
-#ifdef FEATURE_HOSTED_BINDER
if (pBinder != nullptr)
{
pDefaultDomain->SetLoadContextHostBinder(pBinder);
pDefaultDomain->SetLoadContextHostBinder(pAppXBinder);
}
#endif
-#endif
{
GCX_COOP();
SetStage( STAGE_CREATING);
-#ifdef FEATURE_HOSTED_BINDER
// The lock is taken also during stack walking (GC or profiler)
// - To prevent deadlock with GC thread, we cannot trigger GC while holding the lock
// - To prevent deadlock with profiler thread, we cannot allow thread suspension
| CRST_DEBUGGER_THREAD
INDEBUG(| CRST_DEBUG_ONLY_CHECK_FORBID_SUSPEND_THREAD)));
m_crstHostAssemblyMapAdd.Init(CrstHostAssemblyMapAdd);
-#endif //FEATURE_HOSTED_BINDER
m_dwId = SystemDomain::GetNewAppDomainId(this);
const bool includeFailedToLoad = (options & FindAssemblyOptions_IncludeFailedToLoad) != 0;
-#ifdef FEATURE_HOSTED_BINDER
if (pFile->HasHostAssembly())
{
DomainAssembly * pDA = FindAssembly(pFile->GetHostAssembly());
}
return nullptr;
}
-#endif
AssemblyIterator i = IterateAssembliesEx((AssemblyIterationFlags)(
kIncludeLoaded |
return fFailure;
}
-#ifdef FEATURE_HOSTED_BINDER
//----------------------------------------------------------------------------------------
// Helper class for hosted binder
return S_OK;
} // AppDomain::BindHostedPrivAssembly
-#endif // FEATURE_HOSTED_BINDER
//---------------------------------------------------------------------------------------------------------------------
PEAssembly * AppDomain::BindAssemblySpec(
BOOL fForceReThrow = FALSE;
-#if defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_APPX_BINDER)
+#if defined(FEATURE_APPX_BINDER)
//
// If there is a host binder available and this is an unparented bind within the
// default load context, then the bind will be delegated to the domain-wide host
return pAssembly.Extract();
}
else
-#endif //FEATURE_HOSTED_BINDER && FEATURE_APPX_BINDER
-#if defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_COMINTEROP)
+#endif // FEATURE_APPX_BINDER
+#if defined(FEATURE_COMINTEROP)
// Handle WinRT assemblies in the classic/hybrid scenario. If this is an AppX process,
// then this case will be handled by the previous block as part of the full set of
// available binding hosts.
return pAssembly.Extract();
}
else
-#endif // FEATURE_HOSTED_BINDER && FEATURE_COMINTEROP
+#endif // FEATURE_COMINTEROP
if (pSpec->HasUniqueIdentity())
{
HRESULT hrBindResult = S_OK;
#endif //FEATURE_TYPEEQUIVALENCE
-#if defined(FEATURE_HOSTED_BINDER)
#if !defined(DACCESS_COMPILE)
//---------------------------------------------------------------------------------------------------------------------
}
}
-#endif //FEATURE_HOSTED_BINDER
-
#if !defined(DACCESS_COMPILE) && defined(FEATURE_CORECLR) && defined(FEATURE_NATIVE_IMAGE_GENERATION)
void ZapperSetBindingPaths(ICorCompilationDomain *pDomain, SString &trustedPlatformAssemblies, SString &platformResourceRoots, SString &appPaths, SString &appNiPaths)
AssemblyLoadSecurity *pLoadSecurity = NULL,
BOOL fUseHostBinderIfAvailable = TRUE) DAC_EMPTY_RET(NULL);
-#ifdef FEATURE_HOSTED_BINDER
HRESULT BindAssemblySpecForHostedBinder(
AssemblySpec * pSpec,
IAssemblyName * pAssemblyName,
IAssemblyName * pAssemblyName,
PEAssembly ** ppAssembly,
BOOL fIsIntrospectionOnly = FALSE) DAC_EMPTY_RET(S_OK);
-#endif // FEATURE_HOSTED_BINDER
#ifdef FEATURE_REFLECTION_ONLY_LOAD
virtual DomainAssembly *BindAssemblySpecForIntrospectionDependencies(AssemblySpec *pSpec) DAC_EMPTY_RET(NULL);
COMNlsHashProvider *m_pNlsHashProvider;
#endif // !FEATURE_CORECLR
-#ifdef FEATURE_HOSTED_BINDER
private:
// This is the root-level default load context root binder. If null, then
// the Fusion binder is used; otherwise this binder is used.
DomainAssembly* pAssembly);
#endif // DACCESS_COMPILE
-#endif //FEATURE_HOSTED_BINDER
#ifdef FEATURE_PREJIT
friend void DomainFile::InsertIntoDomainFileWithNativeImageList();
Volatile<DomainFile *> m_pDomainFileWithNativeImageList;
#endif
static void ActivateApplication(int *pReturnValue);
- static void InitializeDefaultDomain(
- BOOL allowRedirects
-#ifdef FEATURE_HOSTED_BINDER
- , ICLRPrivBinder * pBinder = NULL
-#endif
- );
+ static void InitializeDefaultDomain(BOOL allowRedirects, ICLRPrivBinder * pBinder = NULL);
static void SetupDefaultDomain();
static HRESULT SetupDefaultDomainNoThrow();
#if defined(FEATURE_APPX)
#include "appxutil.h"
#endif // FEATURE_APPX
-#if defined(FEATURE_APPX_BINDER) && defined(FEATURE_HOSTED_BINDER)
+#if defined(FEATURE_APPX_BINDER)
#include "clrprivbinderappx.h"
#include "clrprivtypecachewinrt.h"
-#endif // FEATURE_APPX_BINDER && FEATURE_HOSTED_BINDER
+#endif // FEATURE_APPX_BINDER
#ifdef FEATURE_VERSIONING
#include "../binder/inc/clrprivbindercoreclr.h"
#endif
FCIMPLEND
#endif // FEATURE_APPDOMAIN_RESOURCE_MONITORING
-#if defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_APPX_BINDER)
+#if defined(FEATURE_APPX_BINDER)
ICLRPrivBinder * QCALLTYPE AppDomainNative::CreateDesignerContext(LPCWSTR *rgPaths,
UINT cPaths,
BOOL fShared)
END_QCALL;
}
-#endif // defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_APPX_BINDER)
+#endif // defined(FEATURE_APPX_BINDER)
void QCALLTYPE RegisterWithHost(IUnknown *punkAppDomainManager);
#endif // FEATURE_APPDOMAINMANAGER_INITOPTIONS
-#if defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_APPX_BINDER)
+#if defined(FEATURE_APPX_BINDER)
static
ICLRPrivBinder * QCALLTYPE CreateDesignerContext(LPCWSTR *rgPaths, UINT cPaths, BOOL fShared);
#include "assemblynativeresource.h"
#endif // !FEATURE_CORECLR
-#if defined(FEATURE_HOSTED_BINDER) && !defined(FEATURE_CORECLR)
+#if !defined(FEATURE_CORECLR)
#include "clrprivbinderloadfile.h"
#endif
FCIMPLEND
#endif // FEATURE_FUSION
-#ifdef FEATURE_HOSTED_BINDER
FCIMPL9(Object*, AssemblyNative::Load, AssemblyNameBaseObject* assemblyNameUNSAFE,
StringObject* codeBaseUNSAFE,
Object* securityUNSAFE,
CLR_BOOL fThrowOnFileNotFound,
CLR_BOOL fForIntrospection,
CLR_BOOL fSuppressSecurityChecks)
-#else // !FEATURE_HOSTED_BINDER
-FCIMPL8(Object*, AssemblyNative::Load, AssemblyNameBaseObject* assemblyNameUNSAFE,
- StringObject* codeBaseUNSAFE,
- Object* securityUNSAFE,
- AssemblyBaseObject* requestingAssemblyUNSAFE,
- StackCrawlMark* stackMark,
- CLR_BOOL fThrowOnFileNotFound,
- CLR_BOOL fForIntrospection,
- CLR_BOOL fSuppressSecurityChecks)
-#endif // FEATURE_HOSTED_BINDER
{
FCALL_CONTRACT;
}
else if (!fForIntrospection)
{
-#ifdef FEATURE_HOSTED_BINDER
// name specified, if immersive ignore the codebase
if (GetThread()->GetDomain()->HasLoadContextHostBinder())
gc.codeBase = NULL;
-#endif //FEATURE_HOSTED_BINDER
// Compute parent assembly
Assembly * pRefAssembly;
EEFileLoadException::Throw(&spec, COR_E_NOTSUPPORTED);
}
-#ifdef FEATURE_HOSTED_BINDER
if (pPrivHostBinder != NULL)
{
pParentAssembly = NULL;
spec.SetHostBinder(pPrivHostBinder);
}
-#endif // FEATURE_HOSTED_BINDER
if (gc.codeBase != NULL)
spec.SetCodeBase(&(pThread->m_MarshalAlloc), &gc.codeBase);
CLRPrivBinderLoadFile* pBinderToUse = NULL;
-#if defined(FEATURE_HOSTED_BINDER) && !defined(FEATURE_CORECLR)
+#if !defined(FEATURE_CORECLR)
if (GetAppDomain()->HasLoadContextHostBinder())
{
pBinderToUse = CLRPrivBinderLoadFile::GetOrCreateBinder();
}
-#endif // FEATURE_HOSTED_BINDER && !FEATURE_CORECLR
+#endif // !FEATURE_CORECLR
pFile = PEAssembly::OpenMemory(pCallersAssembly->GetManifestFile(),
pAssemblyData, (COUNT_T)uAssemblyLength,
Object* securityUNSAFE);
static FCDECL6(Object*, LoadImage, U1Array* PEByteArrayUNSAFE, U1Array* SymByteArrayUNSAFE, Object* securityUNSAFE, StackCrawlMark* stackMark, CLR_BOOL fForIntrospection, SecurityContextSource securityContextSource);
-#ifdef FEATURE_HOSTED_BINDER
static FCDECL9(Object*, Load, AssemblyNameBaseObject* assemblyNameUNSAFE,
StringObject* codeBaseUNSAFE,
Object* securityUNSAFE,
CLR_BOOL fForIntrospection,
CLR_BOOL fSuppressSecurityChecks);
-#else //!FEATURE_HOSTED_BINDER
- static FCDECL8(Object*, Load, AssemblyNameBaseObject* assemblyNameUNSAFE,
- StringObject* codeBaseUNSAFE,
- Object* securityUNSAFE,
- AssemblyBaseObject* requestingAssemblyUNSAFE,
- StackCrawlMark* stackMark,
- CLR_BOOL fThrowOnFileNotFound,
- CLR_BOOL fForIntrospection,
- CLR_BOOL fSuppressSecurityChecks);
-#endif // FEATURE_HOSTED_BINDER
-
static FCDECL1(FC_BOOL_RET, IsFrameworkAssembly, AssemblyNameBaseObject* refAssemblyNameUNSAFE);
static FCDECL1(FC_BOOL_RET, IsNewPortableAssembly, AssemblyNameBaseObject* refAssemblyNameUNSAFE);
DomainAssembly *pAssembly = nullptr;
-#ifdef FEATURE_HOSTED_BINDER
ICLRPrivBinder * pBinder = GetHostBinder();
// If no binder was explicitly set, check if parent assembly has a binder.
pAssembly = pDomain->FindAssembly(pPrivAssembly);
}
}
-#endif
+
if ((pAssembly == nullptr) && CanUseWithBindingCache())
{
pAssembly = pDomain->FindCachedAssembly(this);
THROWS;
GC_TRIGGERS;
MODE_ANY;
-#ifdef FEATURE_HOSTED_BINDER
// Host binder based assembly spec's cannot currently be safely inserted into caches.
PRECONDITION(pSpec->GetHostBinder() == nullptr);
-#endif // FEATURE_HOSTED_BINDER
POSTCONDITION(UnsafeContains(this, pSpec));
POSTCONDITION(UnsafeVerifyLookupAssembly(this, pSpec, pAssembly));
INJECT_FAULT(COMPlusThrowOM(););
THROWS;
GC_TRIGGERS;
MODE_ANY;
-#ifdef FEATURE_HOSTED_BINDER
// Host binder based assembly spec's cannot currently be safely inserted into caches.
PRECONDITION(pSpec->GetHostBinder() == nullptr);
-#endif // FEATURE_HOSTED_BINDER
POSTCONDITION((!RETVAL) || (UnsafeContains(this, pSpec) && UnsafeVerifyLookupFile(this, pSpec, pFile)));
INJECT_FAULT(COMPlusThrowOM(););
}
THROWS;
GC_TRIGGERS;
MODE_ANY;
-#ifdef FEATURE_HOSTED_BINDER
// Host binder based assembly spec's cannot currently be safely inserted into caches.
PRECONDITION(pSpec->GetHostBinder() == nullptr);
-#endif // FEATURE_HOSTED_BINDER
DISABLED(POSTCONDITION(UnsafeContains(this, pSpec))); //<TODO>@todo: Getting violations here - StoreExceptions could happen anywhere so this is possibly too aggressive.</TODO>
INJECT_FAULT(COMPlusThrowOM(););
}
AssemblySpec *a1 = (AssemblySpec *) (u1 << 1);
AssemblySpec *a2 = (AssemblySpec *) u2;
-#if defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_APPX_BINDER)
+#if defined(FEATURE_APPX_BINDER)
_ASSERTE(a1->GetAppDomain() == a2->GetAppDomain());
if (a1->GetAppDomain()->HasLoadContextHostBinder())
return (CLRPrivBinderUtil::CompareHostBinderSpecs(a1,a2));
AssemblySpec* pSpec1 = (AssemblySpec*) (spec1 << 1);
AssemblyEntry* pEntry2 = (AssemblyEntry*) spec2;
-#if defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_FUSION)
+#if defined(FEATURE_FUSION)
AssemblySpec* pSpec2 = &pEntry2->spec;
_ASSERTE(pSpec1->GetAppDomain() == pSpec2->GetAppDomain());
if (pSpec1->GetAppDomain()->HasLoadContextHostBinder())
LIMITED_METHOD_CONTRACT;
if(m_pParentAssembly)
{
-#ifdef FEATURE_HOSTED_BINDER
if (m_pParentAssembly->GetFile()->HasHostAssembly())
return m_pParentAssembly->GetFile()->GetHostAssembly();
else
-#endif
return m_pParentAssembly->GetFile()->GetFusionAssembly();
}
return NULL;
#ifdef FEATURE_FUSION
if (pAssembly)
{
-#ifdef FEATURE_HOSTED_BINDER
_ASSERTE(GetHostBinder() == nullptr);
-#endif // FEATURE_HOSTED_BINDER
m_fParentLoadContext=pAssembly->GetFile()->GetLoadContext();
}
else
inline BOOL CanUseWithBindingCache() const
{
STATIC_CONTRACT_LIMITED_METHOD;
-#if defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_APPX_BINDER)
+#if defined(FEATURE_APPX_BINDER)
return (GetHostBinder() == nullptr) && HasUniqueIdentity();
#else
return HasUniqueIdentity();
#endif
}
-#ifdef FEATURE_HOSTED_BINDER
inline ICLRPrivBinder *GetHostBinder() const
{
LIMITED_METHOD_CONTRACT;
LIMITED_METHOD_CONTRACT;
m_pHostBinder = pHostBinder;
}
-#endif
};
#endif
LPCSTR m_szWinRtTypeNamespace;
LPCSTR m_szWinRtTypeClassName;
-#ifdef FEATURE_HOSTED_BINDER
ICLRPrivBinder *m_pHostBinder;
-#endif
int m_ownedFlags;
BOOL m_fIntrospectionOnly;
#if defined(FEATURE_CORECLR)
m_context = pSpec->m_context;
-#ifdef FEATURE_HOSTED_BINDER
m_pHostBinder = pSpec->m_pHostBinder;
-#endif
#ifdef FEATURE_CORECLR
if ((pSpec->m_ownedFlags & BAD_NAME_OWNED) != 0)
#include "peimagelayout.inl"
#include "ildbsymlib.h"
-#if defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_APPX_BINDER)
+#if defined(FEATURE_APPX_BINDER)
#include "clrprivbinderappx.h"
-#endif //defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_APPX_BINDER)
+#endif // defined(FEATURE_APPX_BINDER)
#if defined(PROFILING_SUPPORTED)
#include "profilermetadataemitvalidator.h"
// This extended check is designed only to find assemblies loaded via an AssemblySpecBindingCache based binder. Verify that's what we found.
if(pAssemblyCandidate != NULL)
{
-#ifdef FEATURE_HOSTED_BINDER
if (!pAssemblyCandidate->GetManifestFile()->HasHostAssembly())
-#endif // FEATURE_HOSTED_BINDER
{
pAssembly = pAssemblyCandidate;
}
-#ifdef FEATURE_HOSTED_BINDER
else
{
DWORD binderFlags = 0;
_ASSERTE("Non-AssemblySpecBindingCache based assembly found with extended search" && !(IsStackWalkerThread() || IsGCThread()) && IsGenericInstantiationLookupCompareThread());
}
}
-#endif // FEATURE_HOSTED_BINDER
}
}
}
_ASSERTE(szWinRtClassName != NULL);
CLRPrivBinderWinRT * pWinRtBinder = pAppDomainExamine->GetWinRtBinder();
-#ifdef FEATURE_HOSTED_BINDER
if (pWinRtBinder == nullptr)
{ // We are most likely in AppX mode (calling AppX::IsAppXProcess() for verification is painful in DACCESS)
#ifndef DACCESS_COMPILE
#endif // defined(FEATURE_APPX_BINDER)
}
}
-#endif //FEATURE_HOSTED_BINDER
if (pWinRtBinder != nullptr)
{
//
//=====================================================================================================================
-#ifdef FEATURE_HOSTED_BINDER
#ifdef FEATURE_REFLECTION_ONLY_LOAD
#pragma once
}; // class CLRPrivAssemblyReflectionOnlyWinRT
#endif //FEATURE_REFLECTION_ONLY_LOAD
-#endif //FEATURE_HOSTED_BINDER
//
//=============================================================================================
-#ifdef FEATURE_HOSTED_BINDER
-
#pragma once
#include "holder.h"
BOOL m_fShareable;
Volatile<DWORD> m_dwImageTypes;
}; // class CLRPrivAssemblyWinRT
-
-#endif //FEATURE_HOSTED_BINDER
//
//=====================================================================================================================
-#ifdef FEATURE_HOSTED_BINDER
#ifdef FEATURE_REFLECTION_ONLY_LOAD
#pragma once
}; // class CLRPrivTypeCaheReflectionOnlyWinRT
#endif //FEATURE_REFLECTION_ONLY_LOAD
-#endif // FEATURE_HOSTED_BINDER
//
//=====================================================================================================================
-#ifdef FEATURE_HOSTED_BINDER
-
#pragma once
#include "internalunknownimpl.h"
}; // class CLRPrivTypeCaheWinRT
typedef DPTR(CLRPrivTypeCacheWinRT) PTR_CLRPrivTypeCacheWinRT;
-
-#endif // FEATURE_HOSTED_BINDER
#include "cgensys.h"
#include "peimagelayout.inl"
-#if defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_APPX_BINDER)
+#if defined(FEATURE_APPX_BINDER)
#include "appxutil.h"
#include "clrprivbinderappx.h"
#include "clrprivtypecachewinrt.h"
-#endif // defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_APPX_BINDER)
+#endif // defined(FEATURE_APPX_BINDER)
#ifdef FEATURE_COMINTEROP
#include "clrprivbinderwinrt.h"
if (pEmitter)
pCompilationDomain->SetDependencyEmitter(pEmitter);
-#if defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_APPX_BINDER)
+#if defined(FEATURE_APPX_BINDER)
if (AppX::IsAppXProcess())
{
HRESULT hr = S_OK;
IfFailThrow(pBinder->QueryInterface(IID_ICLRPrivBinder, &pBinderInterface));
pCompilationDomain->SetLoadContextHostBinder(pBinderInterface);
}
-#endif // defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_APPX_BINDER)
+#endif // defined(FEATURE_APPX_BINDER)
#ifdef DEBUGGING_SUPPORTED
// Notify the debugger here, before the thread transitions into the
#include "winrttypenameconverter.h"
#endif
-#if defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_APPX_BINDER)
+#if defined(FEATURE_APPX_BINDER)
#include "clrprivbinderappx.h"
#include "clrprivtypecachewinrt.h"
#endif
return hr;
}
-#if defined(FEATURE_CORECLR) || defined(FEATURE_HOSTED_BINDER)
#define EMPTY_STRING_TO_NULL(s) {if(s && s[0] == 0) {s=NULL;};}
HRESULT CorHost2::_CreateAppDomain(
int nProperties,
LPCWSTR* pPropertyNames,
LPCWSTR* pPropertyValues,
-#if defined(FEATURE_HOSTED_BINDER) && !defined(FEATURE_CORECLR)
+#if !defined(FEATURE_CORECLR)
ICLRPrivBinder* pBinder,
#endif
DWORD* pAppDomainID)
if (dwFlags & APPDOMAIN_FORCE_TRIVIAL_WAIT_OPERATIONS)
pDomain->SetForceTrivialWaitOperations();
-#if defined(FEATURE_HOSTED_BINDER) && !defined(FEATURE_CORECLR)
+#if !defined(FEATURE_CORECLR)
if (pBinder != NULL)
pDomain->SetLoadContextHostBinder(pBinder);
#endif
return hr;
}
-#endif // defined(FEATURE_CORECLR) || defined(FEATURE_HOSTED_BINDER)
-
#ifdef FEATURE_CORECLR
HRESULT CorHost2::CreateAppDomainWithManager(
LPCWSTR wszFriendlyName,
#ifndef DACCESS_COMPILE
-#if defined(FEATURE_HOSTED_BINDER) && !defined(FEATURE_CORECLR)
+#if !defined(FEATURE_CORECLR)
/*************************************************************************************
** ICLRPrivRuntime Methods
*************************************************************************************/
PAL_ENDTRY
}
-#endif // FEATURE_HOSTED_BINDER
-
-#ifndef FEATURE_CORECLR
// static
HRESULT CorHost2::SetFlagsAndHostConfig(STARTUP_FLAGS dwStartupFlags, LPCWSTR pwzHostConfigFile, BOOL fFinalize)
{
*ppUnk = static_cast<ICLRExecutionManager *>(this);
}
-#if defined(FEATURE_HOSTED_BINDER) && !defined(FEATURE_CORECLR)
+#if !defined(FEATURE_CORECLR)
else if (riid == __uuidof(ICLRPrivRuntime))
{
ULONG version = 2;
#ifndef FEATURE_CORECLR // coreclr uses winrt binder which does not allow redirects
{
BaseDomain::LockHolder lh(pDomain);
-#ifdef FEATURE_HOSTED_BINDER
if (!pDomain->HasLoadContextHostBinder())
-#endif
{
// don't allow redirects
SystemDomain::InitializeDefaultDomain(FALSE);
}
CONTRACTL_END;
- #ifdef FEATURE_HOSTED_BINDER
if (m_fHostAssemblyPublished)
{
// Remove association first.
GetAppDomain()->UnPublishHostedAssembly(this);
}
- #endif
ModuleIterator i = IterateModules(kModIterIncludeLoading);
while (i.Next())
AppDomain::LoadLockHolder lock(m_pDomain);
m_pDomain->AddAssembly(this);
}
-#ifdef FEATURE_HOSTED_BINDER
// Make it possible to find this DomainAssembly object from associated ICLRPrivAssembly.
GetAppDomain()->PublishHostedAssembly(this);
m_fHostAssemblyPublished = true;
-#endif
}
#ifdef FEATURE_PREJIT
#ifdef FEATURE_FUSION
DomainAssembly * pDomainAssembly = GetDomainAssembly();
if (pDomainAssembly->GetSecurityDescriptor()->HasAdditionalEvidence() ||
- !(pDomainAssembly->GetFile()->IsContextLoad()
-#ifdef FEATURE_HOSTED_BINDER
- || pDomainAssembly->GetFile()->HasHostAssembly()
-#endif
- ))
+ !(pDomainAssembly->GetFile()->IsContextLoad() ||
+ pDomainAssembly->GetFile()->HasHostAssembly()))
{
m_pFile->SetCannotUseNativeImage();
}
fInsertIntoAssemblySpecBindingCache = GetFile()->GetLoadContext() == LOADCTX_TYPE_DEFAULT;
#endif
-#if defined(FEATURE_HOSTED_BINDER)
#if defined(FEATURE_APPX_BINDER)
fInsertIntoAssemblySpecBindingCache = fInsertIntoAssemblySpecBindingCache && !GetFile()->HasHostAssembly();
#else
fInsertIntoAssemblySpecBindingCache = fInsertIntoAssemblySpecBindingCache && GetFile()->CanUseWithBindingCache();
#endif
-#endif
if (fInsertIntoAssemblySpecBindingCache)
{
}
CONTRACTL_END;
-#ifdef FEATURE_HOSTED_BINDER
GetAppDomain()->UpdatePublishHostedAssembly(this, pFile);
-#else
- this->UpdatePEFileWorker(pFile);
-#endif
}
#ifdef FEATURE_MULTIMODULE_ASSEMBLIES
SString ssAssemblyName(SString::Utf8Literal, "WindowsRuntimeAssemblyName, ContentType=WindowsRuntime");
DomainAssembly *pAssembly = LoadDomainAssembly(&ssAssemblyName, NULL,
-#ifdef FEATURE_HOSTED_BINDER
NULL,
-#endif
bThrowIfNotFound, FALSE, ssTypeName);
if (pAssembly != NULL)
{
wLoadLevel = 0;
// Extra data
lenModuleName = (unsigned short) lenName;
-#if defined(FEATURE_CORECLR) && defined(FEATURE_HOSTED_BINDER)
+#if defined(FEATURE_CORECLR)
lenAssemblyName = (unsigned short) lenAsmName;
recordID += RoundUp(lenModuleName) + RoundUp(lenAssemblyName);
#else
unsigned lenModuleName = (unsigned) strlen(pModuleName);
simpleName.Set((const BYTE *) pModuleName, lenModuleName); // SBuffer::Set copies over name
-#if defined(FEATURE_CORECLR) && defined(FEATURE_HOSTED_BINDER)
+#if defined(FEATURE_CORECLR)
SString sAssemblyName;
StackScratchBuffer scratch;
pMod->GetAssembly()->GetManifestFile()->GetDisplayName(sAssemblyName);
const void * pModuleName = module.simpleName;
unsigned lenModuleName = module.simpleName.GetSize();
-#if defined(FEATURE_CORECLR) && defined(FEATURE_HOSTED_BINDER)
+#if defined(FEATURE_CORECLR)
const void * pAssemblyName = module.assemblyName;
unsigned lenAssemblyName = module.assemblyName.GetSize();
#else
{
hr = WriteString(pModuleName, lenModuleName, pStream);
-#if defined(FEATURE_CORECLR) && defined(FEATURE_HOSTED_BINDER)
+#if defined(FEATURE_CORECLR)
if (SUCCEEDED(hr))
{
hr = WriteString(pAssemblyName, lenAssemblyName, pStream);
NewHolder<MulticoreJitProfilePlayer> player(new (nothrow) MulticoreJitProfilePlayer(
m_pDomain,
-#if defined(FEATURE_CORECLR) && defined(FEATURE_HOSTED_BINDER)
+#if defined(FEATURE_CORECLR)
m_pBinderContext,
#else
NULL,
{
MulticoreJitRecorder * pRecorder = new (nothrow) MulticoreJitRecorder(
pDomain,
-#if defined(FEATURE_CORECLR) && defined(FEATURE_HOSTED_BINDER)
+#if defined(FEATURE_CORECLR)
pBinderContext,
#else
NULL,
unsigned short flags;
unsigned short wLoadLevel;
unsigned short lenModuleName;
-#if defined(FEATURE_CORECLR) && defined(FEATURE_HOSTED_BINDER)
+#if defined(FEATURE_CORECLR)
unsigned short lenAssemblyName;
#endif
return (const char *) (this + 1); // after this record
}
-#if defined(FEATURE_CORECLR) && defined(FEATURE_HOSTED_BINDER)
+#if defined(FEATURE_CORECLR)
unsigned AssemblyNameLen() const
{
LIMITED_METHOD_CONTRACT;
private:
ADID m_DomainID;
-#if defined(FEATURE_CORECLR) && defined(FEATURE_HOSTED_BINDER)
+#if defined(FEATURE_CORECLR)
ICLRPrivBinder * m_pBinderContext;
#endif
LONG m_nMySession;
HRESULT ReadCheckFile(const wchar_t * pFileName);
-#if defined(FEATURE_CORECLR) && defined(FEATURE_HOSTED_BINDER)
+#if defined(FEATURE_CORECLR)
DomainAssembly * LoadAssembly(SString & assemblyName);
#endif
{
private:
AppDomain * m_pDomain; // AutoStartProfile could be called from SystemDomain
-#if defined(FEATURE_CORECLR) && defined(FEATURE_HOSTED_BINDER)
+#if defined(FEATURE_CORECLR)
ICLRPrivBinder * m_pBinderContext;
#endif
SString m_fullFileName;
LIMITED_METHOD_CONTRACT;
m_pDomain = pDomain;
-#if defined(FEATURE_CORECLR) && defined(FEATURE_HOSTED_BINDER)
+#if defined(FEATURE_CORECLR)
m_pBinderContext = pBinderContext;
#endif
m_JitInfoCount = 0;
LIMITED_METHOD_CONTRACT;
m_DomainID = pDomain->GetId();
-#if defined(FEATURE_CORECLR) && defined(FEATURE_HOSTED_BINDER)
+#if defined(FEATURE_CORECLR)
m_pBinderContext = pBinderContext;
#endif
m_nMySession = nSession;
return false;
}
-#if defined(FEATURE_CORECLR) && defined(FEATURE_HOSTED_BINDER)
+#if defined(FEATURE_CORECLR)
if (pFile->GetPath().IsEmpty()) // Ignore in-memory modules
{
return false;
m_stats.m_nTryCompiling ++;
-#if defined(FEATURE_CORECLR) && defined(FEATURE_HOSTED_BINDER)
+#if defined(FEATURE_CORECLR)
// Reset the flag to allow managed code to be called in multicore JIT background thread from this routine
ThreadStateNCStackHolder holder(-1, Thread::TSNC_CallingManagedCodeDisabled);
#endif
PlayerModuleInfo & mod = m_pModules[moduleTo];
-#if defined(FEATURE_CORECLR) && defined(FEATURE_HOSTED_BINDER)
+#if defined(FEATURE_CORECLR)
// Load the module if necessary.
if (!mod.m_pModule)
{
return true;
}
-#if defined(FEATURE_CORECLR) && defined(FEATURE_HOSTED_BINDER)
+#if defined(FEATURE_CORECLR)
DomainAssembly * MulticoreJitProfilePlayer::LoadAssembly(SString & assemblyName)
{
STANDARD_VM_CONTRACT;
PlayerModuleInfo & mod = m_pModules[inst >> 24];
-#if defined(FEATURE_CORECLR) && defined(FEATURE_HOSTED_BINDER)
+#if defined(FEATURE_CORECLR)
_ASSERTE(mod.IsModuleLoaded());
#else
_ASSERTE(mod.IsModuleLoaded() && ! mod.IsLowerLevel());
const ModuleRecord * pRec = (const ModuleRecord * ) pBuffer;
if (((unsigned)(pRec->lenModuleName
-#if defined(FEATURE_CORECLR) && defined(FEATURE_HOSTED_BINDER)
+#if defined(FEATURE_CORECLR)
+ pRec->lenAssemblyName
#endif
) > (rcdLen - sizeof(ModuleRecord))) ||
#include "sha1.h"
-#if defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_FUSION)
+#if defined(FEATURE_FUSION)
#include "clrprivbinderfusion.h"
#include "clrprivbinderappx.h"
#include "clrprivbinderloadfile.h"
,m_pSecurityManager(NULL)
,m_securityManagerLock(CrstPEFileSecurityManager)
#endif // FEATURE_CAS_POLICY
-#ifdef FEATURE_HOSTED_BINDER
,m_pHostAssembly(nullptr)
-#endif // FEATURE_HOSTED_BINDER
{
CONTRACTL
{
CoTaskMemFree(m_certificate);
#endif // FEATURE_CAS_POLICY
-#ifdef FEATURE_HOSTED_BINDER
if (m_pHostAssembly != NULL)
{
m_pHostAssembly->Release();
}
-#endif
}
#ifndef DACCESS_COMPILE
return FALSE;
}
-#ifdef FEATURE_HOSTED_BINDER
// Different host assemblies cannot be equal unless they are associated with the same host binder
// It's ok if only one has a host binder because multiple threads can race to load the same assembly
// and that may cause temporary candidate PEAssembly objects that never get bound to a host assembly
return FALSE;
}
-#endif // FEATURE_HOSTED_BINDER
-
// Same identity is equal
if (m_identity != NULL && pFile->m_identity != NULL
IMetaDataEmit* pEmit,
PEFile *creator,
BOOL system,
- BOOL introspectionOnly/*=FALSE*/
-#ifdef FEATURE_HOSTED_BINDER
- ,
+ BOOL introspectionOnly/*=FALSE*/,
PEImage * pPEImageIL /*= NULL*/,
PEImage * pPEImageNI /*= NULL*/,
- ICLRPrivAssembly * pHostAssembly /*= NULL*/
-#endif
- )
+ ICLRPrivAssembly * pHostAssembly /*= NULL*/)
: PEFile(pBindResultInfo ? (pBindResultInfo->GetPEImage() ? pBindResultInfo->GetPEImage() :
(pBindResultInfo->HasNativeImage() ? pBindResultInfo->GetNativeImage() : NULL)
-#ifdef FEATURE_HOSTED_BINDER
): pPEImageIL? pPEImageIL:(pPEImageNI? pPEImageNI:NULL), FALSE),
-#else
- ): NULL, FALSE),
-#endif
m_creator(clr::SafeAddRef(creator)),
m_bIsFromGAC(FALSE),
m_bIsOnTpaList(FALSE)
CONSTRUCTOR_CHECK;
PRECONDITION(CheckPointer(pEmit, NULL_OK));
PRECONDITION(CheckPointer(creator, NULL_OK));
-#ifdef FEATURE_HOSTED_BINDER
PRECONDITION(pBindResultInfo == NULL || (pPEImageIL == NULL && pPEImageNI == NULL));
-#endif
STANDARD_VM_CHECK;
}
CONTRACTL_END;
// We check the precondition above that either pBindResultInfo is null or both pPEImageIL and pPEImageNI are,
// so we'll only get a max of one native image passed in.
-#ifdef FEATURE_HOSTED_BINDER
if (pPEImageNI != NULL)
{
SetNativeImage(pPEImageNI);
}
-#endif
#ifdef FEATURE_PREJIT
if (pBindResultInfo && pBindResultInfo->HasNativeImage())
ThrowHR(COR_E_BADIMAGEFORMAT, BFA_EMPTY_ASSEMDEF_NAME);
}
-#ifdef FEATURE_HOSTED_BINDER
// Set the host assembly and binding context as the AssemblySpec initialization
// for CoreCLR will expect to have it set.
if (pHostAssembly != nullptr)
_ASSERTE(pHostAssembly == nullptr);
pBindResultInfo->GetBindAssembly(&m_pHostAssembly);
}
-#endif // FEATURE_HOSTED_BINDER
#if _DEBUG
GetCodeBaseOrName(m_debugName);
#endif // FEATURE_FUSION
-#if defined(FEATURE_HOSTED_BINDER)
-
#ifdef FEATURE_FUSION
PEAssembly *PEAssembly::Open(
#endif // FEATURE_FUSION
-#endif // FEATURE_HOSTED_BINDER
-
-
PEAssembly::~PEAssembly()
{
CONTRACTL
if (!image->CheckILFormat())
ThrowHR(COR_E_BADIMAGEFORMAT, BFA_BAD_IL);
-#if defined(FEATURE_HOSTED_BINDER) && !defined(FEATURE_CORECLR)
+#if !defined(FEATURE_CORECLR)
if(pBinderToUse != NULL && !isIntrospectionOnly)
{
ReleaseHolder<ICLRPrivAssembly> pAsm;
_ASSERTE(pFile);
RETURN pFile;
}
-#endif // FEATURE_HOSTED_BINDER && !FEATURE_CORECLR
+#endif // !FEATURE_CORECLR
#ifdef FEATURE_FUSION
RETURN new PEAssembly(image, NULL, NULL, NULL, NULL, NULL, NULL, pParentAssembly, FALSE, isIntrospectionOnly);
}
#endif
-#if defined(FEATURE_HOSTED_BINDER)
// Returns the ICLRPrivBinder* instance associated with the PEFile
PTR_ICLRPrivBinder PEFile::GetBindingContext()
{
return pBindingContext;
}
-#endif // FEATURE_HOSTED_BINDER
-
#include "corperm.h"
#include "eventtrace.h"
-#ifdef FEATURE_HOSTED_BINDER
#include "clrprivbinderutil.h"
-#endif
// --------------------------------------------------------------------------------
// Forward declared classes
{
LIMITED_METHOD_CONTRACT;
-#ifdef FEATURE_HOSTED_BINDER
DWORD binderFlags = BINDER_NONE;
HRESULT hr = E_FAIL;
hr = GetHostAssembly()->GetBinderFlags(&binderFlags);
return hr == S_OK ? binderFlags & BINDER_DESIGNER_BINDING_CONTEXT : FALSE;
-#else
- return FALSE;
-#endif
}
LPCWSTR GetPathForErrorMessages();
void MarkNativeImageInvalidIfOwned();
void ConvertMetadataToRWForEnC();
-#if defined(FEATURE_VERSIONING) || defined(FEATURE_HOSTED_BINDER)
protected:
PTR_ICLRPrivAssembly m_pHostAssembly;
-#endif
-#ifdef FEATURE_HOSTED_BINDER
protected:
friend class CLRPrivBinderFusion;
bool CanUseWithBindingCache()
{ LIMITED_METHOD_CONTRACT; return !HasHostAssembly(); }
-#endif // FEATURE_HOSTED_BINDER
}; // class PEFile
// Public API
// ------------------------------------------------------------
-#if defined(FEATURE_HOSTED_BINDER)
#if !defined(FEATURE_CORECLR)
static PEAssembly * Open(
PEAssembly * pParentAssembly,
ICLRPrivAssembly * pHostAssembly,
BOOL fIsIntrospectionOnly = FALSE);
#endif //!FEATURE_CORECLR
-#endif //FEATURE_HOSTED_BINDER
// This opens the canonical mscorlib.dll
#ifdef FEATURE_FUSION
IMetaDataEmit *pEmit,
PEFile *creator,
BOOL system,
- BOOL introspectionOnly = FALSE
-#ifdef FEATURE_HOSTED_BINDER
- ,
+ BOOL introspectionOnly = FALSE,
PEImage * pPEImageIL = NULL,
PEImage * pPEImageNI = NULL,
ICLRPrivAssembly * pHostAssembly = NULL
-#endif
);
#endif
virtual ~PEAssembly();
// Indicates if the assembly can be cached in a binding cache such as AssemblySpecBindingCache.
inline bool CanUseWithBindingCache()
{
-#if defined(FEATURE_HOSTED_BINDER)
STATIC_CONTRACT_WRAPPER;
#if !defined(FEATURE_APPX_BINDER)
return (HasBindableIdentity());
#else
return (PEFile::CanUseWithBindingCache() && HasBindableIdentity());
#endif // FEATURE_CORECLR
-#else
- STATIC_CONTRACT_LIMITED_METHOD;
- return true;
-#endif // FEATURE_HOSTED_BINDER
}
};
#endif //!DACCESS_COMPILE
#endif //FEATURE_FUSION
-#if defined(FEATURE_HOSTED_BINDER) && !defined(DACCESS_COMPILE)
+#if !defined(DACCESS_COMPILE)
PEImage * PEImage::OpenImage(
ICLRPrivResource * pIResource,
MDInternalImportFlags flags)
};
-#ifdef FEATURE_HOSTED_BINDER
// pUnkResource must be one of the ICLRPrivResource* interfaces defined in CLRPrivBinding.IDL.
// pUnkResource will be queried for each of these to find a match and
static PEImage * OpenImage(
ICLRPrivResource * pIResource,
MDInternalImportFlags flags = MDInternalImport_Default);
-#endif
static PTR_PEImage FindById(UINT64 uStreamAsmId, DWORD dwModuleId);
static PTR_PEImage FindByPath(LPCWSTR pPath);
void QCALLTYPE RuntimeTypeHandle::GetTypeByName(LPCWSTR pwzClassName, BOOL bThrowOnError, BOOL bIgnoreCase, BOOL bReflectionOnly,
QCall::StackCrawlMarkHandle pStackMark,
-#ifdef FEATURE_HOSTED_BINDER
ICLRPrivBinder * pPrivHostBinder,
-#endif
BOOL bLoadTypeFromPartialNameHack, QCall::ObjectHandleOnStack retType,
QCall::ObjectHandleOnStack keepAlive)
{
{
typeHandle = TypeName::GetTypeManaged(pwzClassName, NULL, bThrowOnError, bIgnoreCase, bReflectionOnly, /*bProhibitAsmQualifiedName =*/ FALSE, pStackMark,
- bLoadTypeFromPartialNameHack, (OBJECTREF*)keepAlive.m_ppObject
-#ifdef FEATURE_HOSTED_BINDER
- , pPrivHostBinder
-#endif
- );
+ bLoadTypeFromPartialNameHack, (OBJECTREF*)keepAlive.m_ppObject,
+ pPrivHostBinder);
}
if (!typeHandle.IsNull())
static
void QCALLTYPE GetTypeByName(LPCWSTR pwzClassName, BOOL bThrowOnError, BOOL bIgnoreCase, BOOL bReflectionOnly,
QCall::StackCrawlMarkHandle pStackMark,
-#ifdef FEATURE_HOSTED_BINDER
ICLRPrivBinder * pPrivHostBinder,
-#endif
BOOL bLoadTypeFromPartialNameHack, QCall::ObjectHandleOnStack retType,
QCall::ObjectHandleOnStack keepAlive);
/*fProhibitAsmQualifiedName = */ FALSE,
NULL,
pRequestingAssembly,
-#ifdef FEATURE_HOSTED_BINDER
nullptr,
-#endif
FALSE,
&keepAlive);
BOOL bProhibitAsmQualifiedName,
StackCrawlMark* pStackMark,
BOOL bLoadTypeFromPartialNameHack,
- OBJECTREF *pKeepAlive
-#ifdef FEATURE_HOSTED_BINDER
- , ICLRPrivBinder * pPrivHostBinder
-#endif
- )
+ OBJECTREF *pKeepAlive,
+ ICLRPrivBinder * pPrivHostBinder)
{
STANDARD_VM_CONTRACT;
bProhibitAsmQualifiedName,
pStackMark,
NULL,
-#ifdef FEATURE_HOSTED_BINDER
pPrivHostBinder,
-#endif
bLoadTypeFromPartialNameHack,
pKeepAlive);
bProhibitAsmQualifiedName,
pStackMark,
NULL,
-#ifdef FEATURE_HOSTED_BINDER
pPrivHostBinder,
-#endif
bLoadTypeFromPartialNameHack,
pKeepAlive);
}
}
return pTypeName->GetTypeWorker(bThrowIfNotFound, /*bIgnoreCase = */FALSE, pAssembly->IsIntrospectionOnly(), pAssembly, /*fEnableCASearchRules = */FALSE, FALSE, NULL, NULL,
-#ifdef FEATURE_HOSTED_BINDER
nullptr, // pPrivHostBinder
-#endif
FALSE, NULL /* cannot find a collectible type unless it is in assembly */);
FALSE,
NULL,
NULL,
-#ifdef FEATURE_HOSTED_BINDER
nullptr, // pPrivHostBinder
-#endif
FALSE,
NULL /* cannot find a collectible type */);
}
BOOL bProhibitAsmQualifiedName,
StackCrawlMark* pStackMark,
Assembly* pRequestingAssembly,
-#ifdef FEATURE_HOSTED_BINDER
ICLRPrivBinder * pPrivHostBinder,
-#endif
BOOL bLoadTypeFromPartialNameHack,
OBJECTREF *pKeepAlive)
{
EX_TRY
{
DomainAssembly *pDomainAssembly = LoadDomainAssembly(GetAssembly(), pRequestingAssembly,
-#ifdef FEATURE_HOSTED_BINDER
pPrivHostBinder,
-#endif
bThrowIfNotFound, bIntrospectionOnly, pssOuterTypeName);
if (pDomainAssembly)
{
else
{
DomainAssembly *pDomainAssembly = LoadDomainAssembly(GetAssembly(), pRequestingAssembly,
-#ifdef FEATURE_HOSTED_BINDER
pPrivHostBinder,
-#endif
bThrowIfNotFound, bIntrospectionOnly, pssOuterTypeName);
if (pDomainAssembly)
{
TypeHandle thGenericArg = m_genericArguments[i]->GetTypeWorker(
bThrowIfNotFound, bIgnoreCase, bIntrospectionOnly,
pAssemblyGetType, fEnableCASearchRules, bProhibitAsmQualifiedName, pStackMark, pRequestingAssembly,
-#ifdef FEATURE_HOSTED_BINDER
pPrivHostBinder,
-#endif
bLoadTypeFromPartialNameHack,
(pKeepAlive != NULL) ? &gc.keepAlive : NULL /* Only pass a keepalive parameter if we were passed a keepalive parameter */);
DomainAssembly * LoadDomainAssembly(
SString * psszAssemblySpec,
Assembly * pRequestingAssembly,
-#ifdef FEATURE_HOSTED_BINDER
ICLRPrivBinder * pPrivHostBinder,
-#endif
BOOL bThrowIfNotFound,
BOOL bIntrospectionOnly,
SString * pssOuterTypeName)
spec.SetWindowsRuntimeType(*pssOuterTypeName);
}
-#ifdef FEATURE_HOSTED_BINDER
if (pPrivHostBinder)
{
spec.SetHostBinder(pPrivHostBinder);
}
- else
-#endif
- if (pRequestingAssembly && (!pRequestingAssembly->IsDomainNeutral()) && (!pRequestingAssembly->IsCollectible()))
+ else if (pRequestingAssembly && (!pRequestingAssembly->IsDomainNeutral()) && (!pRequestingAssembly->IsCollectible()))
{
GCX_PREEMP();
spec.SetParentAssembly(pRequestingAssembly->GetDomainAssembly());
DomainAssembly * LoadDomainAssembly(
SString * psszAssemblySpec,
Assembly * pRequestingAssembly,
-#ifdef FEATURE_HOSTED_BINDER
ICLRPrivBinder * pPrivHostBinder,
-#endif
BOOL bThrowIfNotFound,
BOOL bIntrospectionOnly,
SString * pssOuterTypeName);
BOOL bProhibitAssemblyQualifiedName,
StackCrawlMark* pStackMark,
BOOL bLoadTypeFromPartialNameHack,
- OBJECTREF *pKeepAlive
-#ifdef FEATURE_HOSTED_BINDER
- , ICLRPrivBinder * pPrivHostBinder = nullptr
-#endif
- );
+ OBJECTREF *pKeepAlive,
+ ICLRPrivBinder * pPrivHostBinder = nullptr);
public:
StackCrawlMark* pStackMark,
Assembly* pRequestingAssembly,
-#ifdef FEATURE_HOSTED_BINDER
ICLRPrivBinder * pPrivHostBinder,
-#endif
BOOL bLoadTypeFromPartialNameHack,
OBJECTREF *pKeepAlive);
friend class TypeString;
friend SString* TypeName::ToString(SString*, BOOL, BOOL, BOOL);
friend TypeHandle TypeName::GetTypeWorker(BOOL, BOOL, BOOL, Assembly*, BOOL, BOOL, StackCrawlMark*, Assembly*,
-#ifdef FEATURE_HOSTED_BINDER
ICLRPrivBinder * pPrivHostBinder,
-#endif
BOOL, OBJECTREF *);
HRESULT OpenGenericArguments();
HRESULT CloseGenericArguments();
}
else
{
-#if defined(FEATURE_HOSTED_BINDER) && defined(FEATURE_APPX) && !defined(FEATURE_CORECLR)
+#if defined(FEATURE_APPX) && !defined(FEATURE_CORECLR)
if (m_pOpt->m_fAutoNGen)
{
// Make sure we're not been spoofed into loading an assembly that might be unsafe to load.