Skip to content

Conversation

janvorli
Copy link
Member

@janvorli janvorli commented Jul 15, 2025

After fixing a bug in the related stuff in coreclr, the regression test has revealed that the NativeAOT version has a similar issue. The exception stemming from the custom query interface are not caught and transformed to HRESULT, so they are reported as unhandled exceptions.

This change adds try / catch to catch the exception and translate it to HRESULT.

Close #117654

After fixing a bug in the related stuff in coreclr, the regression test
has revealed that the NativeAOT version has a similar issue. The
exception stemming from the custom query interface are not caught
and transformed to HRESULT, so they are reported as unhandled
exceptions.

This change adds try / catch to catch the exception and translate it to
HRESULT.
@janvorli janvorli added this to the 10.0.0 milestone Jul 15, 2025
@janvorli janvorli self-assigned this Jul 15, 2025
@Copilot Copilot AI review requested due to automatic review settings July 15, 2025 23:29
Copy link
Contributor

@Copilot Copilot AI left a 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 fixes exception handling in NativeAOT COM custom query interface implementation to match a similar fix applied to CoreCLR. The issue was that exceptions from custom query interface calls were not being caught and converted to HRESULTs, causing them to be reported as unhandled exceptions instead of proper COM error codes.

  • Adds try-catch block around custom query interface calls
  • Converts caught exceptions to HRESULT return values
  • Ensures consistent COM exception handling between CoreCLR and NativeAOT

@janvorli
Copy link
Member Author

/azp run runtime-nativeaot-outerloop

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@jkoritzinsky jkoritzinsky left a comment

Choose a reason for hiding this comment

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

One comment otherwise LGTM

@janvorli
Copy link
Member Author

/azp run runtime-nativeaot-outerloop

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@janvorli janvorli changed the title Fix NativeAOT COM custom query interface exceptioon handling Fix NativeAOT COM custom query interface exception handling Jul 16, 2025
@janvorli
Copy link
Member Author

/ba-g the android test timing out is a known issue.

@janvorli janvorli merged commit a436284 into dotnet:main Jul 16, 2025
153 of 169 checks passed
@janvorli janvorli deleted the fix-com-custom-query-interface-exception-handling-nativeaot branch July 16, 2025 19:32
@github-actions github-actions bot locked and limited conversation to collaborators Aug 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[NativeAOT] Regressions\coreclr\GitHub_117393\test117393 test failing in outerloop

4 participants