Skip to content

Commit 278ba42

Browse files
Migrate CLR->COM stubs to transient IL (#131494)
Follow-up to #126330, which migrated CLR->COM stubs to IL stubs. This moves them the rest of the way to *transient IL*, the same technology #126509 (plus the regression fixes in #127400) used for P/Invokes. Before this change, every `[ComImport]` interface method allocated a separate IL stub `DynamicMethodDesc` plus an `ILStubResolver`, and dispatched through it using a secret `MethodDesc` context argument. With transient IL the marshalling IL is generated directly onto the `CLRToCOMCallMethodDesc` and discarded after JIT, so there is no second `MethodDesc`, no secret argument, and no extra frame. ## What changed **Transient IL generation.** `CLRToCOMCall::CreateCLRToCOMCallMethodIL` and `PInvoke::CreateCLRToCOMMarshallingIL` build IL into a resolver owned by the COM method itself, hooked up through `MethodDesc::TryGenerateTransientILImplementation`. `DoPrestub` now routes CLR->COM through the normal `PrepareInitialCode` path; the late-bound `IDispatch` predefined stub is the only remaining special case. `mcComInterop` gains `MayHaveNativeCode` and a native code slot, and is excluded from tiering and ELT profiling. **No secret argument.** Because the IL is per-method rather than shared, everything the stub used to read out of the secret `MethodDesc` is baked in at generation time instead: the HRESULT-swap error path takes the interface type as an `ldtoken`, and `GetCOMIPFromRCW` takes the interface `MethodTable*` and COM slot as constants. That let `PInvokeStubLinker::m_pStubContextMD` and the `StubHelpers.GetComInterfaceFromMethodDesc` FCall go away entirely. **Debugger.** A new `CLRToCOMStubManager`, modelled on the `PInvokeStubManager` added in #123411, handles stepping into early-bound, late-bound, and event calls, replacing the `ILStubManager` paths that no longer see a stub `MethodDesc`. `DebuggerWalkStackProc` skips frameless CLR->COM methods. **Cleanup.** `DynamicMethodDesc::StubCLRToCOMInterop` and `StubCLRToCOMEvent` can no longer be set on anything, so the VM code that produced and consumed them is removed and the enum values are commented out. The unreachable delegate path in `CLRToCOMCallInfo::FromMethodDesc` is removed as well (see below). ## Things worth a careful look - **The retired `ILStubType` values are reserved, not reused.** The cDAC still interprets value `6` when reading older runtimes, so `RuntimeTypeSystem_1.cs` and `docs/design/datacontracts/RuntimeTypeSystem.md` are intentionally untouched. As we're near the end of .NET 11, I wanted to make this change such that it can go in as part of .NET 12. - **Drive-by bug fix.** `corelib.h` declared `VALIDATE_OBJECT` and `VALIDATE_BYREF` with 3-argument binder signatures while the managed methods take 2. Any P/Invoke with a pinned local asserted `"EE expects method to exist"` under `DOTNET_InteropValidatePinnedObjects=1`. This reproduces on `main` and is fixed here because the same file was already being modified. - **Pre-existing dead code removed.** `CLRToCOMCallInfo::FromMethodDesc` had an `IsEEImpl()` branch reading `DelegateEEClass::m_pCLRToCOMCallInfo`. That field's only writer, `COMDelegate::PopulateCLRToCOMCallInfo`, has no callers (it is already dead on `main`), so the branch was unreachable and all four callers pass a `CLRToCOMCallMethodDesc`. The branch, the field, and the populator are all deleted. Nothing in the DAC, cDAC, or data descriptors referenced the `DelegateEEClass` field, and every removed piece was inside `#ifdef FEATURE_COMINTEROP`. ## New test `src/tests/Interop/COM/ComImportUnimplementedMethod` guards a subtlety that this area makes easy to get wrong: every abstract instance method on an interface is a `CLRToCOMCallMethodDesc`, so a plain managed class that claims to implement a `[ComImport]` interface must not silently pick the interface method up as an implementation. Only RCWs should dispatch through those. The test asserts the same `TypeLoadException` as a non-COM control case. The runtime already behaved correctly here, so this is purely a regression guard. ## Validation - x64 and x86 checked builds, including the DAC: 0 warnings, 0 errors. - `src/tests/Interop` 73/73, including `NETClientEvents`, `NETClientDispatch`, `NETClientPrimitives` (its `ErrorTests` covers the HRESULT-swap path across 10 HRESULTs plus the IID-sensitive `HelpLink` case), and `NETClientPrimitivesInALC` for the collectible-ALC lifetime scenario. - `src/tests/Interop` under `DOTNET_InteropValidatePinnedObjects=1`: all passing, verified when the binder signature fix landed. - `profiler/transitions` 1/1. - `src/tests/Loader` 64/65; `PlatformNativeR2R` fails for an unrelated local environment reason. There is no COM profiler-transition test in the repo, so that one branch is compile-verified only. > [!NOTE] > This pull request description was drafted with GitHub Copilot. --------- Co-authored-by: Copilot App <[email protected]>
1 parent 92d0a84 commit 278ba42

29 files changed

Lines changed: 631 additions & 315 deletions

‎src/coreclr/System.Private.CoreLib/src/System/StubHelpers.cs‎

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2206,18 +2206,13 @@ internal static Exception GetHRExceptionObject(int hr)
22062206
}
22072207

22082208
#if FEATURE_COMINTEROP
2209-
internal static unsafe Exception GetCOMHRExceptionObject(int hr, IntPtr pCPCMD, IntPtr pUnk)
2209+
internal static Exception GetCOMHRExceptionObject(int hr, RuntimeTypeHandle interfaceTypeHandle, IntPtr pUnk)
22102210
{
2211-
Debug.Assert(pCPCMD != IntPtr.Zero);
2212-
MethodTable* interfaceType = GetComInterfaceFromMethodDesc(pCPCMD);
2213-
RuntimeType declaringType = RuntimeTypeHandle.GetRuntimeType(interfaceType);
2214-
Exception ex = Marshal.GetExceptionForHR(hr, declaringType.GUID, pUnk)!;
2211+
RuntimeType interfaceType = interfaceTypeHandle.GetRuntimeTypeChecked();
2212+
Exception ex = Marshal.GetExceptionForHR(hr, interfaceType.GUID, pUnk)!;
22152213
ex.InternalPreserveStackTrace();
22162214
return ex;
22172215
}
2218-
2219-
[MethodImpl(MethodImplOptions.InternalCall)]
2220-
private static extern unsafe MethodTable* GetComInterfaceFromMethodDesc(IntPtr pCPCMD);
22212216
#endif // FEATURE_COMINTEROP
22222217

22232218
[ThreadStatic]
@@ -2345,14 +2340,14 @@ internal static void SafeHandleRelease(SafeHandle pHandle)
23452340

23462341
#if FEATURE_COMINTEROP
23472342
[MethodImpl(MethodImplOptions.InternalCall)]
2348-
private static extern IntPtr GetCOMIPFromRCW(object objSrc, IntPtr pCPCMD, out IntPtr ppTarget);
2343+
private static extern IntPtr GetCOMIPFromRCW(object objSrc, IntPtr pInterfaceMT, int comSlot, out IntPtr ppTarget);
23492344

23502345
[LibraryImport(RuntimeHelpers.QCall, EntryPoint = "StubHelpers_GetCOMIPFromRCWSlow")]
2351-
private static partial IntPtr GetCOMIPFromRCWSlow(ObjectHandleOnStack objSrc, IntPtr pCPCMD, out IntPtr ppTarget, [MarshalAs(UnmanagedType.Bool)] out bool pfNeedsRelease);
2346+
private static partial IntPtr GetCOMIPFromRCWSlow(ObjectHandleOnStack objSrc, IntPtr pInterfaceMT, int comSlot, out IntPtr ppTarget, [MarshalAs(UnmanagedType.Bool)] out bool pfNeedsRelease);
23522347

2353-
internal static IntPtr GetCOMIPFromRCW(object objSrc, IntPtr pCPCMD, out IntPtr ppTarget, out bool pfNeedsRelease)
2348+
internal static IntPtr GetCOMIPFromRCW(object objSrc, IntPtr pInterfaceMT, int comSlot, out IntPtr ppTarget, out bool pfNeedsRelease)
23542349
{
2355-
IntPtr rcw = GetCOMIPFromRCW(objSrc, pCPCMD, out ppTarget);
2350+
IntPtr rcw = GetCOMIPFromRCW(objSrc, pInterfaceMT, comSlot, out ppTarget);
23562351
if (rcw != IntPtr.Zero)
23572352
{
23582353
pfNeedsRelease = false;
@@ -2361,11 +2356,11 @@ internal static IntPtr GetCOMIPFromRCW(object objSrc, IntPtr pCPCMD, out IntPtr
23612356

23622357
// The slow path may create OLE TLS and then still resolve the interface via the RCW cache.
23632358
// Let the slow path tell us whether it returned an owned pointer that requires cleanup.
2364-
return GetCOMIPFromRCWWorker(objSrc, pCPCMD, out ppTarget, out pfNeedsRelease);
2359+
return GetCOMIPFromRCWWorker(objSrc, pInterfaceMT, comSlot, out ppTarget, out pfNeedsRelease);
23652360

23662361
[MethodImpl(MethodImplOptions.NoInlining)]
2367-
static IntPtr GetCOMIPFromRCWWorker(object objSrc, IntPtr pCPCMD, out IntPtr ppTarget, out bool pfNeedsRelease)
2368-
=> GetCOMIPFromRCWSlow(ObjectHandleOnStack.Create(ref objSrc), pCPCMD, out ppTarget, out pfNeedsRelease);
2362+
static IntPtr GetCOMIPFromRCWWorker(object objSrc, IntPtr pInterfaceMT, int comSlot, out IntPtr ppTarget, out bool pfNeedsRelease)
2363+
=> GetCOMIPFromRCWSlow(ObjectHandleOnStack.Create(ref objSrc), pInterfaceMT, comSlot, out ppTarget, out pfNeedsRelease);
23692364
}
23702365
#endif // FEATURE_COMINTEROP
23712366

‎src/coreclr/debug/ee/frameinfo.cpp‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,11 +1503,12 @@ StackWalkAction DebuggerWalkStackProc(CrawlFrame *pCF, void *data)
15031503
}
15041504
}
15051505
else
1506-
// We ignore PInvoke methods with inlined stubs in our stackwalking.
1507-
// These are similar to IL stubs but use PInvokeMethodDesc instead of DynamicMethodDesc.
1508-
if ((md != NULL) && md->IsPInvoke() && pCF->IsFrameless())
1506+
// We ignore PInvoke and CLR->COM methods with inlined stubs in our stackwalking.
1507+
// These are similar to IL stubs but use PInvokeMethodDesc/CLRToCOMCallMethodDesc
1508+
// instead of DynamicMethodDesc.
1509+
if ((md != NULL) && (md->IsPInvoke() || md->IsCLRToCOMCall()) && pCF->IsFrameless())
15091510
{
1510-
LOG((LF_CORDB, LL_INFO100000, "DWSP: Skip frameless PInvoke stub.\n"));
1511+
LOG((LF_CORDB, LL_INFO100000, "DWSP: Skip frameless interop stub.\n"));
15111512
}
15121513
else
15131514
// For frames w/o method data, send them as an internal stub frame.

‎src/coreclr/inc/vptr_list.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ VPTR_CLASS(VirtualCallStubManagerManager)
3333
VPTR_CLASS(RangeSectionStubManager)
3434
VPTR_CLASS(ILStubManager)
3535
VPTR_CLASS(PInvokeStubManager)
36+
#ifdef FEATURE_COMINTEROP
37+
VPTR_CLASS(CLRToCOMStubManager)
38+
#endif // FEATURE_COMINTEROP
3639
VPTR_CLASS(InteropDispatchStubManager)
3740
#if defined(TARGET_X86) && !defined(UNIX_X86_ABI)
3841
VPTR_CLASS(TailCallStubManager)

‎src/coreclr/vm/appdomain.cpp‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,9 @@ void SystemDomain::Attach()
717717
RangeSectionStubManager::Init();
718718
ILStubManager::Init();
719719
PInvokeStubManager::Init();
720+
#ifdef FEATURE_COMINTEROP
721+
CLRToCOMStubManager::Init();
722+
#endif // FEATURE_COMINTEROP
720723
InteropDispatchStubManager::Init();
721724
StubLinkStubManager::Init();
722725
TailCallStubManager::Init();

‎src/coreclr/vm/class.h‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1889,10 +1889,6 @@ class LayoutEEClass : public EEClass
18891889

18901890
class UMThunkMarshInfo;
18911891

1892-
#ifdef FEATURE_COMINTEROP
1893-
struct CLRToCOMCallInfo;
1894-
#endif // FEATURE_COMINTEROP
1895-
18961892
class DelegateEEClass : public EEClass
18971893
{
18981894
public:
@@ -1904,10 +1900,6 @@ class DelegateEEClass : public EEClass
19041900
UMThunkMarshInfo* m_pUMThunkMarshInfo;
19051901
Volatile<PCODE> m_pMarshalStub;
19061902

1907-
#ifdef FEATURE_COMINTEROP
1908-
CLRToCOMCallInfo *m_pCLRToCOMCallInfo;
1909-
#endif // FEATURE_COMINTEROP
1910-
19111903
PTR_MethodDesc GetInvokeMethod()
19121904
{
19131905
return m_pInvokeMethod;

‎src/coreclr/vm/clrtocomcall.cpp‎

Lines changed: 48 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "sigbuilder.h"
2525
#include "callconvbuilder.hpp"
2626
#include "method.hpp"
27+
#include "ilstubresolver.h"
2728

2829
CLRToCOMCallInfo *CLRToCOMCall::PopulateCLRToCOMCallMethodDesc(MethodDesc* pMD, DWORD* pdwStubFlags)
2930
{
@@ -127,7 +128,7 @@ CLRToCOMCallInfo *CLRToCOMCall::PopulateCLRToCOMCallMethodDesc(MethodDesc* pMD,
127128

128129
namespace
129130
{
130-
MethodDesc* CreateEventCallStub(MethodDesc* pMD)
131+
COR_ILMETHOD_DECODER* CreateEventCallIL(MethodDesc* pMD, ILStubResolver* pResolver)
131132
{
132133
STANDARD_VM_CONTRACT;
133134

@@ -140,24 +141,8 @@ namespace
140141
MethodDesc *pEvProvMD = pComInfo->m_pEventProviderMD;
141142
MethodTable *pEvProvMT = pEvProvMD->GetMethodTable();
142143

143-
FunctionSigBuilder sigBuilder;
144-
sigBuilder.SetCallingConv((CorCallingConvention)IMAGE_CEE_CS_CALLCONV_DEFAULT_HASTHIS);
145-
146-
LocalDesc obj(ELEMENT_TYPE_OBJECT);
147-
sigBuilder.NewArg(&obj);
148-
149-
MetaSig sig(pEvProvMD);
150-
LocalDesc retType(sig.GetRetTypeHandleThrowing());
151-
sigBuilder.SetReturnType(&retType);
152-
153-
DWORD cbMetaSigSize = sigBuilder.GetSigSize();
154-
AllocMemHolder<BYTE> szMetaSig(pMD->GetMethodTable()->GetLoaderAllocator()->GetHighFrequencyHeap()->AllocMem(S_SIZE_T(cbMetaSigSize)));
155-
sigBuilder.GetSig(szMetaSig, cbMetaSigSize);
156-
157-
Signature signature(szMetaSig, cbMetaSigSize);
158144
SigTypeContext typeContext;
159-
160-
ILStubLinker stubLinker(pMD->GetModule(), signature, &typeContext, pEvProvMD, ILStubLinkerFlags::ILSTUB_LINKER_FLAG_STUB_HAS_THIS);
145+
ILStubLinker stubLinker(pMD->GetModule(), pMD->GetSignature(), &typeContext, pEvProvMD, ILStubLinkerFlags::ILSTUB_LINKER_FLAG_STUB_HAS_THIS);
161146

162147
ILCodeStream* pCode = stubLinker.NewCodeStream(ILStubLinker::kDispatch);
163148

@@ -169,61 +154,67 @@ namespace
169154
pCode->EmitCALL(pCode->GetToken(pEvProvMD), 2, 1);
170155
pCode->EmitRET();
171156

172-
MethodDesc* pStubMD = ILStubCache::CreateAndLinkNewILStubMethodDesc(
173-
pMD->GetLoaderAllocator(),
174-
pMD->GetMethodTable(),
175-
PINVOKESTUB_FL_COM | PINVOKESTUB_FL_COMEVENTCALL,
176-
pMD->GetModule(),
177-
szMetaSig,
178-
cbMetaSigSize,
179-
&typeContext,
180-
&stubLinker
181-
);
157+
return pResolver->FinalizeILStub(&stubLinker);
158+
}
159+
}
182160

183-
szMetaSig.SuppressRelease();
161+
COR_ILMETHOD_DECODER* CLRToCOMCall::CreateCLRToCOMCallMethodIL(MethodDesc* pMD, DynamicResolver** ppResolver)
162+
{
163+
STANDARD_VM_CONTRACT;
184164

185-
return pStubMD;
186-
}
165+
_ASSERTE(pMD != NULL);
166+
_ASSERTE(pMD->IsCLRToCOMCall());
167+
_ASSERTE(ppResolver != NULL);
187168

188-
MethodDesc* GetILStubMethodDesc(MethodDesc* pMD, DWORD dwStubFlags)
189-
{
190-
STANDARD_VM_CONTRACT;
169+
DWORD dwStubFlags;
170+
CLRToCOMCall::PopulateCLRToCOMCallMethodDesc(pMD, &dwStubFlags);
191171

192-
// COM event stubs are very simple and don't go through any marshalling logic.
193-
// We generate them as a regular IL stub outside of the P/Invoke system.
194-
if (SF_IsCOMEventCallStub(dwStubFlags))
195-
{
196-
_ASSERTE(pMD->IsCLRToCOMCall()); // no generic COM eventing
197-
((CLRToCOMCallMethodDesc *)pMD)->InitComEventCallInfo();
198-
return CreateEventCallStub(pMD);
199-
}
172+
// The generated code always uses COM, so make sure that it is started.
173+
EnsureComStarted();
174+
175+
NewHolder<ILStubResolver> pResolver = new ILStubResolver();
176+
pResolver->SetStubMethodDesc(pMD);
200177

201-
// Get the call signature information
202-
StubSigDesc sigDesc(pMD);
178+
COR_ILMETHOD_DECODER* pIL;
203179

204-
return PInvoke::CreateCLRToNativeILStub(
205-
&sigDesc,
206-
(CorNativeLinkType)0,
207-
(CorNativeLinkFlags)0,
208-
CallConv::GetDefaultUnmanagedCallingConvention(),
209-
dwStubFlags);
180+
// COM event stubs are very simple and don't go through any marshalling logic.
181+
if (SF_IsCOMEventCallStub(dwStubFlags))
182+
{
183+
((CLRToCOMCallMethodDesc *)pMD)->InitComEventCallInfo();
184+
pIL = CreateEventCallIL(pMD, pResolver);
210185
}
186+
else
187+
{
188+
pIL = PInvoke::CreateCLRToCOMMarshallingIL(pMD, dwStubFlags, pResolver);
189+
}
190+
191+
*ppResolver = pResolver.Extract();
192+
return pIL;
211193
}
212194

213-
PCODE CLRToCOMCall::GetStubForILStub(MethodDesc* pMD, MethodDesc** ppStubMD)
195+
MethodDesc* CLRToCOMCall::GetPredefinedILStubMethod(MethodDesc* pMD)
214196
{
215197
STANDARD_VM_CONTRACT;
216198

217199
_ASSERTE(pMD->IsCLRToCOMCall());
218-
_ASSERTE(*ppStubMD == NULL);
219200

220201
DWORD dwStubFlags;
221-
CLRToCOMCallInfo* pComInfo = CLRToCOMCall::PopulateCLRToCOMCallMethodDesc(pMD, &dwStubFlags);
202+
CLRToCOMCall::PopulateCLRToCOMCallMethodDesc(pMD, &dwStubFlags);
203+
204+
// Predefined IL stubs are never used for COM event calls.
205+
if (SF_IsCOMEventCallStub(dwStubFlags))
206+
return NULL;
207+
208+
MethodDesc* pStubMD = NULL;
209+
if (FAILED(FindPredefinedILStubMethod(pMD, dwStubFlags, &pStubMD)))
210+
return NULL;
222211

223-
*ppStubMD = GetILStubMethodDesc(pMD, dwStubFlags);
212+
// We are about to execute the method in pStubMD which could be in another module.
213+
// Call EnsureActive before making the call.
214+
pStubMD->EnsureActive();
224215

225-
PCODE pCode = JitILStub(*ppStubMD);
226-
InterlockedCompareExchangeT<PCODE>(pComInfo->GetAddrOfILStubField(), pCode, NULL);
216+
// The generated code always uses COM, so make sure that it is started.
217+
EnsureComStarted();
227218

228-
return *pComInfo->GetAddrOfILStubField();
219+
return pStubMD;
229220
}

‎src/coreclr/vm/clrtocomcall.h‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,16 @@
1818

1919
#include "util.hpp"
2020

21+
class ILStubResolver;
22+
2123
class CLRToCOMCall
2224
{
2325
public:
24-
static PCODE GetStubForILStub(MethodDesc* pMD, MethodDesc** ppStubMD);
26+
// Generates the transient IL implementation for a CLR->COM call.
27+
static COR_ILMETHOD_DECODER* CreateCLRToCOMCallMethodIL(MethodDesc* pMD, DynamicResolver** ppResolver);
28+
29+
// Returns the user-provided IL stub method for this CLR->COM call, or NULL if there isn't one.
30+
static MethodDesc* GetPredefinedILStubMethod(MethodDesc* pMD);
2531

2632
static CLRToCOMCallInfo *PopulateCLRToCOMCallMethodDesc(MethodDesc* pMD, DWORD* pdwStubFlags);
2733
private:

‎src/coreclr/vm/comdelegate.cpp‎

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -787,39 +787,6 @@ void COMDelegate::Init()
787787
#endif
788788
}
789789

790-
#ifdef FEATURE_COMINTEROP
791-
CLRToCOMCallInfo * COMDelegate::PopulateCLRToCOMCallInfo(MethodTable * pDelMT)
792-
{
793-
CONTRACTL
794-
{
795-
THROWS;
796-
GC_TRIGGERS;
797-
MODE_ANY;
798-
}
799-
CONTRACTL_END;
800-
801-
DelegateEEClass * pClass = (DelegateEEClass *)pDelMT->GetClass();
802-
803-
// set up the CLRToCOMCallInfo if it does not exist already
804-
if (pClass->m_pCLRToCOMCallInfo == NULL)
805-
{
806-
LoaderHeap *pHeap = pDelMT->GetLoaderAllocator()->GetHighFrequencyHeap();
807-
CLRToCOMCallInfo *pTemp = (CLRToCOMCallInfo *)(void *)pHeap->AllocMem(S_SIZE_T(sizeof(CLRToCOMCallInfo)));
808-
809-
pTemp->m_cachedComSlot = ComMethodTable::GetNumExtraSlots(ifVtable);
810-
#ifdef TARGET_X86
811-
pTemp->InitStackArgumentSize();
812-
#endif // TARGET_X86
813-
814-
InterlockedCompareExchangeT(&pClass->m_pCLRToCOMCallInfo, pTemp, NULL);
815-
}
816-
817-
pClass->m_pCLRToCOMCallInfo->m_pInterfaceMT = pDelMT;
818-
819-
return pClass->m_pCLRToCOMCallInfo;
820-
}
821-
#endif // FEATURE_COMINTEROP
822-
823790
static PCODE CreateILDelegateShuffleThunk(MethodDesc* pDelegateMD, bool callTargetWithThis)
824791
{
825792
SigTypeContext typeContext(pDelegateMD);

‎src/coreclr/vm/comdelegate.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ class COMDelegate
5151
// Marshals an unmanaged callback to Delegate
5252
static OBJECTREF ConvertToDelegate(LPVOID pCallback, MethodTable* pMT);
5353

54-
#ifdef FEATURE_COMINTEROP
55-
static CLRToCOMCallInfo * PopulateCLRToCOMCallInfo(MethodTable * pDelMT);
56-
#endif // FEATURE_COMINTEROP
57-
5854
static PCODE GetStubForILStub(EEImplMethodDesc* pDelegateMD, MethodDesc** ppStubMD, DWORD dwStubFlags);
5955
static MethodDesc* GetILStubMethodDesc(EEImplMethodDesc* pDelegateMD, DWORD dwStubFlags);
6056

‎src/coreclr/vm/corelib.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,8 +1065,8 @@ DEFINE_METHOD(BUFFER, MEMCOPYGC, BulkMoveWithWriteBar
10651065

10661066
DEFINE_CLASS(STUBHELPERS, StubHelpers, StubHelpers)
10671067
#ifdef FEATURE_COMINTEROP
1068-
DEFINE_METHOD(STUBHELPERS, GET_COM_HR_EXCEPTION_OBJECT, GetCOMHRExceptionObject, SM_Int_IntPtr_IntPtr_RetException)
1069-
DEFINE_METHOD(STUBHELPERS, GET_COM_IP_FROM_RCW, GetCOMIPFromRCW, SM_Obj_IntPtr_RefIntPtr_RefBool_RetIntPtr)
1068+
DEFINE_METHOD(STUBHELPERS, GET_COM_HR_EXCEPTION_OBJECT, GetCOMHRExceptionObject, SM_Int_RuntimeTypeHandle_IntPtr_RetException)
1069+
DEFINE_METHOD(STUBHELPERS, GET_COM_IP_FROM_RCW, GetCOMIPFromRCW, SM_Obj_IntPtr_Int_RefIntPtr_RefBool_RetIntPtr)
10701070
#endif // FEATURE_COMINTEROP
10711071
DEFINE_METHOD(STUBHELPERS, SET_LAST_ERROR, SetLastError, SM_RetVoid)
10721072
DEFINE_METHOD(STUBHELPERS, CLEAR_LAST_ERROR, ClearLastError, SM_RetVoid)
@@ -1123,8 +1123,8 @@ DEFINE_METHOD(IDISPATCHHELPERS, GET_DISPATCH_INNER_EXCEPTION, GetDispatchInn
11231123
DEFINE_METHOD(STUBHELPERS, MARSHAL_TO_MANAGED_VA_LIST, MarshalToManagedVaList, SM_IntPtr_IntPtr_RetVoid)
11241124
DEFINE_METHOD(STUBHELPERS, MARSHAL_TO_UNMANAGED_VA_LIST, MarshalToUnmanagedVaList, SM_IntPtr_UInt_IntPtr_RetVoid)
11251125
DEFINE_METHOD(STUBHELPERS, CALC_VA_LIST_SIZE, CalcVaListSize, SM_IntPtr_RetUInt)
1126-
DEFINE_METHOD(STUBHELPERS, VALIDATE_OBJECT, ValidateObject, SM_Obj_IntPtr_Obj_RetVoid)
1127-
DEFINE_METHOD(STUBHELPERS, VALIDATE_BYREF, ValidateByref, SM_IntPtr_IntPtr_Obj_RetVoid)
1126+
DEFINE_METHOD(STUBHELPERS, VALIDATE_OBJECT, ValidateObject, SM_Obj_IntPtr_RetVoid)
1127+
DEFINE_METHOD(STUBHELPERS, VALIDATE_BYREF, ValidateByref, SM_IntPtr_IntPtr_RetVoid)
11281128
DEFINE_METHOD(STUBHELPERS, GET_STUB_CONTEXT, GetStubContext, SM_RetIntPtr)
11291129
DEFINE_METHOD(STUBHELPERS, LOG_PINNED_ARGUMENT, LogPinnedArgument, SM_IntPtr_IntPtr_RetVoid)
11301130
DEFINE_METHOD(STUBHELPERS, NEXT_CALL_RETURN_ADDRESS, NextCallReturnAddress, SM_RetIntPtr)

0 commit comments

Comments
 (0)