Skip to content

Add test coverage for UnmanagedCallersOnly with CallConvFastcall (Windows-only) - #130632

Merged
AaronRobinsonMSFT merged 9 commits into
mainfrom
copilot/add-test-coverage-unmanagedcallersonly
Jul 15, 2026
Merged

Add test coverage for UnmanagedCallersOnly with CallConvFastcall (Windows-only)#130632
AaronRobinsonMSFT merged 9 commits into
mainfrom
copilot/add-test-coverage-unmanagedcallersonly

Conversation

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

This pull request updates the unmanaged calling convention interop tests to support and validate calling managed methods with multiple parameters using Stdcall, Cdecl, and, on Windows, Fastcall. The changes expand the callback signatures to accept three integer parameters, update the corresponding native and managed method declarations, and add new tests for the Fastcall convention.

All new tests are gated with [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsWindows))].

…dows-only)

Adds the following tests:
- UnmanagedCallersOnlyTest.cs: TestUnmanagedCallersOnlyViaUnmanagedCalli_Fastcall - tests
  a managed callback with [UnmanagedCallersOnly(CallConvs = [typeof(CallConvFastcall)])]
  called via a delegate* unmanaged[Fastcall] pointer (Windows-only)
- UnmanagedCallersOnlyDll.cpp: CallManagedProc_Fastcall native function (guarded by #ifdef _WIN32)
- UnmanagedCallersOnlyBasicTest.cs: TestUnmanagedCallersOnlyValid_CallConvFastcall - tests
  a managed callback invoked from native code using the fastcall calling convention (Windows-only)

Closes #110760

Co-authored-by: AaronRobinsonMSFT <30635565+AaronRobinsonMSFT@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot July 13, 2026 16:36
Copilot AI changed the title [WIP] Add missing test coverage for UnmanagedCallersOnly with CallconvFastcall Add test coverage for UnmanagedCallersOnly with CallConvFastcall (Windows-only) Jul 13, 2026
Copilot AI requested a review from AaronRobinsonMSFT July 13, 2026 16:37
Comment thread src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs Outdated
Co-authored-by: Aaron R Robinson <arobins@microsoft.com>
Copilot AI review requested due to automatic review settings July 13, 2026 16:43
@AaronRobinsonMSFT
AaronRobinsonMSFT marked this pull request as ready for review July 13, 2026 16:43
@AaronRobinsonMSFT AaronRobinsonMSFT added this to the 11.0.0 milestone Jul 13, 2026
@AaronRobinsonMSFT

AaronRobinsonMSFT commented Jul 13, 2026

Copy link
Copy Markdown
Member

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment thread src/tests/Interop/UnmanagedCallersOnlyBasic/UnmanagedCallersOnlyBasicTest.cs Outdated
Copilot AI review requested due to automatic review settings July 14, 2026 19:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment thread src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyDll.cpp Outdated
Comment thread src/tests/Interop/UnmanagedCallersOnlyBasic/UnmanagedCallersOnlyBasicTest.cs Outdated
Copilot AI review requested due to automatic review settings July 14, 2026 20:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 0 new

@AaronRobinsonMSFT
AaronRobinsonMSFT enabled auto-merge (squash) July 14, 2026 23:00
@AaronRobinsonMSFT

Copy link
Copy Markdown
Member

/ba-g Unrelated failures.

@AaronRobinsonMSFT
AaronRobinsonMSFT merged commit 4428ba1 into main Jul 15, 2026
84 of 90 checks passed
@AaronRobinsonMSFT
AaronRobinsonMSFT deleted the copilot/add-test-coverage-unmanagedcallersonly branch July 15, 2026 20:09
@github-project-automation github-project-automation Bot moved this to Done in AppModel Jul 15, 2026
@dotnet-milestone-bot dotnet-milestone-bot Bot modified the milestones: 11.0.0, 11.0-preview7 Jul 16, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

Missing test coverage for UnmanagedCallersOnly with CallconvFastcall

6 participants