diff options
author | Jan Kotas <jkotas@microsoft.com> | 2015-09-18 20:32:53 -0700 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2015-09-18 20:32:53 -0700 |
commit | 9fa52c4b8c4e54ee1023140993be3a12f080b5cd (patch) | |
tree | bf2aa2984ede9150caeb56f03d934c9a62d5c5d5 /src/vm/dllimportcallback.cpp | |
parent | 1f6172fe2ac167253615f998f42e41167b6f12e8 (diff) | |
parent | 1e62862b631fb64c6a9fae0a0084c0ae1d9fbeba (diff) | |
download | coreclr-9fa52c4b8c4e54ee1023140993be3a12f080b5cd.tar.gz coreclr-9fa52c4b8c4e54ee1023140993be3a12f080b5cd.tar.bz2 coreclr-9fa52c4b8c4e54ee1023140993be3a12f080b5cd.zip |
Merge pull request #1566 from tijoytom/master
Implement NativeCallableMethods for CoreCLR
Diffstat (limited to 'src/vm/dllimportcallback.cpp')
-rw-r--r-- | src/vm/dllimportcallback.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/vm/dllimportcallback.cpp b/src/vm/dllimportcallback.cpp index 0c4ac1784f..95f6091b1a 100644 --- a/src/vm/dllimportcallback.cpp +++ b/src/vm/dllimportcallback.cpp @@ -1090,6 +1090,19 @@ UMEntryThunk *UMEntryThunkCache::GetUMEntryThunk(MethodDesc *pMD) RETURN pThunk; } +// FailFast if a native callable method invoked directly from managed code. +// UMThunkStub.asm check the mode and call this function to failfast. +extern "C" VOID STDCALL ReversePInvokeBadTransition() +{ + STATIC_CONTRACT_THROWS; + STATIC_CONTRACT_GC_TRIGGERS; + // Fail + EEPOLICY_HANDLE_FATAL_ERROR_WITH_MESSAGE( + COR_E_EXECUTIONENGINE, + W("Invalid Program: attempted to call a NativeCallable method from runtime-typesafe code.") + ); +} + // Disable from a place that is calling into managed code via a UMEntryThunk. extern "C" VOID STDCALL UMThunkStubRareDisableWorker(Thread *pThread, UMEntryThunk *pUMEntryThunk) { |