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

Remove Marshal Exception/HRESULT proxies from SecurityHelper, simplify code #9977

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

h3xds1nz
Copy link
Contributor

@h3xds1nz h3xds1nz commented Oct 21, 2024

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.

  • _lastException was just storing the latest exception in a private field that was never read.
  • Technically we could just return COR_E_OBJECTDISPOSED in some cases instead of setting up a frame, conditionally throwing ObjectDisposedException, catching it just to retrieve the HResult and 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 h3xds1nz requested review from a team as code owners October 21, 2024 17:17
@dotnet-policy-service dotnet-policy-service bot added PR metadata: Label to tag PRs, to facilitate with triage Community Contribution A label for all community Contributions labels Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Contribution A label for all community Contributions Included in test pass PR metadata: Label to tag PRs, to facilitate with triage Status:InProgress Status:Proposed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants