summaryrefslogtreecommitdiff
path: root/src/vm/dllimportcallback.cpp
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2015-09-18 20:32:53 -0700
committerJan Kotas <jkotas@microsoft.com>2015-09-18 20:32:53 -0700
commit9fa52c4b8c4e54ee1023140993be3a12f080b5cd (patch)
treebf2aa2984ede9150caeb56f03d934c9a62d5c5d5 /src/vm/dllimportcallback.cpp
parent1f6172fe2ac167253615f998f42e41167b6f12e8 (diff)
parent1e62862b631fb64c6a9fae0a0084c0ae1d9fbeba (diff)
downloadcoreclr-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.cpp13
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)
{