Revert "Partially revert PR #125326: revert ComActivator/LicenseInter…#126141
Open
AaronRobinsonMSFT wants to merge 4 commits intodotnet:mainfrom
Open
Revert "Partially revert PR #125326: revert ComActivator/LicenseInter…#126141AaronRobinsonMSFT wants to merge 4 commits intodotnet:mainfrom
AaronRobinsonMSFT wants to merge 4 commits intodotnet:mainfrom
Conversation
…eInteropProxy changes (dotnet#125706)" This reverts commit 3e79783. This commit also does the following: - Fix test bug in LicenseTesting.h - Rewrite BSTRHolder to a simpler form - Remove layers in the managed site - Use the BSTR marshaller instead of Marshal class helpers - Remove unused signatures
Contributor
|
Tagging subscribers to this area: @dotnet/interop-contrib |
66 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reverts a prior partial revert affecting COM licensing activation, and refactors the CoreCLR↔managed licensing glue to use the [UnmanagedCallersOnly] calling pattern and BSTR marshalling while also fixing a native test ownership bug.
Changes:
- Fix BSTR ownership in the COM native test server (
LicenseTestingnow copies the incoming license BSTR before freeing). - Switch COM licensing activation in
runtimecallablewrapper.cppfromMethodDescCallSite/manualARG_SLOTplumbing toUnmanagedCallersOnlyCaller, updating the managedLicenseInteropProxyentrypoints accordingly. - Introduce a simplified
BSTRHolderRAII type inholder.hand remove the olderutilcode.htypedef; remove some metasig entries and unused signatures.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tests/Interop/COM/NativeServer/LicenseTesting.h | Fixes BSTR ownership by copying the incoming license string before destructor frees it. |
| src/tests/Interop/COM/NETClients/Licensing/Program.cs | Renames a helper to DesignTime and updates the corresponding logging/call sites. |
| src/coreclr/vm/runtimecallablewrapper.cpp | Reworks licensing activation to call managed helpers via UnmanagedCallersOnlyCaller and uses BSTRHolder. |
| src/coreclr/vm/metasig.h | Removes several COM-related metasig definitions and one duplicate RetObj signature entry. |
| src/coreclr/vm/interoputil.cpp | Updates BSTRHolder initialization style for a temporary BSTR allocation. |
| src/coreclr/vm/corelib.h | Changes LICENSE_INTEROP_PROXY binder method signatures to NoSig for UCO usage. |
| src/coreclr/utilcode/comex.cpp | Updates to default-constructed BSTRHolder usage for IErrorInfo::GetDescription. |
| src/coreclr/inc/utilcode.h | Removes the old util::BSTRHolder typedef and its helper free function. |
| src/coreclr/inc/holder.h | Adds a new BSTRHolder RAII class under FEATURE_COMINTEROP. |
| src/coreclr/System.Private.CoreLib/src/Internal/Runtime/InteropServices/ComActivator.cs | Adds [UnmanagedCallersOnly] entrypoints for LicenseInteropProxy and switches to BStrStringMarshaller for BSTR conversion. |
jkotas
reviewed
Mar 26, 2026
jkotas
reviewed
Mar 26, 2026
…d update method signatures
jkotas
approved these changes
Mar 26, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
src/tests/Interop/COM/NativeServer/LicenseTesting.h:35
- The constructor now allocates a new BSTR before checking
s_DenyLicense, but ifs_DenyLicenseis true the constructor throws and the destructor won’t run, leaking the newly allocated_lic. Consider performing the deny check before allocating, or using a temporary holder/RAII (allocate into a local, then assign to_liconly after the throw path is ruled out).
LicenseTesting(_In_opt_ BSTR lic)
: _lic{ TP_SysAllocString(lic) }
{
if (s_DenyLicense)
throw CLASS_E_NOTLICENSED;
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…opProxy changes (#125706)"
This reverts commit 3e79783.
This commit also does the following:
LicenseTesting.hBSTRHolderto a simpler formBSTRmarshaller instead ofMarshalclass helpersContributes to #123864