-
Notifications
You must be signed in to change notification settings - Fork 5.3k
__ComObject doesn't support dynamic interface map (redux)
#123725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
__ComObject doesn't support dynamic interface map (redux)
#123725
Conversation
This was originally fixed naively which resulted in an incomplete fix. The activation path issues remained and this current fix addresses the underlying issue - adding IDIC to __ComObject.
|
Tagging subscribers to this area: @dotnet/interop-contrib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Revisits the fix for COM interop casting involving System.__ComObject and the dynamic interface map, adding broader validation and updating test infrastructure to cover the previously missed scenario.
Changes:
- Updates COM test contracts and native/managed test clients to use a revised interface shape for validating COM interface casting behavior.
- Extends COM interop tests to validate the expected interfaces are present on activated COM classes.
- Refines
MethodTable::HasDynamicInterfaceMap()logic and adds explanatory comments about the dynamic interface map’s intent and usage.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tests/Interop/COM/ServerContracts/Server.Contracts.h | Removes IInterface2 and updates Marshal_Interface to return IInterface1. |
| src/tests/Interop/COM/ServerContracts/Server.Contracts.cs | Adjusts managed contract interfaces to align with updated COM interop validation scenarios. |
| src/tests/Interop/COM/NativeServer/MiscTypesTesting.h | Updates native COM server to implement/return IInterface1 for interface marshalling tests. |
| src/tests/Interop/COM/NativeClients/MiscTypes/MiscTypes.cpp | Updates native COM client test to use IInterface1 in interface marshalling validation. |
| src/tests/Interop/COM/NETClients/MiscTypes/Program.cs | Adds/updates managed COM client validation for interface identity/casting behavior. |
| src/coreclr/vm/methodtable.h | Updates HasDynamicInterfaceMap() logic and documents the rationale/usage in COM interop. |
In #112375 a fix was checked in with insufficient validation. An issue was reported offline that uncovered a deficiency in that fix and the validation. This PR revisits that issue, adds the needed comprehensive testing, and adds comments on the utility of the dynamic interface map.
Re fixes #112371