Update dependencies and align net472 IComIID polyfill with CsWin32 #1705#21
Merged
Conversation
Bump central package versions:
- KlutzyNinja.Touki 0.2.0-alpha.1 -> 0.3.0-alpha.1
- Microsoft.Windows.CsWin32 0.3.242 -> 0.3.275
- BenchmarkDotNet 0.15.2 -> 0.15.8
- Microsoft.SourceLink.GitHub 8.0.0 -> 10.0.300
- MinVer 6.0.0 -> 7.0.0
- Microsoft.Bcl.Memory 10.0.7 -> 10.0.8
Align the hand-authored net472 IComIID polyfill with the uniform
"ref readonly Guid Guid { get; }" signature proposed in CsWin32 PR #1705 so
the downlevel instance form matches the modern static-abstract form. Update
the per-struct attachments (IUnknown, IRecordInfo) to the
"ref Unsafe.AsRef(in IID_Guid)" body and adjust IID.Get<T>() callers for the
Guid* return.
There was a problem hiding this comment.
Pull request overview
Updates NuGet package versions and adjusts the net472 IComIID polyfill + IID helpers to match the upcoming CsWin32 shape described in microsoft/CsWin32#1705, reducing GUID copy churn by passing IID pointers directly to COM calls.
Changes:
- Bumped several dependencies in
Directory.Packages.props(Touki, CsWin32, BenchmarkDotNet, SourceLink, MinVer, Bcl.Memory). - Updated the net472
IComIID.Guidsignature toref readonly Guidand aligned per-struct implementations (IUnknown,IRecordInfo) accordingly. - Switched COM call sites to use
IID.Get<T>()returningGuid*(and addedIID.GetRef<T>(), renamedEmpty()→NULL()).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| madowaku/Windows/Win32/System/Com/GlobalInterfaceTable.cs | Stops copying IIDs into locals; passes Guid* directly to GIT APIs. |
| madowaku/Windows/Win32/System/Com/ComScope{T}.cs | Uses IID.Get<TInterface>() pointer directly for QueryInterface. |
| madowaku/Windows/Win32/System/Com/ComClassFactory.cs | Uses IID.Get<TInterface>() pointer directly for CreateInstance. |
| madowaku/Windows/Win32/Foundation/IID.cs | Refactors IID helpers to provide Guid* and ref readonly Guid accessors; renames Empty to NULL. |
| madowaku/Framework/Windows/Win32/System/Ole/IRecordInfo.cs | Updates net472 partial to implement new ref readonly IComIID.Guid. |
| madowaku/Framework/Windows/Win32/System/Com/IUnknown.cs | Updates net472 partial to implement new ref readonly IComIID.Guid. |
| madowaku/Framework/Windows/Win32/IComIID.cs | Changes net472 polyfill interface to ref readonly Guid Guid { get; }. |
| Directory.Packages.props | Central package version bumps to the specified versions. |
| .agents/skills/cswin32-com/SKILL.md | Updates repository guidance snippet to reflect the new IComIID.Guid shape. |
- IID.GetRef<T>() returns `ref T.Guid` directly on modern .NET instead of round-tripping through Unsafe.AsRef(in ...); T.Guid is already `ref readonly Guid`, so the Unsafe call only stripped and re-narrowed readonly. (Copilot review comment.) - Codecov upload set to fail_ci_if_error: false so the intermittent uploader sha256/GPG CDN race cannot gate unrelated PRs, matching touki.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #21 +/- ##
==========================================
- Coverage 86.59% 86.35% -0.24%
==========================================
Files 21 21
Lines 955 953 -2
Branches 148 148
==========================================
- Hits 827 823 -4
- Misses 101 103 +2
Partials 27 27
🚀 New features to boost your workflow:
|
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.
Summary
Two related changes.
Dependency updates (
Directory.Packages.props)KlutzyNinja.ToukiMicrosoft.Windows.CsWin32BenchmarkDotNetMicrosoft.SourceLink.GitHubMinVerMicrosoft.Bcl.MemoryAlign net472
IComIIDpolyfill with CsWin32 #1705CsWin32 PR #1705 emits
IComIIDon downlevel TFMs (net472 / netstandard2.0) using a uniformref readonly Guid Guid { get; }signature so the instance form matches the modern static-abstract form byte-for-byte. The current CsWin32 release (0.3.275) still does not emit it downlevel, so our hand-authored polyfill is still required; this aligns its shape with the upcoming fix.IComIID.Guidchanged fromGuid Guid { get; }toref readonly Guid Guid { get; }.IUnknown,IRecordInfo) now implementreadonly ref readonly Guid IComIID.Guid { [MethodImpl(AggressiveInlining)] get => ref Unsafe.AsRef(in IID_Guid); }.IID.Get<T>()now returnsGuid*; callers (ComScope<T>,ComClassFactory,GlobalInterfaceTable) pass it directly to native calls instead of copying to a localGuid. AddedIID.GetRef<T>()and renamedEmpty()→NULL().cswin32-comskill snippet to the new shape.Validation
dotnet build madowaku.slnx -c Release— clean across net10.0, net10.0-windows, net472, net481 (0 warnings).dotnet test madowaku.slnx -c Release— 492 passed, 0 failed.