diff options
author | Jan Kotas <jkotas@microsoft.com> | 2018-09-07 15:22:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-07 15:22:40 -0700 |
commit | 41db7d9af54a0a7d9fc365849e7c0fc1dad3a4b9 (patch) | |
tree | 759aeca8c69087f63bc0cf70fd418ff4794dfbd2 /src/vm | |
parent | 8f6db6188d8ab4f05709a4e8c8de54b18f639ec7 (diff) | |
download | coreclr-41db7d9af54a0a7d9fc365849e7c0fc1dad3a4b9.tar.gz coreclr-41db7d9af54a0a7d9fc365849e7c0fc1dad3a4b9.tar.bz2 coreclr-41db7d9af54a0a7d9fc365849e7c0fc1dad3a4b9.zip |
Fixes towards making the runtime compiled without FEATURE_PREJIT defined (#19864)
Diffstat (limited to 'src/vm')
-rw-r--r-- | src/vm/ceeload.h | 56 | ||||
-rw-r--r-- | src/vm/ceeload.inl | 2 | ||||
-rw-r--r-- | src/vm/codeman.h | 3 | ||||
-rw-r--r-- | src/vm/domainfile.cpp | 3 | ||||
-rw-r--r-- | src/vm/exceptionhandling.h | 6 | ||||
-rw-r--r-- | src/vm/inlinetracking.h | 2 | ||||
-rw-r--r-- | src/vm/interoputil.cpp | 2 | ||||
-rw-r--r-- | src/vm/method.hpp | 1 | ||||
-rw-r--r-- | src/vm/methodtablebuilder.cpp | 2 | ||||
-rw-r--r-- | src/vm/pefile.cpp | 127 | ||||
-rw-r--r-- | src/vm/pefile.h | 40 | ||||
-rw-r--r-- | src/vm/peimage.inl | 4 | ||||
-rw-r--r-- | src/vm/readytoruninfo.h | 4 | ||||
-rw-r--r-- | src/vm/stubmgr.cpp | 2 | ||||
-rw-r--r-- | src/vm/zapsig.h | 6 |
15 files changed, 116 insertions, 144 deletions
diff --git a/src/vm/ceeload.h b/src/vm/ceeload.h index d8a278e544..91da7b35ae 100644 --- a/src/vm/ceeload.h +++ b/src/vm/ceeload.h @@ -73,15 +73,14 @@ class Pending; class MethodTable; class AppDomain; class DynamicMethodTable; -struct CerPrepInfo; +class CodeVersionManager; +class CallCounter; +class TieredCompilationManager; #ifdef FEATURE_PREJIT class CerNgenRootTable; struct MethodContextElement; class TypeHandleList; class ProfileEmitter; -class CodeVersionManager; -class CallCounter; -class TieredCompilationManager; class TrackingMap; struct MethodInModule; class PersistentInlineTrackingMapNGen; @@ -508,6 +507,7 @@ typedef DPTR(class MemberRef) PTR_MemberRef; #define IS_FIELD_MEMBER_REF ((TADDR)0x00000002) +#ifdef FEATURE_PREJIT // // NGen image layout information that we need to quickly access at runtime // @@ -557,6 +557,8 @@ struct NGenLayoutInfo PCODE m_pExternalMethodFixupJumpStub; DWORD m_rvaFilterPersonalityRoutine; }; +#endif // FEATURE_PREJIT + // // VASigCookies are allocated to encapsulate a varargs call signature. @@ -1622,13 +1624,15 @@ public: return (m_dwPersistedFlags & COLLECTIBLE_MODULE) != 0; } +#ifdef FEATURE_READYTORUN +private: + PTR_ReadyToRunInfo m_pReadyToRunInfo; +#endif + #ifdef FEATURE_PREJIT private: PTR_NGenLayoutInfo m_pNGenLayoutInfo; -#ifdef FEATURE_READYTORUN - PTR_ReadyToRunInfo m_pReadyToRunInfo; -#endif PTR_ProfilingBlobTable m_pProfilingBlobTable; // While performing IBC instrumenting this hashtable is populated with the External defs CorProfileData * m_pProfileData; // While ngen-ing with IBC optimizations this contains a link to the IBC data for the assembly @@ -2946,25 +2950,6 @@ public: return m_pNGenLayoutInfo->m_VirtualMethodThunks.IsInRange(code); } - BOOL IsReadyToRun() - { - LIMITED_METHOD_DAC_CONTRACT; - -#ifdef FEATURE_READYTORUN - return m_pReadyToRunInfo != NULL; -#else - return FALSE; -#endif - } - -#ifdef FEATURE_READYTORUN - PTR_ReadyToRunInfo GetReadyToRunInfo() - { - LIMITED_METHOD_DAC_CONTRACT; - return m_pReadyToRunInfo; - } -#endif - ICorJitInfo::ProfileBuffer * AllocateProfileBuffer(mdToken _token, DWORD _size, DWORD _ILSize); HANDLE OpenMethodProfileDataLogFile(GUID mvid); static void ProfileDataAllocateTokenLists(ProfileEmitter * pEmitter, TokenProfileData* pTokenProfileData); @@ -3005,6 +2990,25 @@ public: #endif // FEATURE_PREJIT + BOOL IsReadyToRun() + { + LIMITED_METHOD_DAC_CONTRACT; + +#ifdef FEATURE_READYTORUN + return m_pReadyToRunInfo != NULL; +#else + return FALSE; +#endif + } + +#ifdef FEATURE_READYTORUN + PTR_ReadyToRunInfo GetReadyToRunInfo() + { + LIMITED_METHOD_DAC_CONTRACT; + return m_pReadyToRunInfo; + } +#endif + #ifdef _DEBUG //Similar to the ExpandAll we use for NGen, this forces jitting of all methods in a module. This is //used for debug purposes though. diff --git a/src/vm/ceeload.inl b/src/vm/ceeload.inl index 3afef732cc..2c48265dde 100644 --- a/src/vm/ceeload.inl +++ b/src/vm/ceeload.inl @@ -269,10 +269,12 @@ void LookupMap<TYPE>::EnsureElementCanBeStored(Module * pModule, DWORD rid) } CONTRACTL_END; +#ifdef FEATURE_PREJIT // don't attempt to call GetElementPtr for rids inside the compressed portion of // a multi-node map if (MapIsCompressed() && rid < dwCount) return; +#endif PTR_TADDR pElement = GetElementPtr(rid); if (pElement == NULL) GrowMap(pModule, rid); diff --git a/src/vm/codeman.h b/src/vm/codeman.h index e30b6332ac..ebf92e48be 100644 --- a/src/vm/codeman.h +++ b/src/vm/codeman.h @@ -68,6 +68,7 @@ Abstract: #include "shash.h" #include "pedecoder.h" #include "gcinfo.h" +#include "eexcp.h" #if defined(WIN64EXCEPTIONS) && !defined(USE_INDIRECT_CODEHEADER) #error "WIN64EXCEPTIONS requires USE_INDIRECT_CODEHEADER" @@ -1742,7 +1743,9 @@ public: class EECodeInfo { friend BOOL EEJitManager::JitCodeToMethodInfo(RangeSection * pRangeSection, PCODE currentPC, MethodDesc** ppMethodDesc, EECodeInfo * pCodeInfo); +#ifdef FEATURE_PREJIT friend BOOL NativeImageJitManager::JitCodeToMethodInfo(RangeSection * pRangeSection, PCODE currentPC, MethodDesc** ppMethodDesc, EECodeInfo * pCodeInfo); +#endif #ifdef FEATURE_READYTORUN friend BOOL ReadyToRunJitManager::JitCodeToMethodInfo(RangeSection * pRangeSection, PCODE currentPC, MethodDesc** ppMethodDesc, EECodeInfo * pCodeInfo); #endif diff --git a/src/vm/domainfile.cpp b/src/vm/domainfile.cpp index 12d3f3c579..ded1e5715b 100644 --- a/src/vm/domainfile.cpp +++ b/src/vm/domainfile.cpp @@ -748,8 +748,7 @@ void DomainFile::VerifyNativeImageDependencies(bool verifyOnly) CORCOMPILE_VERSION_INFO * pDependencyNativeVersion = pDependencyNativeLayout->GetNativeVersionInfo(); - LoggablePEAssembly logAsm(pDependencyFile); - if (!RuntimeVerifyNativeImageDependency(pDependency, pDependencyNativeVersion, &logAsm)) + if (!RuntimeVerifyNativeImageDependency(pDependency, pDependencyNativeVersion, pDependencyFile)) goto NativeImageRejected; } LOG((LF_ZAP, LL_INFO100, "ZAP: Native image dependencies for %S OK.\n", diff --git a/src/vm/exceptionhandling.h b/src/vm/exceptionhandling.h index 27981e6c32..b678387ad4 100644 --- a/src/vm/exceptionhandling.h +++ b/src/vm/exceptionhandling.h @@ -10,17 +10,17 @@ #ifdef WIN64EXCEPTIONS +#include "eexcp.h" +#include "exstatecommon.h" + #if defined(_TARGET_ARM_) || defined(_TARGET_X86_) #define USE_PER_FRAME_PINVOKE_INIT #endif // _TARGET_ARM_ || _TARGET_X86_ - // This address lies in the NULL pointer partition of the process memory. // Accessing it will result in AV. #define INVALID_RESUME_ADDRESS 0x000000000000bad0 -#include "exstatecommon.h" - EXTERN_C EXCEPTION_DISPOSITION ProcessCLRException(IN PEXCEPTION_RECORD pExceptionRecord WIN64_ARG(IN ULONG64 MemoryStackFp) diff --git a/src/vm/inlinetracking.h b/src/vm/inlinetracking.h index 2cfb35bd50..976a0e72db 100644 --- a/src/vm/inlinetracking.h +++ b/src/vm/inlinetracking.h @@ -37,6 +37,8 @@ class MethodDesc; typedef DPTR(class MethodDesc) PTR_MethodDesc; +class ZapHeap; + struct MethodInModule { Module *m_module; diff --git a/src/vm/interoputil.cpp b/src/vm/interoputil.cpp index 24afdf73fa..8bf5842acd 100644 --- a/src/vm/interoputil.cpp +++ b/src/vm/interoputil.cpp @@ -3907,6 +3907,7 @@ BOOL MethodNeedsForwardComStub(MethodDesc *pMD, DataImage *pImage) return FALSE; } +#ifdef FEATURE_PREJIT //--------------------------------------------------------------------------- // Determines if a method is visible from COM in a way that requires a marshaling // stub, i.e. it allows early binding. @@ -3992,6 +3993,7 @@ BOOL MethodNeedsReverseComStub(MethodDesc *pMD) return IsMethodVisibleFromCom(pMD); } +#endif // FEATURE_PREJIT #ifndef CROSSGEN_COMPILE diff --git a/src/vm/method.hpp b/src/vm/method.hpp index 7674f5e2f9..5ed6869222 100644 --- a/src/vm/method.hpp +++ b/src/vm/method.hpp @@ -45,6 +45,7 @@ class DynamicMethodDesc; class ReJitManager; class CodeVersionManager; class PrepareCodeConfig; +class CallCounter; typedef DPTR(FCallMethodDesc) PTR_FCallMethodDesc; typedef DPTR(ArrayMethodDesc) PTR_ArrayMethodDesc; diff --git a/src/vm/methodtablebuilder.cpp b/src/vm/methodtablebuilder.cpp index 5739831727..56397ca267 100644 --- a/src/vm/methodtablebuilder.cpp +++ b/src/vm/methodtablebuilder.cpp @@ -6516,6 +6516,7 @@ VOID MethodTableBuilder::PlaceInterfaceDeclarationOnClass( pDecl->GetSlotIndex(), pImpl); +#ifdef FEATURE_PREJIT if (IsCompilationProcess()) { // @@ -6527,6 +6528,7 @@ VOID MethodTableBuilder::PlaceInterfaceDeclarationOnClass( pDeclMT->GetWriteableDataForWrite()->SetIsOverridingInterface(); } } +#endif #ifdef _DEBUG if (bmtInterface->dbg_fShouldInjectInterfaceDuplicates) diff --git a/src/vm/pefile.cpp b/src/vm/pefile.cpp index d417545287..69dd4d067d 100644 --- a/src/vm/pefile.cpp +++ b/src/vm/pefile.cpp @@ -1034,7 +1034,7 @@ extern DWORD g_dwLogLevel; //=========================================================================================================== // Encapsulates CLR and Fusion logging for runtime verification of native images. //=========================================================================================================== -static void RuntimeVerifyVLog(DWORD level, LoggableAssembly *pLogAsm, const WCHAR *fmt, va_list args) +static void RuntimeVerifyVLog(DWORD level, PEAssembly *pLogAsm, const WCHAR *fmt, va_list args) { STANDARD_VM_CONTRACT; @@ -1046,7 +1046,7 @@ static void RuntimeVerifyVLog(DWORD level, LoggableAssembly *pLogAsm, const WCHA if (fOutputToLogging) { - SString displayString = pLogAsm->DisplayString(); + SString displayString = pLogAsm->GetPath(); LOG((LF_ZAP, level, "%s: \"%S\"\n", "ZAP", displayString.GetUnicode())); LOG((LF_ZAP, level, "%S", message.GetUnicode())); LOG((LF_ZAP, level, "\n")); @@ -1054,7 +1054,7 @@ static void RuntimeVerifyVLog(DWORD level, LoggableAssembly *pLogAsm, const WCHA if (fOutputToDebugger) { - SString displayString = pLogAsm->DisplayString(); + SString displayString = pLogAsm->GetPath(); WszOutputDebugString(W("CLR:(")); WszOutputDebugString(displayString.GetUnicode()); WszOutputDebugString(W(") ")); @@ -1068,7 +1068,7 @@ static void RuntimeVerifyVLog(DWORD level, LoggableAssembly *pLogAsm, const WCHA //=========================================================================================================== // Encapsulates CLR and Fusion logging for runtime verification of native images. //=========================================================================================================== -static void RuntimeVerifyLog(DWORD level, LoggableAssembly *pLogAsm, const WCHAR *fmt, ...) +static void RuntimeVerifyLog(DWORD level, PEAssembly *pLogAsm, const WCHAR *fmt, ...) { STANDARD_VM_CONTRACT; @@ -1156,67 +1156,6 @@ extern HMODULE CorCompileGetRuntimeDll(CorCompileRuntimeDlls id) #endif // CROSSGEN_COMPILE //=========================================================================================================== -// Helper for RuntimeVerifyNativeImageVersion(). Compares the loaded clr.dll and clrjit.dll's against -// the ones the native image was compiled against. -//=========================================================================================================== -static BOOL RuntimeVerifyNativeImageTimestamps(const CORCOMPILE_VERSION_INFO *info, LoggableAssembly *pLogAsm) -{ - STANDARD_VM_CONTRACT; - - - return TRUE; -} - -//=========================================================================================================== -// Validates that an NI matches the running CLR, OS, CPU, etc. This is the entrypoint used by the CLR loader. -// -//=========================================================================================================== -BOOL PEAssembly::CheckNativeImageVersion(PEImage *peimage) -{ - STANDARD_VM_CONTRACT; - - // - // Get the zap version header. Note that modules will not have version - // headers - they add no additional versioning constraints from their - // assemblies. - // - PEImageLayoutHolder image=peimage->GetLayout(PEImageLayout::LAYOUT_ANY,PEImage::LAYOUT_CREATEIFNEEDED); - - if (!image->HasNativeHeader()) - return FALSE; - - if (!image->CheckNativeHeaderVersion()) - { - // Wrong native image version is fatal error on CoreCLR - ThrowHR(COR_E_NI_AND_RUNTIME_VERSION_MISMATCH); - } - - CORCOMPILE_VERSION_INFO *info = image->GetNativeVersionInfo(); - if (info == NULL) - return FALSE; - - LoggablePEAssembly logAsm(this); - if (!RuntimeVerifyNativeImageVersion(info, &logAsm)) - { - // Wrong native image version is fatal error on CoreCLR - ThrowHR(COR_E_NI_AND_RUNTIME_VERSION_MISMATCH); - } - - CorCompileConfigFlags configFlags = PEFile::GetNativeImageConfigFlagsWithOverrides(); - - // Otherwise, match regardless of the instrumentation flags - configFlags = (CorCompileConfigFlags) (configFlags & ~(CORCOMPILE_CONFIG_INSTRUMENTATION_NONE | CORCOMPILE_CONFIG_INSTRUMENTATION)); - - if ((info->wConfigFlags & configFlags) != configFlags) - { - return FALSE; - } - - return TRUE; -} - - -//=========================================================================================================== // Validates that an NI matches the running CLR, OS, CPU, etc. // // For historial reasons, some versions of the runtime perform this check at native bind time (preferrred), @@ -1225,13 +1164,10 @@ BOOL PEAssembly::CheckNativeImageVersion(PEImage *peimage) // This is the common funnel for both versions and is agnostic to whether the "assembly" is represented // by a CLR object or Fusion object. //=========================================================================================================== -BOOL RuntimeVerifyNativeImageVersion(const CORCOMPILE_VERSION_INFO *info, LoggableAssembly *pLogAsm) +BOOL RuntimeVerifyNativeImageVersion(const CORCOMPILE_VERSION_INFO *info, PEAssembly *pLogAsm) { STANDARD_VM_CONTRACT; - if (!RuntimeVerifyNativeImageTimestamps(info, pLogAsm)) - return FALSE; - // // Check that the EE version numbers are the same. // @@ -1295,6 +1231,53 @@ BOOL RuntimeVerifyNativeImageVersion(const CORCOMPILE_VERSION_INFO *info, Loggab return TRUE; } +//=========================================================================================================== +// Validates that an NI matches the running CLR, OS, CPU, etc. This is the entrypoint used by the CLR loader. +// +//=========================================================================================================== +BOOL PEAssembly::CheckNativeImageVersion(PEImage *peimage) +{ + STANDARD_VM_CONTRACT; + + // + // Get the zap version header. Note that modules will not have version + // headers - they add no additional versioning constraints from their + // assemblies. + // + PEImageLayoutHolder image = peimage->GetLayout(PEImageLayout::LAYOUT_ANY, PEImage::LAYOUT_CREATEIFNEEDED); + + if (!image->HasNativeHeader()) + return FALSE; + + if (!image->CheckNativeHeaderVersion()) + { + // Wrong native image version is fatal error on CoreCLR + ThrowHR(COR_E_NI_AND_RUNTIME_VERSION_MISMATCH); + } + + CORCOMPILE_VERSION_INFO *info = image->GetNativeVersionInfo(); + if (info == NULL) + return FALSE; + + if (!RuntimeVerifyNativeImageVersion(info, this)) + { + // Wrong native image version is fatal error on CoreCLR + ThrowHR(COR_E_NI_AND_RUNTIME_VERSION_MISMATCH); + } + + CorCompileConfigFlags configFlags = PEFile::GetNativeImageConfigFlagsWithOverrides(); + + // Otherwise, match regardless of the instrumentation flags + configFlags = (CorCompileConfigFlags)(configFlags & ~(CORCOMPILE_CONFIG_INSTRUMENTATION_NONE | CORCOMPILE_CONFIG_INSTRUMENTATION)); + + if ((info->wConfigFlags & configFlags) != configFlags) + { + return FALSE; + } + + return TRUE; +} + #endif // !DACCESS_COMPILE /* static */ @@ -1401,14 +1384,14 @@ CorCompileConfigFlags PEFile::GetNativeImageConfigFlagsWithOverrides() //=========================================================================================================== BOOL RuntimeVerifyNativeImageDependency(const CORCOMPILE_NGEN_SIGNATURE &ngenSigExpected, const CORCOMPILE_VERSION_INFO *pActual, - LoggableAssembly *pLogAsm) + PEAssembly *pLogAsm) { STANDARD_VM_CONTRACT; if (ngenSigExpected != pActual->signature) { // Signature did not match - SString displayString = pLogAsm->DisplayString(); + SString displayString = pLogAsm->GetPath(); RuntimeVerifyLog(LL_ERROR, pLogAsm, W("Rejecting native image because native image dependency %s ") @@ -1422,7 +1405,7 @@ BOOL RuntimeVerifyNativeImageDependency(const CORCOMPILE_NGEN_SIGNATURE &ngenSig // Wrapper function for use by parts of the runtime that actually have a CORCOMPILE_DEPENDENCY to work with. BOOL RuntimeVerifyNativeImageDependency(const CORCOMPILE_DEPENDENCY *pExpected, const CORCOMPILE_VERSION_INFO *pActual, - LoggableAssembly *pLogAsm) + PEAssembly *pLogAsm) { WRAPPER_NO_CONTRACT; diff --git a/src/vm/pefile.h b/src/vm/pefile.h index e79c94c954..699b4e44d3 100644 --- a/src/vm/pefile.h +++ b/src/vm/pefile.h @@ -814,43 +814,9 @@ typedef ReleaseHolder<PEFile> PEFileHolder; typedef ReleaseHolder<PEAssembly> PEAssemblyHolder; - - -// A small shim around PEAssemblies/IBindResult that allow us to write Fusion/CLR-agnostic -// for logging native bind failures to the Fusion log/CLR log. -// -// These structures are stack-based, non-thread-safe and created for the duration of a single RuntimeVerify call. -// The methods are expected to compute their data lazily as they are only used in bind failures or in checked builds. -class LoggablePEAssembly : public LoggableAssembly -{ - public: - virtual SString DisplayString() - { - STANDARD_VM_CONTRACT; - - return m_peAssembly->GetPath(); - } - - - LoggablePEAssembly(PEAssembly *peAssembly) - { - LIMITED_METHOD_CONTRACT; - - m_peAssembly = peAssembly; - peAssembly->AddRef(); - } - - ~LoggablePEAssembly() - { - LIMITED_METHOD_CONTRACT; - - m_peAssembly->Release(); - } - - private: - PEAssembly *m_peAssembly; -}; - +BOOL RuntimeVerifyNativeImageDependency(const CORCOMPILE_DEPENDENCY *pExpected, + const CORCOMPILE_VERSION_INFO *pActual, + PEAssembly *pLogAsm); // ================================================================================ // Inline definitions diff --git a/src/vm/peimage.inl b/src/vm/peimage.inl index 57f5400855..8a9c96c77f 100644 --- a/src/vm/peimage.inl +++ b/src/vm/peimage.inl @@ -376,6 +376,7 @@ inline const BOOL PEImage::HasStrongNameSignature() inline BOOL PEImage::IsIbcOptimized() { +#ifdef FEATURE_PREJIT WRAPPER_NO_CONTRACT; if (HasLoadedLayout()) return GetLoadedLayout()->GetNativeILIsIbcOptimized(); @@ -384,6 +385,9 @@ inline BOOL PEImage::IsIbcOptimized() PEImageLayoutHolder pLayout(GetLayout(PEImageLayout::LAYOUT_ANY,LAYOUT_CREATEIFNEEDED)); return pLayout->GetNativeILIsIbcOptimized(); } +#else + return false; +#endif } #ifdef FEATURE_PREJIT diff --git a/src/vm/readytoruninfo.h b/src/vm/readytoruninfo.h index 210399f81e..fea5b33c14 100644 --- a/src/vm/readytoruninfo.h +++ b/src/vm/readytoruninfo.h @@ -17,6 +17,10 @@ typedef DPTR(struct READYTORUN_SECTION) PTR_READYTORUN_SECTION; +#ifndef FEATURE_PREJIT +typedef DPTR(struct READYTORUN_IMPORT_SECTION) PTR_CORCOMPILE_IMPORT_SECTION; +#endif + class PrepareCodeConfig; typedef DPTR(class ReadyToRunInfo) PTR_ReadyToRunInfo; diff --git a/src/vm/stubmgr.cpp b/src/vm/stubmgr.cpp index 2a36908d3f..58c0fa34f5 100644 --- a/src/vm/stubmgr.cpp +++ b/src/vm/stubmgr.cpp @@ -1522,6 +1522,7 @@ BOOL RangeSectionStubManager::DoTraceStub(PCODE stubStartAddress, TraceDestinati case STUB_CODE_BLOCK_STUBLINK: return StubLinkStubManager::g_pManager->DoTraceStub(stubStartAddress, trace); +#ifdef FEATURE_PREJIT case STUB_CODE_BLOCK_VIRTUAL_METHOD_THUNK: { PCODE pTarget = GetMethodThunkTarget(stubStartAddress); @@ -1540,6 +1541,7 @@ BOOL RangeSectionStubManager::DoTraceStub(PCODE stubStartAddress, TraceDestinati } return TRUE; } +#endif case STUB_CODE_BLOCK_EXTERNAL_METHOD_THUNK: { diff --git a/src/vm/zapsig.h b/src/vm/zapsig.h index 258e821aa8..69be660ee6 100644 --- a/src/vm/zapsig.h +++ b/src/vm/zapsig.h @@ -18,16 +18,14 @@ #include "common.h" -//define function pointer type: EncodeModuleCallback -// +typedef DWORD(*ENCODEMODULE_CALLBACK)(LPVOID pModuleContext, CORINFO_MODULE_HANDLE moduleHandle); typedef DWORD (*EncodeModuleCallback)(void* pModuleContext, Module *pReferencedModule); enum { // return value when EncodeModule fails ENCODE_MODULE_FAILED = 0xffffffff, }; -//define function pointer type: TokenDefinitionCallback -// +typedef void(*DEFINETOKEN_CALLBACK)(LPVOID pModuleContext, CORINFO_MODULE_HANDLE moduleHandle, DWORD index, mdTypeRef* token); typedef void (*TokenDefinitionCallback)(void* pModuleContext, Module *pReferencedModule, DWORD index, mdToken* refToken); class ZapSig |