From 2ec13bb20d1fed7c4f8773935bd96ce3389e27a1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Apr 2026 00:15:47 +0000 Subject: [PATCH 1/2] Remove GetCachedWinRTTypes APIs from DAC/DBI and cDAC surfaces Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/5ee98e13-ee39-4c33-ab12-16acb8d4c1c0 Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com> --- src/coreclr/debug/daccess/dacdbiimpl.cpp | 25 ----------------- src/coreclr/debug/daccess/dacdbiimpl.h | 9 ------ src/coreclr/debug/di/rsappdomain.cpp | 18 ------------ src/coreclr/debug/di/rspriv.h | 11 -------- src/coreclr/debug/inc/dacdbiinterface.h | 10 ------- src/coreclr/inc/cordebug.idl | 16 ----------- src/coreclr/inc/dacdbi.idl | 2 -- src/coreclr/pal/prebuilt/inc/cordebug.h | 28 ------------------- .../Dbi/DacDbiImpl.cs | 6 ---- .../Dbi/IDacDbiInterface.cs | 6 ---- 10 files changed, 131 deletions(-) diff --git a/src/coreclr/debug/daccess/dacdbiimpl.cpp b/src/coreclr/debug/daccess/dacdbiimpl.cpp index 9589ab545c846b..baf957d807e7f8 100644 --- a/src/coreclr/debug/daccess/dacdbiimpl.cpp +++ b/src/coreclr/debug/daccess/dacdbiimpl.cpp @@ -3853,31 +3853,6 @@ HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::GetRcwCachedInterfacePointers(VMP #endif // FEATURE_COMINTEROP } -HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::GetCachedWinRTTypesForIIDs(VMPTR_AppDomain vmAppDomain, DacDbiArrayList * pIids, OUT DacDbiArrayList * pTypes) -{ - if (pIids == NULL || pTypes == NULL) - return E_POINTER; - - HRESULT hr = S_OK; - EX_TRY - { - pTypes->Alloc(0); - } - EX_CATCH_HRESULT(hr); - return hr; -} - -HRESULT STDMETHODCALLTYPE DacDbiInterfaceImpl::GetCachedWinRTTypes(VMPTR_AppDomain vmAppDomain, OUT DacDbiArrayList * piids, OUT DacDbiArrayList * pTypes) -{ - HRESULT hr = S_OK; - EX_TRY - { - pTypes->Alloc(0); - } - EX_CATCH_HRESULT(hr); - return hr; -} - //----------------------------------------------------------------------------- // DacDbiInterfaceImpl::FindField // Finds information for a particular class field diff --git a/src/coreclr/debug/daccess/dacdbiimpl.h b/src/coreclr/debug/daccess/dacdbiimpl.h index 0ab6e206045b49..6b118b6d3d199a 100644 --- a/src/coreclr/debug/daccess/dacdbiimpl.h +++ b/src/coreclr/debug/daccess/dacdbiimpl.h @@ -325,15 +325,6 @@ class DacDbiInterfaceImpl : // in the runtime) HRESULT STDMETHODCALLTYPE GetRcwCachedInterfacePointers(VMPTR_Object vmObject, BOOL bIInspectableOnly, OUT DacDbiArrayList * pDacItfPtrs); - // retrieves a list of interface types corresponding to the passed in - // list of IIDs. the interface types are retrieved from an app domain - // IID / Type cache, that is updated as new types are loaded. will - // have NULL entries corresponding to unknown IIDs in "iids" - HRESULT STDMETHODCALLTYPE GetCachedWinRTTypesForIIDs(VMPTR_AppDomain vmAppDomain, DacDbiArrayList * pIids, OUT DacDbiArrayList * pTypes); - - // retrieves the whole app domain cache of IID / Type mappings. - HRESULT STDMETHODCALLTYPE GetCachedWinRTTypes(VMPTR_AppDomain vmAppDomain, OUT DacDbiArrayList * piids, OUT DacDbiArrayList * pTypes); - private: // Helper to enumerate all possible memory ranges help by a loader allocator. void EnumerateMemRangesForLoaderAllocator( diff --git a/src/coreclr/debug/di/rsappdomain.cpp b/src/coreclr/debug/di/rsappdomain.cpp index 9c0c7dc8c69de5..18969123e63eb2 100644 --- a/src/coreclr/debug/di/rsappdomain.cpp +++ b/src/coreclr/debug/di/rsappdomain.cpp @@ -1017,24 +1017,6 @@ HRESULT CordbAppDomain::GetFunctionPointerType(ULONG32 cTypeArgs, } -// -// ICorDebugAppDomain3 -// - -HRESULT CordbAppDomain::GetCachedWinRTTypesForIIDs( - ULONG32 cGuids, - GUID * iids, - ICorDebugTypeEnum * * ppTypesEnum) -{ - return E_NOTIMPL; -} - -HRESULT CordbAppDomain::GetCachedWinRTTypes( - ICorDebugGuidToTypeEnum * * ppTypesEnum) -{ - return E_NOTIMPL; -} - //----------------------------------------------------------- // ICorDebugAppDomain4 //----------------------------------------------------------- diff --git a/src/coreclr/debug/di/rspriv.h b/src/coreclr/debug/di/rspriv.h index 6bfa81644e6f85..780d79695a9b54 100644 --- a/src/coreclr/debug/di/rspriv.h +++ b/src/coreclr/debug/di/rspriv.h @@ -2448,17 +2448,6 @@ class CordbAppDomain : public CordbBase, ICorDebugType * rgpTypeArgs[], ICorDebugType ** ppResultType); - //----------------------------------------------------------- - // ICorDebugAppDomain3 APIs - //----------------------------------------------------------- - COM_METHOD GetCachedWinRTTypesForIIDs( - ULONG32 cGuids, - GUID * guids, - ICorDebugTypeEnum * * ppTypesEnum); - - COM_METHOD GetCachedWinRTTypes( - ICorDebugGuidToTypeEnum * * ppType); - //----------------------------------------------------------- // ICorDebugAppDomain4 //----------------------------------------------------------- diff --git a/src/coreclr/debug/inc/dacdbiinterface.h b/src/coreclr/debug/inc/dacdbiinterface.h index f9ac174a7ee3e7..3e2cfa6061d336 100644 --- a/src/coreclr/debug/inc/dacdbiinterface.h +++ b/src/coreclr/debug/inc/dacdbiinterface.h @@ -1788,16 +1788,6 @@ IDacDbiInterface : public IUnknown // in the runtime) virtual HRESULT STDMETHODCALLTYPE GetRcwCachedInterfacePointers(VMPTR_Object vmObject, BOOL bIInspectableOnly, OUT DacDbiArrayList * pDacItfPtrs) = 0; - // retrieves a list of interface types corresponding to the passed in - // list of IIDs. the interface types are retrieved from an app domain - // IID / Type cache, that is updated as new types are loaded. will - // have NULL entries corresponding to unknown IIDs in "iids" - virtual HRESULT STDMETHODCALLTYPE GetCachedWinRTTypesForIIDs(VMPTR_AppDomain vmAppDomain, DacDbiArrayList * pIids, OUT DacDbiArrayList * pTypes) = 0; - - // retrieves the whole app domain cache of IID / Type mappings. - virtual HRESULT STDMETHODCALLTYPE GetCachedWinRTTypes(VMPTR_AppDomain vmAppDomain, OUT DacDbiArrayList * piids, OUT DacDbiArrayList * pTypes) = 0; - - // ---------------------------------------------------------------------------- // functions to get information about reference/handle referents for ICDValue // ---------------------------------------------------------------------------- diff --git a/src/coreclr/inc/cordebug.idl b/src/coreclr/inc/cordebug.idl index d1faccd72bb9ba..1d8009f45ccc84 100644 --- a/src/coreclr/inc/cordebug.idl +++ b/src/coreclr/inc/cordebug.idl @@ -2328,22 +2328,6 @@ interface ICorDebugGuidToTypeEnum : ICorDebugEnum ] interface ICorDebugAppDomain3 : IUnknown { - /* - * Returns an enumeration of types corresponding to the IIDs passed in - * guidsToResolve. The enumeration will have the same cReqTypes elements - * with NULL values corresponding to unknown IIDs. - */ - HRESULT GetCachedWinRTTypesForIIDs( - [in] ULONG32 cReqTypes, - [in, size_is(cReqTypes)] GUID * iidsToResolve, - [out] ICorDebugTypeEnum ** ppTypesEnum); - - /* - * Returns an enumeration of IID / Type pairs. This is the exhaustive - * list of pairs as they were cached in the current app domain. - */ - HRESULT GetCachedWinRTTypes( - [out] ICorDebugGuidToTypeEnum ** ppGuidToTypeEnum); }; [ diff --git a/src/coreclr/inc/dacdbi.idl b/src/coreclr/inc/dacdbi.idl index 914a317a5f285c..871864038a1711 100644 --- a/src/coreclr/inc/dacdbi.idl +++ b/src/coreclr/inc/dacdbi.idl @@ -342,8 +342,6 @@ interface IDacDbiInterface : IUnknown HRESULT GetStackFramesFromException([in] VMPTR_Object vmObject, [out] DacDbiArrayList_DacExceptionCallStackData * pDacStackFrames); HRESULT IsRcw([in] VMPTR_Object vmObject, [out] BOOL * pResult); HRESULT GetRcwCachedInterfacePointers([in] VMPTR_Object vmObject, [in] BOOL bIInspectableOnly, [out] DacDbiArrayList_CORDB_ADDRESS * pDacItfPtrs); - HRESULT GetCachedWinRTTypesForIIDs([in] VMPTR_AppDomain vmAppDomain, [in] DacDbiArrayList_GUID * pIids, [out] DacDbiArrayList_ExpandedTypeData * pTypes); - HRESULT GetCachedWinRTTypes([in] VMPTR_AppDomain vmAppDomain, [out] DacDbiArrayList_GUID * piids, [out] DacDbiArrayList_ExpandedTypeData * pTypes); // Object Data HRESULT GetTypedByRefInfo([in] CORDB_ADDRESS pTypedByRef, [out] struct DebuggerIPCE_ObjectData * pObjectData); diff --git a/src/coreclr/pal/prebuilt/inc/cordebug.h b/src/coreclr/pal/prebuilt/inc/cordebug.h index becb1dcc6ad4c5..ebd3ce35ca1193 100644 --- a/src/coreclr/pal/prebuilt/inc/cordebug.h +++ b/src/coreclr/pal/prebuilt/inc/cordebug.h @@ -5894,14 +5894,6 @@ EXTERN_C const IID IID_ICorDebugAppDomain3; ICorDebugAppDomain3 : public IUnknown { public: - virtual HRESULT STDMETHODCALLTYPE GetCachedWinRTTypesForIIDs( - /* [in] */ ULONG32 cReqTypes, - /* [size_is][in] */ GUID *iidsToResolve, - /* [out] */ ICorDebugTypeEnum **ppTypesEnum) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetCachedWinRTTypes( - /* [out] */ ICorDebugGuidToTypeEnum **ppGuidToTypeEnum) = 0; - }; @@ -5926,18 +5918,6 @@ EXTERN_C const IID IID_ICorDebugAppDomain3; ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugAppDomain3 * This); - DECLSPEC_XFGVIRT(ICorDebugAppDomain3, GetCachedWinRTTypesForIIDs) - HRESULT ( STDMETHODCALLTYPE *GetCachedWinRTTypesForIIDs )( - ICorDebugAppDomain3 * This, - /* [in] */ ULONG32 cReqTypes, - /* [size_is][in] */ GUID *iidsToResolve, - /* [out] */ ICorDebugTypeEnum **ppTypesEnum); - - DECLSPEC_XFGVIRT(ICorDebugAppDomain3, GetCachedWinRTTypes) - HRESULT ( STDMETHODCALLTYPE *GetCachedWinRTTypes )( - ICorDebugAppDomain3 * This, - /* [out] */ ICorDebugGuidToTypeEnum **ppGuidToTypeEnum); - END_INTERFACE } ICorDebugAppDomain3Vtbl; @@ -5960,13 +5940,6 @@ EXTERN_C const IID IID_ICorDebugAppDomain3; #define ICorDebugAppDomain3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) - -#define ICorDebugAppDomain3_GetCachedWinRTTypesForIIDs(This,cReqTypes,iidsToResolve,ppTypesEnum) \ - ( (This)->lpVtbl -> GetCachedWinRTTypesForIIDs(This,cReqTypes,iidsToResolve,ppTypesEnum) ) - -#define ICorDebugAppDomain3_GetCachedWinRTTypes(This,ppGuidToTypeEnum) \ - ( (This)->lpVtbl -> GetCachedWinRTTypes(This,ppGuidToTypeEnum) ) - #endif /* COBJMACROS */ @@ -20513,4 +20486,3 @@ EmbeddedCLRCorDebug; #endif - diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs index 2a421ca104f9ac..fb4f3b55ff6dc2 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/DacDbiImpl.cs @@ -762,12 +762,6 @@ public int IsRcw(ulong vmObject, Interop.BOOL* pResult) public int GetRcwCachedInterfacePointers(ulong vmObject, Interop.BOOL bIInspectableOnly, nint pDacItfPtrs) => _legacy is not null ? _legacy.GetRcwCachedInterfacePointers(vmObject, bIInspectableOnly, pDacItfPtrs) : HResults.E_NOTIMPL; - public int GetCachedWinRTTypesForIIDs(ulong vmAppDomain, nint pIids, nint pTypes) - => _legacy is not null ? _legacy.GetCachedWinRTTypesForIIDs(vmAppDomain, pIids, pTypes) : HResults.E_NOTIMPL; - - public int GetCachedWinRTTypes(ulong vmAppDomain, nint piids, nint pTypes) - => _legacy is not null ? _legacy.GetCachedWinRTTypes(vmAppDomain, piids, pTypes) : HResults.E_NOTIMPL; - public int GetTypedByRefInfo(ulong pTypedByRef, nint pObjectData) => _legacy is not null ? _legacy.GetTypedByRefInfo(pTypedByRef, pObjectData) : HResults.E_NOTIMPL; diff --git a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.cs b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.cs index 50a46d033330b3..d26605e3b86f5a 100644 --- a/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.cs +++ b/src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Dbi/IDacDbiInterface.cs @@ -411,12 +411,6 @@ public unsafe partial interface IDacDbiInterface [PreserveSig] int GetRcwCachedInterfacePointers(ulong vmObject, Interop.BOOL bIInspectableOnly, nint pDacItfPtrs); - [PreserveSig] - int GetCachedWinRTTypesForIIDs(ulong vmAppDomain, nint pIids, nint pTypes); - - [PreserveSig] - int GetCachedWinRTTypes(ulong vmAppDomain, nint piids, nint pTypes); - [PreserveSig] int GetTypedByRefInfo(ulong pTypedByRef, nint pObjectData); From 156c95f09bdac41823a0dfe8a1af20798f6f1d4d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Apr 2026 00:25:22 +0000 Subject: [PATCH 2/2] Restore ICorDebug API changes - only remove DacDbi GetCachedWinRTTypes APIs Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/927e4d92-2f2e-4162-b469-9e962ad65f6f Co-authored-by: rcj1 <77995559+rcj1@users.noreply.github.com> --- src/coreclr/debug/di/rsappdomain.cpp | 18 ++++++++++++++++ src/coreclr/debug/di/rspriv.h | 11 ++++++++++ src/coreclr/inc/cordebug.idl | 16 ++++++++++++++ src/coreclr/pal/prebuilt/inc/cordebug.h | 28 +++++++++++++++++++++++++ 4 files changed, 73 insertions(+) diff --git a/src/coreclr/debug/di/rsappdomain.cpp b/src/coreclr/debug/di/rsappdomain.cpp index 18969123e63eb2..9c0c7dc8c69de5 100644 --- a/src/coreclr/debug/di/rsappdomain.cpp +++ b/src/coreclr/debug/di/rsappdomain.cpp @@ -1017,6 +1017,24 @@ HRESULT CordbAppDomain::GetFunctionPointerType(ULONG32 cTypeArgs, } +// +// ICorDebugAppDomain3 +// + +HRESULT CordbAppDomain::GetCachedWinRTTypesForIIDs( + ULONG32 cGuids, + GUID * iids, + ICorDebugTypeEnum * * ppTypesEnum) +{ + return E_NOTIMPL; +} + +HRESULT CordbAppDomain::GetCachedWinRTTypes( + ICorDebugGuidToTypeEnum * * ppTypesEnum) +{ + return E_NOTIMPL; +} + //----------------------------------------------------------- // ICorDebugAppDomain4 //----------------------------------------------------------- diff --git a/src/coreclr/debug/di/rspriv.h b/src/coreclr/debug/di/rspriv.h index 780d79695a9b54..6bfa81644e6f85 100644 --- a/src/coreclr/debug/di/rspriv.h +++ b/src/coreclr/debug/di/rspriv.h @@ -2448,6 +2448,17 @@ class CordbAppDomain : public CordbBase, ICorDebugType * rgpTypeArgs[], ICorDebugType ** ppResultType); + //----------------------------------------------------------- + // ICorDebugAppDomain3 APIs + //----------------------------------------------------------- + COM_METHOD GetCachedWinRTTypesForIIDs( + ULONG32 cGuids, + GUID * guids, + ICorDebugTypeEnum * * ppTypesEnum); + + COM_METHOD GetCachedWinRTTypes( + ICorDebugGuidToTypeEnum * * ppType); + //----------------------------------------------------------- // ICorDebugAppDomain4 //----------------------------------------------------------- diff --git a/src/coreclr/inc/cordebug.idl b/src/coreclr/inc/cordebug.idl index 1d8009f45ccc84..d1faccd72bb9ba 100644 --- a/src/coreclr/inc/cordebug.idl +++ b/src/coreclr/inc/cordebug.idl @@ -2328,6 +2328,22 @@ interface ICorDebugGuidToTypeEnum : ICorDebugEnum ] interface ICorDebugAppDomain3 : IUnknown { + /* + * Returns an enumeration of types corresponding to the IIDs passed in + * guidsToResolve. The enumeration will have the same cReqTypes elements + * with NULL values corresponding to unknown IIDs. + */ + HRESULT GetCachedWinRTTypesForIIDs( + [in] ULONG32 cReqTypes, + [in, size_is(cReqTypes)] GUID * iidsToResolve, + [out] ICorDebugTypeEnum ** ppTypesEnum); + + /* + * Returns an enumeration of IID / Type pairs. This is the exhaustive + * list of pairs as they were cached in the current app domain. + */ + HRESULT GetCachedWinRTTypes( + [out] ICorDebugGuidToTypeEnum ** ppGuidToTypeEnum); }; [ diff --git a/src/coreclr/pal/prebuilt/inc/cordebug.h b/src/coreclr/pal/prebuilt/inc/cordebug.h index ebd3ce35ca1193..becb1dcc6ad4c5 100644 --- a/src/coreclr/pal/prebuilt/inc/cordebug.h +++ b/src/coreclr/pal/prebuilt/inc/cordebug.h @@ -5894,6 +5894,14 @@ EXTERN_C const IID IID_ICorDebugAppDomain3; ICorDebugAppDomain3 : public IUnknown { public: + virtual HRESULT STDMETHODCALLTYPE GetCachedWinRTTypesForIIDs( + /* [in] */ ULONG32 cReqTypes, + /* [size_is][in] */ GUID *iidsToResolve, + /* [out] */ ICorDebugTypeEnum **ppTypesEnum) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetCachedWinRTTypes( + /* [out] */ ICorDebugGuidToTypeEnum **ppGuidToTypeEnum) = 0; + }; @@ -5918,6 +5926,18 @@ EXTERN_C const IID IID_ICorDebugAppDomain3; ULONG ( STDMETHODCALLTYPE *Release )( ICorDebugAppDomain3 * This); + DECLSPEC_XFGVIRT(ICorDebugAppDomain3, GetCachedWinRTTypesForIIDs) + HRESULT ( STDMETHODCALLTYPE *GetCachedWinRTTypesForIIDs )( + ICorDebugAppDomain3 * This, + /* [in] */ ULONG32 cReqTypes, + /* [size_is][in] */ GUID *iidsToResolve, + /* [out] */ ICorDebugTypeEnum **ppTypesEnum); + + DECLSPEC_XFGVIRT(ICorDebugAppDomain3, GetCachedWinRTTypes) + HRESULT ( STDMETHODCALLTYPE *GetCachedWinRTTypes )( + ICorDebugAppDomain3 * This, + /* [out] */ ICorDebugGuidToTypeEnum **ppGuidToTypeEnum); + END_INTERFACE } ICorDebugAppDomain3Vtbl; @@ -5940,6 +5960,13 @@ EXTERN_C const IID IID_ICorDebugAppDomain3; #define ICorDebugAppDomain3_Release(This) \ ( (This)->lpVtbl -> Release(This) ) + +#define ICorDebugAppDomain3_GetCachedWinRTTypesForIIDs(This,cReqTypes,iidsToResolve,ppTypesEnum) \ + ( (This)->lpVtbl -> GetCachedWinRTTypesForIIDs(This,cReqTypes,iidsToResolve,ppTypesEnum) ) + +#define ICorDebugAppDomain3_GetCachedWinRTTypes(This,ppGuidToTypeEnum) \ + ( (This)->lpVtbl -> GetCachedWinRTTypes(This,ppGuidToTypeEnum) ) + #endif /* COBJMACROS */ @@ -20486,3 +20513,4 @@ EmbeddedCLRCorDebug; #endif +