Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced a NullReferedeException that was lost in the interop layer w… #12528

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

Tanya-Solyanik
Copy link
Member

@Tanya-Solyanik Tanya-Solyanik commented Nov 21, 2024

Replaced a NullReferenceException (that was lost in the interop layer) with an HRESULT error code recommended in the docs - https://learn.microsoft.com/windows/win32/api/objidl/nf-objidl-idataobject-getdatahere#return-value. The HRESULT is not bubbled up through OleFlushClipboard either, this API returns S_OK even when the data wasn't set. In this case we end up with format being set successfully, but data is actually missing.
Modified a unit test to reflect the state of the Clipboard and to clear it afterwards.

Microsoft Reviewers: Open in CodeFlow

…ith an HRESULT error code recommended in the docs - https://learn.microsoft.com/en-us/windows/win32/api/objidl/nf-objidl-idataobject-getdatahere#return-value. The HRESULT is not bubbled up through OleFlushClipboard either, this API returns S_OK even when the data wasn't set. In this case we end up with format being set successfully, but data actually missing.
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.04449%. Comparing base (711dd37) to head (a5b9e87).
Report is 4 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                  @@
##                main      #12528          +/-   ##
====================================================
+ Coverage   75.73861%   97.04449%   +21.30588%     
====================================================
  Files           3157        1166        -1991     
  Lines         636097      352224      -283873     
  Branches       47002        5319       -41683     
====================================================
- Hits          481771      341814      -139957     
+ Misses        150866        9662      -141204     
+ Partials        3460         748        -2712     
Flag Coverage Δ
Debug 97.04449% <100.00000%> (+21.30588%) ⬆️
integration ?
production ?
test 97.04449% <100.00000%> (-0.00223%) ⬇️
unit ?

Flags with carried forward coverage won't be shown. Click here to find out more.

---- 🚨 Try these New Features:

Copy link
Member

@lonitra lonitra left a comment

Choose a reason for hiding this comment

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

LGTM

@Tanya-Solyanik Tanya-Solyanik merged commit 441fb2a into dotnet:main Nov 22, 2024
8 checks passed
@Tanya-Solyanik Tanya-Solyanik deleted the to-main branch November 22, 2024 00:19
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0 Preview1 milestone Nov 22, 2024
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