Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Add CA2111 SuppressMessage for these MSDN documented public Pointers #4970

Merged
merged 2 commits into from
Feb 28, 2018

Conversation

luqunl
Copy link
Contributor

@luqunl luqunl commented Nov 20, 2017

No description provided.

@@ -9,7 +9,8 @@ namespace System.Runtime.InteropServices.ComTypes
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TYPEDESC
{
public IntPtr lpValue;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")]
Copy link
Member

Choose a reason for hiding this comment

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

Nit: these edits are all using tabs instead of spaces. CoreFX guidelines (and the rest of the file) use spaces.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Fixed these.

[FieldOffset(0)]
public IntPtr lpfuncdesc;
public IntPtr lpfuncdesc; // PUBLICLY DOCUMENTED lpfuncdesc field
Copy link
Member

Choose a reason for hiding this comment

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

It is not obvious that this comment applies to the SuppressMessage attribute.

It is better to include this as Justification = in the SuppressMessage attribute.

Copy link
Member

Choose a reason for hiding this comment

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

Also, I do not think you need to use ALL CAPS for the justification. People frequently use just:

Justification = "Backwards compatibility"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed. These words were copied from others places..anyway, update them according to review comment

@@ -9,11 +9,16 @@ namespace System.Runtime.InteropServices.ComTypes
[StructLayout(LayoutKind.Explicit, CharSet = CharSet.Unicode)]
public struct BINDPTR
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible")]
Copy link
Member

Choose a reason for hiding this comment

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

nit: use spaces

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Member

@krwq krwq left a comment

Choose a reason for hiding this comment

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

LGTM except for @jkotas and @MichalStrehovsky 's comments

@jkotas
Copy link
Member

jkotas commented Dec 14, 2017

@luqunl Do you plan to finish this?

@jkotas
Copy link
Member

jkotas commented Feb 18, 2018

@luqunl Ping

@@ -9,10 +9,13 @@ namespace System.Runtime.InteropServices.ComTypes
[StructLayout(LayoutKind.Explicit, CharSet = CharSet.Unicode)]
public struct BINDPTR
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2111:PointersShouldNotBeVisible", "Backwards compatibility")]
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Add using System.Diagnostics.CodeAnalysis; to make the lines shorter?

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

LGTM modulo nit.

@jkotas
Copy link
Member

jkotas commented Feb 22, 2018

... and build breaks.

@luqunl luqunl merged commit 2a84384 into dotnet:master Feb 28, 2018
@luqunl luqunl deleted the CA2111 branch February 28, 2018 22:39
@MichalStrehovsky
Copy link
Member

@luqunl Could you please "Squash and merge" next time? We don't really want "Merge branch master" type of commits in the master branch history.

@luqunl
Copy link
Contributor Author

luqunl commented Feb 28, 2018

@MichalStrehovsky , do you mean that during code review, don't merge and after code review complete, squash and merge?

@MichalStrehovsky
Copy link
Member

The Merge button in the GitHub web UI has a small arrow next to it that lets you pick between Create merge commit, Squash and merge, and rebase and merge. For changes like this, use the squash option.

@luqunl
Copy link
Contributor Author

luqunl commented Feb 28, 2018

Thanks a lot. Good to know this trick.

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

Successfully merging this pull request may close these issues.

5 participants