Skip to content

Update dependencies and align net472 IComIID polyfill with CsWin32 #1705#21

Merged
JeremyKuhne merged 2 commits into
mainfrom
deps-and-icomiid-polyfill
Jun 8, 2026
Merged

Update dependencies and align net472 IComIID polyfill with CsWin32 #1705#21
JeremyKuhne merged 2 commits into
mainfrom
deps-and-icomiid-polyfill

Conversation

@JeremyKuhne

Copy link
Copy Markdown
Owner

Summary

Two related changes.

Dependency updates (Directory.Packages.props)

Package From To
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 net472 IComIID polyfill with CsWin32 #1705

CsWin32 PR #1705 emits IComIID on downlevel TFMs (net472 / netstandard2.0) using a uniform ref 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.Guid changed from Guid Guid { get; } to ref readonly Guid Guid { get; }.
  • Per-struct attachments (IUnknown, IRecordInfo) now implement readonly ref readonly Guid IComIID.Guid { [MethodImpl(AggressiveInlining)] get => ref Unsafe.AsRef(in IID_Guid); }.
  • IID.Get<T>() now returns Guid*; callers (ComScope<T>, ComClassFactory, GlobalInterfaceTable) pass it directly to native calls instead of copying to a local Guid. Added IID.GetRef<T>() and renamed Empty()NULL().
  • Updated the cswin32-com skill 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.

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.
Copilot AI review requested due to automatic review settings June 7, 2026 23:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.Guid signature to ref readonly Guid and aligned per-struct implementations (IUnknown, IRecordInfo) accordingly.
  • Switched COM call sites to use IID.Get<T>() returning Guid* (and added IID.GetRef<T>(), renamed Empty()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.

Comment thread madowaku/Windows/Win32/Foundation/IID.cs
- 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

codecov Bot commented Jun 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.35%. Comparing base (9c81700) to head (a74e725).

Files with missing lines Patch % Lines
madowaku/Windows/Win32/Foundation/IID.cs 40.00% 3 Missing ⚠️
.../Framework/Windows/Win32/System/Ole/IRecordInfo.cs 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            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              
Files with missing lines Coverage Δ
...aku/Framework/Windows/Win32/System/Com/IUnknown.cs 100.00% <100.00%> (ø)
...dowaku/Windows/Win32/System/Com/ComClassFactory.cs 84.21% <100.00%> (-0.41%) ⬇️
madowaku/Windows/Win32/System/Com/ComScope{T}.cs 100.00% <100.00%> (ø)
...u/Windows/Win32/System/Com/GlobalInterfaceTable.cs 100.00% <100.00%> (ø)
.../Framework/Windows/Win32/System/Ole/IRecordInfo.cs 0.00% <0.00%> (ø)
madowaku/Windows/Win32/Foundation/IID.cs 20.00% <40.00%> (-5.00%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JeremyKuhne JeremyKuhne merged commit 5e31658 into main Jun 8, 2026
4 checks passed
@JeremyKuhne JeremyKuhne deleted the deps-and-icomiid-polyfill branch June 8, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants