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

Port FxCop rule RS0015: #N/A #701

Open
ghost opened this issue Dec 2, 2015 · 3 comments
Open

Port FxCop rule RS0015: #N/A #701

ghost opened this issue Dec 2, 2015 · 3 comments
Milestone

Comments

@ghost
Copy link

ghost commented Dec 2, 2015

Title: Always consume the value returned by methods marked with PreserveSigAttribute

Description:

PreserveSigAttribute indicates that a method will return an HRESULT, rather than throwing an exception. Therefore, it is important to consume the HRESULT returned by the method, so that errors can be detected. Generally, this is done by calling Marshal.ThrowExceptionForHR.

Dependency: None

Notes:

@srivatsn
Copy link
Contributor

srivatsn commented Jan 6, 2016

This rule in in the unfactored location. It needs to be moved to the InteropServices.Analyzers location. As part of this, implement some unit tests for this rule (#343)

@mavasani mavasani added this to the 15.3 milestone Apr 15, 2017
@mavasani
Copy link
Contributor

Not sure if this needs to stay in 15.3 or can be moved out. Marking as 15.3 for now - @jinujoseph

@Evangelink
Copy link
Member

@mavasani Is it still worth to implement this rule as such? It feels like there is an important overlap with CA1806 (there is a special case for HRESULT).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants