Skip to content

Remove managed interfaces impls defined in CoreCLR - #105965

Merged
AaronRobinsonMSFT merged 13 commits into
dotnet:mainfrom
AaronRobinsonMSFT:remove_managed_interfaces_in_runtime
Aug 17, 2024
Merged

Remove managed interfaces impls defined in CoreCLR#105965
AaronRobinsonMSFT merged 13 commits into
dotnet:mainfrom
AaronRobinsonMSFT:remove_managed_interfaces_in_runtime

Conversation

@AaronRobinsonMSFT

@AaronRobinsonMSFTAaronRobinsonMSFT commented Aug 5, 2024

Copy link
Copy Markdown
Member

The IReflect implementation can be removed since we missed a supporting type after we brought this back in dotnet/coreclr#21343. The supporting type is System.Runtime.InteropServices.ComTypes.IReflect, which is needed for it to work at all. Thus, this scenario has never worked in .NET Core.

Implement IDynamicInterfaceCastable on __ComObject to avoid managed interface definitions in unmanaged code - IEnumerable and IEnumerator. In an effort to ensure existing users are supported, ICustomAdapter is available when either of the previous two are supported. This allows us to remove the FCall forwarders that simulated a type of DIM for RCWs that implemented a conforming IDispatch or IEnumVARIANT.

Verified that EnumerableToDispatchMarshaler is not emitted by TlbImp.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

@AaronRobinsonMSFTAaronRobinsonMSFT added this to the 10.0.0 milestone Aug 14, 2024
@AaronRobinsonMSFT

Copy link
Copy Markdown
MemberAuthor

/cc @dotnet/interop-contrib

@jkotasjkotas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Comment threadsrc/coreclr/vm/mngstdinterfaces.h
Comment threadsrc/coreclr/vm/namespace.h Outdated
Comment threadsrc/coreclr/vm/mngstditflist.h
Comment threadsrc/coreclr/System.Private.CoreLib/src/System/__ComObject.cs
Comment threadsrc/coreclr/System.Private.CoreLib/src/System/__ComObject.cs
Comment threadsrc/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs Outdated

@elinor-fungelinor-fung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay!

@AaronRobinsonMSFT
AaronRobinsonMSFT merged commit 0d8e565 into dotnet:mainAug 17, 2024
@AaronRobinsonMSFT
AaronRobinsonMSFT deleted the remove_managed_interfaces_in_runtime branch August 17, 2024 00:12
AaronRobinsonMSFT added a commit to AaronRobinsonMSFT/runtime that referenced this pull request Aug 20, 2024
It appears that after dotnet#105965, the
compiler is no longer inlining `TypeHandle::IsArray` for
this code path. This deconstructs that use and reclaims it.
AaronRobinsonMSFT added a commit that referenced this pull request Aug 21, 2024
…06730)
It appears that after #105965, the
compiler is no longer inlining `TypeHandle::IsArray` for
this code path. This deconstructs that use and reclaims it.
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Sep 16, 2024
@AaronRobinsonMSFTAaronRobinsonMSFT added breaking-change Issue or PR that represents a breaking API or functional change over a previous release. needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet labels Nov 15, 2025
@AaronRobinsonMSFT

Copy link
Copy Markdown
MemberAuthor

Breaking change issue filed at dotnet/docs#49921

@AaronRobinsonMSFTAaronRobinsonMSFT removed the needs-breaking-change-doc-created Breaking changes need an issue opened with https://github.com/dotnet/docs/issues/new?template=dotnet label Nov 15, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Interop-coreclrbreaking-changeIssue or PR that represents a breaking API or functional change over a previous release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@AaronRobinsonMSFT@jkotas@elinor-fung