summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2016-10-12 14:39:43 -0700
committerGitHub <noreply@github.com>2016-10-12 14:39:43 -0700
commit41f083792c77da3ba3b83ce7e5580e9c3287a3ef (patch)
tree5c6ac86f92cbb2aed2deecd3248bafab067a67cd
parent983e6cf9f3d06c9a5120ed2aeb382742948382ab (diff)
downloadcoreclr-41f083792c77da3ba3b83ce7e5580e9c3287a3ef.tar.gz
coreclr-41f083792c77da3ba3b83ce7e5580e9c3287a3ef.tar.bz2
coreclr-41f083792c77da3ba3b83ce7e5580e9c3287a3ef.zip
Return false from IsMarshalByRefImpl/IsContextfulImpl when remoting is not supported (#7583)
Remove references to types have been moved to corefx in the build Consolidate FEATURE_CORECLR ifdefs
-rw-r--r--src/mscorlib/model.xml36
-rw-r--r--src/mscorlib/mscorlib.shared.sources.props8
-rw-r--r--src/mscorlib/ref/mscorlib.cs58
-rw-r--r--src/mscorlib/src/System/BCLDebug.cs2
-rw-r--r--src/mscorlib/src/System/IO/Path.cs2
-rw-r--r--src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs14
-rw-r--r--src/mscorlib/src/System/Type.cs13
-rw-r--r--src/vm/metasig.h3
-rw-r--r--src/vm/mscorlib.h3
-rw-r--r--src/vm/rexcep.h4
-rw-r--r--src/vm/threads.cpp111
11 files changed, 46 insertions, 208 deletions
diff --git a/src/mscorlib/model.xml b/src/mscorlib/model.xml
index 54915fea75..bf3a49c1e5 100644
--- a/src/mscorlib/model.xml
+++ b/src/mscorlib/model.xml
@@ -1083,18 +1083,6 @@
<Type Name="System.Reflection.Metadata.AssemblyExtensions">
<Member Name="TryGetRawMetadata(System.Reflection.Assembly,System.Byte*@,System.Int32@)"/>
</Type>
- <Type Name="System.ContextBoundObject">
- <Member Name="#ctor" />
- </Type>
- <Type Name="System.ContextMarshalException">
- <Member Name="#ctor" />
- <Member Name="#ctor(System.String)" />
- <Member Name="#ctor(System.String,System.Exception)" />
- <Member Name="#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" />
- </Type>
- <Type Name="System.ContextStaticAttribute">
- <Member Name="#ctor" />
- </Type>
<Type Name="System.Convert">
<Member MemberType="Field" Name="DBNull" />
<Member Name="ChangeType(System.Object,System.Type)" />
@@ -6989,16 +6977,6 @@
<Member MemberType="Field" Name="IInspectable" />
<Member MemberType="Field" Name="IUnknown" />
</Type>
- <Type Status="ApiRoot" Name="System.Runtime.Versioning.ComponentGuaranteesAttribute">
- <Member Name="#ctor(System.Runtime.Versioning.ComponentGuaranteesOptions)" />
- <Member MemberType="Property" Name="Guarantees" />
- </Type>
- <Type Name="System.Runtime.Versioning.ComponentGuaranteesOptions">
- <Member MemberType="Field" Name="None" />
- <Member MemberType="Field" Name="Exchange" />
- <Member MemberType="Field" Name="Stable" />
- <Member MemberType="Field" Name="value__" />
- </Type>
<Type Name="System.RuntimeFieldHandle">
<Member Status="ImplRoot" Name="#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" />
<Member Name="Equals(System.RuntimeFieldHandle)" />
@@ -10459,25 +10437,11 @@
<Member Name="RemoveEventHandler&lt;T&gt;(System.Action&lt;System.Runtime.InteropServices.WindowsRuntime.EventRegistrationToken&gt;,T)" />
<Member Name="StringToHString(System.String)" />
</Type>
- <Type Status="ImplRoot" Name="System.Runtime.Versioning.ResourceConsumptionAttribute">
- <Member Name="#ctor(System.Runtime.Versioning.ResourceScope)" />
- <Member Name="#ctor(System.Runtime.Versioning.ResourceScope,System.Runtime.Versioning.ResourceScope)" />
- <Member MemberType="Property" Name="ConsumptionScope" />
- <Member MemberType="Property" Name="ResourceScope" />
- </Type>
- <Type Status="ApiRoot" Name="System.Runtime.Versioning.ResourceExposureAttribute">
- <Member Name="#ctor(System.Runtime.Versioning.ResourceScope)" />
- <Member MemberType="Property" Name="ResourceExposureLevel" />
- </Type>
<Type Status="ApiRoot" Name="System.Runtime.Versioning.TargetFrameworkAttribute">
<Member Name="#ctor(System.String)" />
<Member MemberType="Property" Name="FrameworkName" />
<Member MemberType="Property" Name="FrameworkDisplayName" />
</Type>
- <Type Status="ApiRoot" Name="System.Runtime.Versioning.VersioningHelper">
- <Member Name="MakeVersionSafeName(System.String,System.Runtime.Versioning.ResourceScope,System.Runtime.Versioning.ResourceScope)" />
- <Member Name="MakeVersionSafeName(System.String,System.Runtime.Versioning.ResourceScope,System.Runtime.Versioning.ResourceScope,System.Type)" />
- </Type>
<Type Name="System.Runtime.Serialization.FormatterServices">
<Member Name="GetUninitializedObject(System.Type)" />
</Type>
diff --git a/src/mscorlib/mscorlib.shared.sources.props b/src/mscorlib/mscorlib.shared.sources.props
index 17e255457a..6d79a76de9 100644
--- a/src/mscorlib/mscorlib.shared.sources.props
+++ b/src/mscorlib/mscorlib.shared.sources.props
@@ -338,8 +338,8 @@
<SystemSources Condition="'$(FeatureCoreClr)'=='true'" Include="$(BclSourcesRoot)\System\LowLevelConsole.cs" />
<SystemSources Include="$(BclSourcesRoot)\System\ContextMarshalException.cs" />
<SystemSources Include="$(BclSourcesRoot)\System\Convert.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ContextBoundObject.cs" />
- <SystemSources Include="$(BclSourcesRoot)\System\ContextStaticAttribute.cs" />
+ <SystemSources Condition="'$(FeatureCoreClr)'!='true'" Include="$(BclSourcesRoot)\System\ContextBoundObject.cs" />
+ <SystemSources Condition="'$(FeatureCoreClr)'!='true'" Include="$(BclSourcesRoot)\System\ContextStaticAttribute.cs" />
<SystemSources Include="$(BclSourcesRoot)\System\StringFreezingAttribute.cs" />
<SystemSources Include="$(BclSourcesRoot)\System\Currency.cs" />
<SystemSources Include="$(BclSourcesRoot)\System\DayOfWeek.cs" />
@@ -965,8 +965,8 @@
</ItemGroup>
<ItemGroup>
<VersioningSources Include="$(BclSourcesRoot)\System\Runtime\Versioning\BinaryCompatibility.cs" />
- <VersioningSources Include="$(BclSourcesRoot)\System\Runtime\Versioning\ComponentGuaranteesAttribute.cs" />
- <VersioningSources Include="$(BclSourcesRoot)\System\Runtime\Versioning\ResourceAttributes.cs" />
+ <VersioningSources Condition="'$(FeatureCoreClr)'!='true'" Include="$(BclSourcesRoot)\System\Runtime\Versioning\ComponentGuaranteesAttribute.cs" />
+ <VersioningSources Condition="'$(FeatureCoreClr)'!='true'" Include="$(BclSourcesRoot)\System\Runtime\Versioning\ResourceAttributes.cs" />
<VersioningSources Include="$(BclSourcesRoot)\System\Runtime\Versioning\TargetFrameworkAttribute.cs" />
<VersioningSources Include="$(BclSourcesRoot)\System\Runtime\Versioning\TargetFrameworkId.cs" />
<VersioningSources Include="$(BclSourcesRoot)\System\Runtime\Versioning\CompatibilitySwitch.cs" />
diff --git a/src/mscorlib/ref/mscorlib.cs b/src/mscorlib/ref/mscorlib.cs
index 1231d89674..1299b793be 100644
--- a/src/mscorlib/ref/mscorlib.cs
+++ b/src/mscorlib/ref/mscorlib.cs
@@ -803,26 +803,6 @@ namespace System
public static void WriteLine() { }
public static void WriteLine(string s) { }
}
- [System.Runtime.InteropServices.ComVisibleAttribute(true)]
- public abstract partial class ContextBoundObject
- {
- protected ContextBoundObject() { }
- }
- [System.Runtime.InteropServices.ComVisibleAttribute(true)]
- public partial class ContextMarshalException : System.SystemException
- {
- public ContextMarshalException() { }
- public ContextMarshalException(string message) { }
- public ContextMarshalException(string message, System.Exception inner) { }
- protected ContextMarshalException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
- }
- [System.AttributeUsageAttribute((System.AttributeTargets)(256), Inherited=false)]
- [System.ObsoleteAttribute("ContextStaticAttribute is not supported in this release. It has been left in so that legacy tools can be used with this release, but it cannot be used in your code.", true)]
- [System.Runtime.InteropServices.ComVisibleAttribute(true)]
- public partial class ContextStaticAttribute : System.Attribute
- {
- public ContextStaticAttribute() { }
- }
public static partial class Convert
{
public static readonly object DBNull;
@@ -11979,38 +11959,6 @@ namespace System.Runtime.Serialization
}
namespace System.Runtime.Versioning
{
- [System.AttributeUsageAttribute((System.AttributeTargets)(5887), AllowMultiple=false, Inherited=false)]
- public sealed partial class ComponentGuaranteesAttribute : System.Attribute
- {
- public ComponentGuaranteesAttribute(System.Runtime.Versioning.ComponentGuaranteesOptions guarantees) { }
- public System.Runtime.Versioning.ComponentGuaranteesOptions Guarantees { get { throw null; } }
- }
- [System.FlagsAttribute]
- public enum ComponentGuaranteesOptions
- {
- Exchange = 1,
- None = 0,
- SideBySide = 4,
- Stable = 2,
- }
- [System.AttributeUsageAttribute((System.AttributeTargets)(480), Inherited=false)]
- [System.Diagnostics.ConditionalAttribute("RESOURCE_ANNOTATION_WORK")]
- public sealed partial class ResourceExposureAttribute : System.Attribute
- {
- public ResourceExposureAttribute(System.Runtime.Versioning.ResourceScope exposureLevel) { }
- public System.Runtime.Versioning.ResourceScope ResourceExposureLevel { get { throw null; } }
- }
- [System.FlagsAttribute]
- public enum ResourceScope
- {
- AppDomain = 4,
- Assembly = 32,
- Library = 8,
- Machine = 1,
- None = 0,
- Private = 16,
- Process = 2,
- }
[System.AttributeUsageAttribute((System.AttributeTargets)(1), AllowMultiple=false, Inherited=false)]
public sealed partial class TargetFrameworkAttribute : System.Attribute
{
@@ -12018,12 +11966,6 @@ namespace System.Runtime.Versioning
public string FrameworkDisplayName { get { throw null; } set { } }
public string FrameworkName { get { throw null; } }
}
- public static partial class VersioningHelper
- {
- public static string MakeVersionSafeName(string name, System.Runtime.Versioning.ResourceScope from, System.Runtime.Versioning.ResourceScope to) { throw null; }
- [System.Security.SecuritySafeCriticalAttribute]
- public static string MakeVersionSafeName(string name, System.Runtime.Versioning.ResourceScope from, System.Runtime.Versioning.ResourceScope to, System.Type type) { throw null; }
- }
}
namespace System.Security
{
diff --git a/src/mscorlib/src/System/BCLDebug.cs b/src/mscorlib/src/System/BCLDebug.cs
index 9b2ade26fa..f5ad6aaa8e 100644
--- a/src/mscorlib/src/System/BCLDebug.cs
+++ b/src/mscorlib/src/System/BCLDebug.cs
@@ -338,6 +338,7 @@ namespace System {
System.Diagnostics.Log.LogMessage(LoggingLevels.TraceLevel0, logSwitch, trace.ToString());
}
+#if !FEATURE_CORECLR
// For logging errors related to the console - we often can't expect to
// write to stdout if it doesn't exist.
[SecuritySafeCritical]
@@ -360,6 +361,7 @@ namespace System {
err.WriteLine(msg);
}
}
+#endif // !FEATURE_CORECLR
// For perf-related asserts. On a debug build, set the registry key
// BCLPerfWarnings to non-zero.
diff --git a/src/mscorlib/src/System/IO/Path.cs b/src/mscorlib/src/System/IO/Path.cs
index 4f7993633b..0a28d67b73 100644
--- a/src/mscorlib/src/System/IO/Path.cs
+++ b/src/mscorlib/src/System/IO/Path.cs
@@ -466,8 +466,6 @@ namespace System.IO {
/// Normalize the path and check for bad characters or other invalid syntax.
/// </summary>
[System.Security.SecuritySafeCritical]
- [ResourceExposure(ResourceScope.Machine)]
- [ResourceConsumption(ResourceScope.Machine)]
private static string NewNormalizePath(string path, int maxPathLength, bool expandShortPaths)
{
Contract.Requires(path != null, "path can't be null");
diff --git a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs
index ce2a592ae2..ec75d6ded4 100644
--- a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs
+++ b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs
@@ -1295,11 +1295,7 @@ namespace System.Reflection.Emit
throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_BadResourceContainer"));
}
}
-#endif // !FEATURE_CORECLR
-#if FEATURE_CORECLR
- [System.Security.SecurityCritical] // auto-generated
-#endif
public void DefineManifestResource(String name, Stream stream, ResourceAttributes attribute)
{
if (name == null)
@@ -1324,7 +1320,6 @@ namespace System.Reflection.Emit
throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_BadResourceContainer"));
Contract.EndContractBlock();
-#if !FEATURE_CORECLR
if (name == null)
throw new ArgumentNullException("name");
if (name.Length == 0)
@@ -1344,13 +1339,9 @@ namespace System.Reflection.Emit
{
throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_BadResourceContainer"));
}
-#endif // !FEATURE_CORECLR
}
-#if FEATURE_CORECLR
- [System.Security.SecurityCritical] // auto-generated
-#endif
public void DefineUnmanagedResource(Byte[] resource)
{
lock(SyncRoot)
@@ -1372,11 +1363,7 @@ namespace System.Reflection.Emit
Buffer.BlockCopy(resource, 0, m_moduleData.m_resourceBytes, 0, resource.Length);
}
-#if FEATURE_CORECLR
- [System.Security.SecurityCritical] // auto-generated
-#else
[System.Security.SecuritySafeCritical]
-#endif
public void DefineUnmanagedResource(String resourceFileName)
{
lock(SyncRoot)
@@ -1415,6 +1402,7 @@ namespace System.Reflection.Emit
m_moduleData.m_strResourceFileName = strFullFileName;
}
+#endif // !FEATURE_CORECLR
#endregion
#region Define Global Method
diff --git a/src/mscorlib/src/System/Type.cs b/src/mscorlib/src/System/Type.cs
index 730003307a..467a228b67 100644
--- a/src/mscorlib/src/System/Type.cs
+++ b/src/mscorlib/src/System/Type.cs
@@ -1306,13 +1306,20 @@ namespace System {
// Protected routine to determine if this class is contextful
protected virtual bool IsContextfulImpl(){
+#if FEATURE_REMOTING
return typeof(ContextBoundObject).IsAssignableFrom(this);
+#else
+ return false;
+#endif
}
-
// Protected routine to determine if this class is marshaled by ref
protected virtual bool IsMarshalByRefImpl(){
+#if FEATURE_REMOTING
return typeof(MarshalByRefObject).IsAssignableFrom(this);
+#else
+ return false;
+#endif
}
internal virtual bool HasProxyAttributeImpl()
@@ -1362,7 +1369,7 @@ namespace System {
return rootElementType;
}
- #region Enum methods
+#region Enum methods
// Default implementations of GetEnumNames, GetEnumValues, and GetEnumUnderlyingType
// Subclass of types can override these methods.
@@ -1561,7 +1568,7 @@ namespace System {
t == typeof(char) ||
t == typeof(bool));
}
- #endregion
+#endregion
public virtual bool IsSecurityCritical { [Pure] get { throw new NotImplementedException(); } }
diff --git a/src/vm/metasig.h b/src/vm/metasig.h
index 5bf2903eab..a8404615a1 100644
--- a/src/vm/metasig.h
+++ b/src/vm/metasig.h
@@ -302,7 +302,10 @@ DEFINE_METASIG(SM(Int_IntPtr_RetObj, i I, j))
DEFINE_METASIG(SM(IntPtr_IntPtr_Int_RetVoid, I I i, v))
DEFINE_METASIG_T(SM(Exception_RetInt, C(EXCEPTION), i))
+#ifdef FEATURE_REMOTING
DEFINE_METASIG_T(SM(ContextBoundObject_RetObj, C(CONTEXT_BOUND_OBJECT), j))
+#endif
+
DEFINE_METASIG_T(SM(PMS_PMS_RetInt, C(PERMISSION_SET) C(PERMISSION_SET), i))
DEFINE_METASIG(SM(IntPtr_RetVoid, I, v))
diff --git a/src/vm/mscorlib.h b/src/vm/mscorlib.h
index 291c6abd47..d728825e1a 100644
--- a/src/vm/mscorlib.h
+++ b/src/vm/mscorlib.h
@@ -462,8 +462,9 @@ DEFINE_METHOD(CONTEXT, CALLBACK, DoCallBackFromEE,
DEFINE_METHOD(CONTEXT, RESERVE_SLOT, ReserveSlot, IM_RetInt)
#endif
+#ifdef FEATURE_REMOTING
DEFINE_CLASS(CONTEXT_BOUND_OBJECT, System, ContextBoundObject)
-
+#endif
#ifdef FEATURE_CRYPTO
DEFINE_CLASS(CSP_PARAMETERS, Cryptography, CspParameters)
diff --git a/src/vm/rexcep.h b/src/vm/rexcep.h
index fe920bcd2d..1d1d9385f0 100644
--- a/src/vm/rexcep.h
+++ b/src/vm/rexcep.h
@@ -144,7 +144,11 @@ DEFINE_EXCEPTION(g_SystemNS, BadImageFormatException, true,
DEFINE_EXCEPTION(g_SystemNS, CannotUnloadAppDomainException, false, COR_E_CANNOTUNLOADAPPDOMAIN)
DEFINE_EXCEPTION(g_CodeContractsNS, ContractException, false, COR_E_CODECONTRACTFAILED)
+
+#ifdef FEATURE_REMOTING
DEFINE_EXCEPTION(g_SystemNS, ContextMarshalException, false, COR_E_CONTEXTMARSHAL)
+#endif
+
DEFINE_EXCEPTION(g_ReflectionNS, CustomAttributeFormatException, false, COR_E_CUSTOMATTRIBUTEFORMAT)
#if defined(FEATURE_X509) || defined(FEATURE_CRYPTO)
diff --git a/src/vm/threads.cpp b/src/vm/threads.cpp
index 7e5b9f8d27..bcc4fe3a47 100644
--- a/src/vm/threads.cpp
+++ b/src/vm/threads.cpp
@@ -9161,89 +9161,7 @@ void Thread::ReturnToContextAndOOM(ContextTransitionFrame* pFrame)
COMPlusThrowOM();
}
-
-#ifdef FEATURE_CORECLR
-
-//---------------------------------------------------------------------------------------
-// Allocates an agile CrossAppDomainMarshaledException whose ToString() and ErrorCode
-// matches the original exception.
-//
-// This is our "remoting" story for exceptions that leak across appdomains in Telesto.
-//---------------------------------------------------------------------------------------
-static OBJECTREF WrapThrowableInCrossAppDomainMarshaledException(OBJECTREF pOriginalThrowable)
-{
- CONTRACTL
- {
- GC_TRIGGERS;
- THROWS;
- MODE_COOPERATIVE;
- }
- CONTRACTL_END;
-
- _ASSERTE(GetThread() != NULL);
-
-
- struct _gc
- {
- OBJECTREF pOriginalThrowable;
- OBJECTREF pThrowable;
- STRINGREF pOriginalMessage;
- }
- prot;
-
-
- memset(&prot, 0, sizeof(prot));
-
- GCPROTECT_BEGIN(prot);
- prot.pOriginalThrowable = pOriginalThrowable;
- prot.pOriginalMessage = GetExceptionMessage(prot.pOriginalThrowable);
- HRESULT originalHResult = GetExceptionHResult(prot.pOriginalThrowable);
-
- MethodTable *pMT = MscorlibBinder::GetClass(CLASS__CROSSAPPDOMAINMARSHALEDEXCEPTION);
- prot.pThrowable = AllocateObject(pMT);
-
- MethodDescCallSite exceptionCtor(METHOD__CROSSAPPDOMAINMARSHALEDEXCEPTION__STR_INT_CTOR);
-
- ARG_SLOT args1[] = {
- ObjToArgSlot(prot.pThrowable),
- ObjToArgSlot(prot.pOriginalMessage),
- (ARG_SLOT)originalHResult,
- };
- exceptionCtor.Call(args1);
-
-#ifndef FEATURE_PAL
- // Since, on CoreCLR, we dont have serialization of exceptions going across
- // AD transition boundaries, we will copy over the bucket details to the
- // CrossAppDomainMarshalledException object from the original exception object
- // if it isnt a preallocated exception.
- if (IsWatsonEnabled() && (!CLRException::IsPreallocatedExceptionObject(prot.pOriginalThrowable)))
- {
- // If the watson buckets are present, then copy them over.
- // They maybe missing if the original throwable couldnt get them from Watson helper functions
- // during SetupInitialThrowBucketDetails due to OOM.
- if (((EXCEPTIONREF)prot.pOriginalThrowable)->AreWatsonBucketsPresent())
- {
- _ASSERTE(prot.pThrowable != NULL);
- // Copy them to CrossADMarshalledException object
- CopyWatsonBucketsBetweenThrowables(prot.pOriginalThrowable, prot.pThrowable);
-
- // The exception object should now have the buckets inside it
- _ASSERTE(((EXCEPTIONREF)prot.pThrowable)->AreWatsonBucketsPresent());
- }
- }
-#endif // !FEATURE_PAL
-
- GCPROTECT_END(); //Prot
-
-
- return prot.pThrowable;
-}
-
-
-
-#endif
-
-
+#ifdef FEATURE_REMOTING
// for cases when marshaling is not needed
// throws it is able to take a shortcut, otherwise just returns
void Thread::RaiseCrossContextExceptionHelper(Exception* pEx, ContextTransitionFrame* pFrame)
@@ -9413,15 +9331,7 @@ Thread::TryRaiseCrossContextException(Exception **ppExOrig,
*ppThrowable = CLRException::GetThrowableFromException(exception);
_ASSERTE(*ppThrowable != NULL);
-#ifdef FEATURE_CORECLR
- (*pOrBlob) = WrapThrowableInCrossAppDomainMarshaledException(*ppThrowable);
-#if CHECK_APP_DOMAIN_LEAKS
- (*pOrBlob)->SetAppDomainAgile();
-#endif //CHECK_APP_DOMAIN_LEAKS
-#else
AppDomainHelper::MarshalObject(ppThrowable, pOrBlob);
-#endif //FEATURE_CORECLR
-
}
}
EX_CATCH
@@ -9600,6 +9510,25 @@ void DECLSPEC_NORETURN Thread::RaiseCrossContextException(Exception* pExOrig, Co
}
}
+#else // FEATURE_REMOTING
+
+void DECLSPEC_NORETURN Thread::RaiseCrossContextException(Exception* pExOrig, ContextTransitionFrame* pFrame)
+{
+ CONTRACTL
+ {
+ THROWS;
+ WRAPPER(GC_TRIGGERS);
+ }
+ CONTRACTL_END;
+
+ // pEx is NULL means that the exception is CLRLastThrownObjectException
+ CLRLastThrownObjectException lastThrown;
+ Exception* pException = pExOrig ? pExOrig : &lastThrown;
+ COMPlusThrow(CLRException::GetThrowableFromException(pException));
+}
+
+#endif
+
struct FindADCallbackType {
AppDomain *pSearchDomain;
AppDomain *pPrevDomain;