From e2fd69c731e5496f6cf9bd9fb5a326a8ba4284c8 Mon Sep 17 00:00:00 2001 From: "Yi Zhang (CLR)" Date: Sat, 10 Jun 2017 09:08:41 -0700 Subject: [PATCH] Disable IEnumerable.GetEnumerator on RCW through IDispatch (dotnet/coreclr#11865) Commit migrated from https://github.com/dotnet/coreclr/commit/d4a4144b622e4304ca04d450807a18807027ab38 --- src/coreclr/src/vm/mngstdinterfaces.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/coreclr/src/vm/mngstdinterfaces.cpp b/src/coreclr/src/vm/mngstdinterfaces.cpp index ec1475d..5aafe8a 100644 --- a/src/coreclr/src/vm/mngstdinterfaces.cpp +++ b/src/coreclr/src/vm/mngstdinterfaces.cpp @@ -994,8 +994,9 @@ FCIMPL1(Object*, StdMngIEnumerable::GetEnumerator, Object* refThisUNSAFE) if (retVal == NULL) { - // classic COM interop scenario - retVal = ObjectToOBJECTREF((Object*)GetEnumeratorWorker(args)); + // In desktop CLR we'll attempt to call through IDispatch(DISPID_NEWENUM) + // This is not supported in CoreCLR + COMPlusThrow(kPlatformNotSupportedException, IDS_EE_ERROR_IDISPATCH); } GCPROTECT_END(); -- 2.7.4