Remove Marshal Exception/HRESULT proxies from SecurityHelper, simplify code
Description
Continues the work on removing CAS remnants, this time again method proxies and "helpers" from SecurityHelper.
In this PR we remove GetHRForException from StreamAsIStream along with obsolete warning suppresions and also GetExceptionForHR plus ThrowExceptionForHR proxies.
-
_lastExceptionwas just storing the latest exception in a private field that was never read. - Technically we could just return
COR_E_OBJECTDISPOSEDin some cases instead of setting up a frame, conditionally throwingObjectDisposedException, catching it just to retrieve theHResultand then returning it but I think it is out of scope for this PR.
Customer Impact
Decreased size of assemblies, cleaner codebase for developers.
Regression
No.
Testing
Local build.
Risk
Low.
Microsoft Reviewers: Open in CodeFlow
@h3xds1nz this PR is good to be merged. Can you please resolve the merge conflicts?
@himgoyalmicro Done :)
Codecov Report
Attention: Patch coverage is 11.53846% with 23 lines in your changes missing coverage. Please review.
Project coverage is 12.83462%. Comparing base (
72af9a5) to head (0c13826). Report is 18 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #9977 +/- ##
===================================================
+ Coverage 11.25778% 12.83462% +1.57683%
===================================================
Files 3315 3316 +1
Lines 665229 665427 +198
Branches 74668 74667 -1
===================================================
+ Hits 74890 85405 +10515
+ Misses 589035 577806 -11229
- Partials 1304 2216 +912
| Flag | Coverage Δ | |
|---|---|---|
| Debug | 12.83462% <11.53846%> (+1.57683%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.