From d0833f90ed516b08871635a05c1d5657379b8053 Mon Sep 17 00:00:00 2001 From: Luqun Lou Date: Tue, 27 Mar 2018 14:20:09 -0700 Subject: Enable reflection load ComImport assembly and Type.IsComObjectType (#16943) * Enable reflection load ComImport assembly and Type.IsComObjectType * Update Enable reflection load ComImport assembly --- src/vm/ecall.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/vm/ecall.cpp') diff --git a/src/vm/ecall.cpp b/src/vm/ecall.cpp index dacec45787..3812ff1030 100644 --- a/src/vm/ecall.cpp +++ b/src/vm/ecall.cpp @@ -320,10 +320,14 @@ PCODE ECall::GetFCallImpl(MethodDesc * pMD, BOOL * pfSharedOrDynamicFCallImpl /* return GetFCallImpl(MscorlibBinder::GetMethod(METHOD__DELEGATE__CONSTRUCT_DELEGATE)); } -#ifdef FEATURE_COMINTEROP // COM imported classes have special constructors - if (pMT->IsComObjectType() && pMT != g_pBaseCOMObject && pMT != g_pBaseRuntimeClass) + if (pMT->IsComObjectType() +#ifdef FEATURE_COMINTEROP + && pMT != g_pBaseCOMObject && pMT != g_pBaseRuntimeClass +#endif // FEATURE_COMINTEROP + ) { +#ifdef FEATURE_COMINTEROP if (pfSharedOrDynamicFCallImpl) *pfSharedOrDynamicFCallImpl = TRUE; @@ -333,8 +337,10 @@ PCODE ECall::GetFCallImpl(MethodDesc * pMD, BOOL * pfSharedOrDynamicFCallImpl /* // FCComCtor does not need to be in the fcall hashtable since it does not erect frame. return GetEEFuncEntryPoint(FCComCtor); - } +#else + COMPlusThrow(kPlatformNotSupportedException, IDS_EE_ERROR_COM); #endif // FEATURE_COMINTEROP + } if (!pMD->GetModule()->IsSystem()) COMPlusThrow(kSecurityException, BFA_ECALLS_MUST_BE_IN_SYS_MOD); -- cgit v1.2.3