-
Notifications
You must be signed in to change notification settings - Fork 5k
Disable ctor calls on classes marked with ComImport
when COM interop feature isn't enabled.
#115009
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
Disable ctor calls on classes marked with ComImport
when COM interop feature isn't enabled.
#115009
Conversation
/cc @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
This PR disables COM interop constructor calls in builds that do not support COM interop by wrapping related code in FEATURE_COMINTEROP conditionals.
- Wraps COM interop-specific logic in a preprocessor conditional
- Removes inline conditional checks inside the COM interop block
Comments suppressed due to low confidence (1)
src/coreclr/vm/ecall.cpp:339
- It would be beneficial to add or update unit tests to verify that COM interop constructor calls are properly disabled in builds without COM interop support.
#ifdef FEATURE_COMINTEROP
Tagging subscribers to this area: @dotnet/interop-contrib |
This is confusing error to give when somebody tries to use built-in COM on non-Windows. Can we throw |
ComImport
when COM interop feature isn't enabled.
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.
Is it worth it to add a regression test for PrepareMethod?
Yeah, I thought about it. I'm not sure how useful it is in practice, but I added one none the less. |
...em.Runtime/tests/System.Runtime.Tests/System/Runtime/CompilerServices/RuntimeHelpersTests.cs
Outdated
Show resolved
Hide resolved
…/Runtime/CompilerServices/RuntimeHelpersTests.cs Co-authored-by: Jan Kotas <[email protected]>
/ba-g WASM reliability |
Fixes #114933