summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuqun Lou <luqunl@microsoft.com>2015-06-10 15:53:48 -0700
committerLuqun Lou <luqunl@microsoft.com>2015-06-10 15:53:48 -0700
commit2454c1323d82520bc87f9e356faaaeaa44909667 (patch)
treeee1e8cf469e4d62d6179c56e8ccffbfc9da9eedc
parentb23b65a8b12a78d5869510e580811ccf1c2edd23 (diff)
downloadcoreclr-2454c1323d82520bc87f9e356faaaeaa44909667.tar.gz
coreclr-2454c1323d82520bc87f9e356faaaeaa44909667.tar.bz2
coreclr-2454c1323d82520bc87f9e356faaaeaa44909667.zip
Fix Exception Propagation issue for NetCoreForCoreCLR Non-AppX case
Currently in CoreCLR, We don't propagate managed exception from Managed->Native->Managed correctly for non-appx case--- if you throw a managed exception, then during M->N, the managed exception is stored in thread, later during N->M, we will try to fetch this stored exception if it is managed exception by checking IsManagedObject() The logical for IsManagedObject should be just check its IUnknown slots first no matter whether it is appx or not; If doesn't match, try to QI IManagedObject. [tfs-changeset: 1486094]
-rw-r--r--src/vm/interoputil.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/vm/interoputil.cpp b/src/vm/interoputil.cpp
index ca668c59a2..6f672c041b 100644
--- a/src/vm/interoputil.cpp
+++ b/src/vm/interoputil.cpp
@@ -549,17 +549,15 @@ BOOL IsManagedObject(IUnknown *pIUnknown)
}
CONTRACTL_END;
- if (AppX::IsAppXProcess())
+ //Check based on IUnknown slots, i.e. we'll see whether the IP maps to a CCW.
+ if (MapIUnknownToWrapper(pIUnknown) != NULL)
{
- //In AppX we don't support IManagedObject so we'll do the check based on
- //IUnknown slots, i.e. we'll see whether the IP maps to a CCW.
- if (MapIUnknownToWrapper(pIUnknown) != NULL)
- {
- // We found an existing CCW hence this is a managed exception.
- return TRUE;
- }
+ // We found an existing CCW hence this is a managed exception.
+ return TRUE;
}
- else
+
+ // QI IManagedObject. Note AppX doesn't support IManagedObject
+ if (!AppX::IsAppXProcess())
{
SafeComHolder<IManagedObject> pManagedObject = NULL;
HRESULT hrLocal = SafeQueryInterface(pIUnknown, IID_IManagedObject, (IUnknown**)&pManagedObject);