ModuleSuppressions.cs 14 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. //
  2. // Module-level FxCop supressions are kept in this file
  3. //
  4. using System.Diagnostics.CodeAnalysis;
  5. //
  6. // TODO, eugenesh: bug 532346
  7. // Fixing two groups of issues below (SpecifyStringComparison and UseOrdinalStringComparison)
  8. // will introduce too much churn at this late stage of Whidbey RTM.
  9. // Therefore, we exclude now and need to fix these violatins in Orcas
  10. //
  11. [module: SuppressMessage("Microsoft.Globalization", "CA1307:SpecifyStringComparison", Scope = "member", Target = "System.Messaging.MessageQueue.ValidatePath(System.String,System.Boolean):System.Boolean", MessageId = "System.String.EndsWith(System.String)")]
  12. [module: SuppressMessage("Microsoft.Globalization", "CA1307:SpecifyStringComparison", Scope = "member", Target = "System.Messaging.MessageQueue.ValidatePath(System.String,System.Boolean):System.Boolean", MessageId = "System.String.StartsWith(System.String)")]
  13. [module: SuppressMessage("Microsoft.Globalization", "CA1307:SpecifyStringComparison", Scope = "member", Target = "System.Messaging.MessageQueue.get_QueuePath():System.String", MessageId = "System.String.StartsWith(System.String)")]
  14. [module: SuppressMessage("Microsoft.Globalization", "CA1307:SpecifyStringComparison", Scope = "member", Target = "System.Messaging.MessageQueue.IsCanonicalPath(System.String,System.Boolean):System.Boolean", MessageId = "System.String.EndsWith(System.String)")]
  15. [module: SuppressMessage("Microsoft.Globalization", "CA1307:SpecifyStringComparison", Scope = "member", Target = "System.Messaging.MessageQueue.IsCanonicalPath(System.String,System.Boolean):System.Boolean", MessageId = "System.String.StartsWith(System.String)")]
  16. [module: SuppressMessage("Microsoft.Globalization", "CA1307:SpecifyStringComparison", Scope = "member", Target = "System.Messaging.MessageQueue.Exists(System.String):System.Boolean", MessageId = "System.String.StartsWith(System.String)")]
  17. [module: SuppressMessage("Microsoft.Globalization", "CA1307:SpecifyStringComparison", Scope = "member", Target = "System.Messaging.MessageQueue.get_FormatName():System.String", MessageId = "System.String.StartsWith(System.String)")]
  18. [module: SuppressMessage("Microsoft.Globalization", "CA1307:SpecifyStringComparison", Scope = "member", Target = "System.Messaging.MessageQueue.ResolveFormatNameFromQueuePath(System.String,System.Boolean):System.String", MessageId = "System.String.EndsWith(System.String)")]
  19. [module: SuppressMessage("Microsoft.Globalization", "CA1307:SpecifyStringComparison", Scope = "member", Target = "System.Messaging.AccessControlList.MakeAcl(System.IntPtr):System.IntPtr", MessageId = "System.String.EndsWith(System.String)")]
  20. [module: SuppressMessage("Microsoft.Globalization", "CA130:UseOrdinalStringComparison", Scope = "member", Target = "System.Messaging.MessageQueue.ReceiveBy(System.String,System.TimeSpan,System.Boolean,System.Boolean,System.Boolean,System.Messaging.MessageQueueTransaction,System.Messaging.MessageQueueTransactionType):System.Messaging.Message", MessageId = "System.String.Compare(System.String,System.String,System.Boolean,System.Globalization.CultureInfo)")]
  21. [module: SuppressMessage("Microsoft.Globalization", "CA130:UseOrdinalStringComparison", Scope = "member", Target = "System.Messaging.MessageQueue.GetPublicQueuesByMachine(System.String):System.Messaging.MessageQueue[]", MessageId = "System.String.Compare(System.String,System.String,System.Boolean,System.Globalization.CultureInfo)")]
  22. [module: SuppressMessage("Microsoft.Globalization", "CA130:UseOrdinalStringComparison", Scope = "member", Target = "System.Messaging.MessageQueue.GetPrivateQueuesByMachine(System.String):System.Messaging.MessageQueue[]", MessageId = "System.String.Compare(System.String,System.String,System.Boolean,System.Globalization.CultureInfo)")]
  23. [module: SuppressMessage("Microsoft.Globalization", "CA130:UseOrdinalStringComparison", Scope = "member", Target = "System.Messaging.MessageQueue.ResolveFormatNameFromQueuePath(System.String,System.Boolean):System.String", MessageId = "System.String.Compare(System.String,System.String,System.Boolean,System.Globalization.CultureInfo)")]
  24. [module: SuppressMessage("Microsoft.Globalization", "CA130:UseOrdinalStringComparison", Scope = "member", Target = "System.Messaging.MessageQueueEnumerator.MoveNext():System.Boolean", MessageId = "System.String.Compare(System.String,System.Int32,System.String,System.Int32,System.Int32,System.Boolean,System.Globalization.CultureInfo)")]
  25. [module: SuppressMessage("Microsoft.Globalization", "CA130:UseOrdinalStringComparison", Scope = "member", Target = "System.Messaging.MessageQueuePermission.FromXml(System.Security.SecurityElement):System.Void", MessageId = "System.String.Compare(System.String,System.String,System.Boolean,System.Globalization.CultureInfo)")]
  26. [module: SuppressMessage("Microsoft.Globalization", "CA130:UseOrdinalStringComparison", Scope = "member", Target = "System.Messaging.Design.MessageQueueConverter..cctor()", MessageId = "System.Collections.Hashtable.#ctor(System.Collections.IEqualityComparer)")]
  27. // performance messages
  28. [module: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "System.Messaging.Design.SizeConverter..ctor()")]
  29. [module: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "System.Messaging.Design.MessageFormatterConverter..ctor()")]
  30. [module: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "System.Messaging.Design.TimeoutConverter..ctor()")]
  31. [module: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "System.Messaging.Design.MessageQueueConverter..ctor()")]
  32. [module: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "System.Messaging.Res.GetObject(System.String):System.Object")]
  33. [module: SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "System.Messaging.Res.get_Resources():System.Resources.ResourceManager")]
  34. [module: SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses", Scope = "type", Target = "System.Messaging.ResCategoryAttribute")]
  35. //naming messages
  36. [module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "System.Messaging.resources", MessageId = "msmq")]
  37. [module: SuppressMessage("Microsoft.Naming", "CA1703:ResourceStringsShouldBeSpelledCorrectly", Scope = "resource", Target = "System.Messaging.resources", MessageId = "propid")]
  38. //reliability messages
  39. // we have a number of public APIs that return handles as IntPtr. Because we use SafeHandles internally,
  40. // we have to call DangerousGetHandle to get IntPtr.
  41. [module: SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", Scope = "member", Target = "System.Messaging.MessageQueue.get_WriteHandle():System.IntPtr")]
  42. [module: SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", Scope = "member", Target = "System.Messaging.MessageQueue.get_ReadHandle():System.IntPtr")]
  43. [module: SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", Scope = "member", Target = "System.Messaging.MessageQueueEnumerator.get_LocatorHandle():System.IntPtr")]
  44. [module: SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", Scope = "member", Target = "System.Messaging.MessageEnumerator.get_CursorHandle():System.IntPtr")]
  45. [module: SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", Scope = "member", Target = "System.Messaging.Message.set_SecurityContext(System.Messaging.SecurityContext):System.Void")]
  46. // we have to pass IntPtr to BindToThreadPool, so we need to call DangerousGetHandle
  47. [module: SuppressMessage("Microsoft.Reliability", "CA2001:AvoidCallingProblematicMethods", Scope = "member", Target = "System.Messaging.MessageQueue+MQCacheableInfo.BindToThreadPool():System.Void")]
  48. //
  49. // We have a group of "meta-messages" related to CAS. All but one have been reviewed in Everett
  50. //
  51. [module: SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "member", Target = "System.Messaging.MessageQueue.add_ReceiveCompleted(System.Messaging.ReceiveCompletedEventHandler):System.Void")]
  52. [module: SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "member", Target = "System.Messaging.MessageQueue.SetPermissions(System.Messaging.AccessControlList):System.Void")]
  53. [module: SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "member", Target = "System.Messaging.MessageQueue.GenerateQueueProperties():System.Void")]
  54. [module: SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "member", Target = "System.Messaging.MessageQueue.get_CanWrite():System.Boolean")]
  55. [module: SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "member", Target = "System.Messaging.MessageQueue.GetMessageEnumerator():System.Messaging.MessageEnumerator")]
  56. [module: SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "member", Target = "System.Messaging.MessageQueue.get_CanRead():System.Boolean")]
  57. [module: SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "member", Target = "System.Messaging.MessageQueue.get_WriteHandle():System.IntPtr")]
  58. [module: SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "member", Target = "System.Messaging.MessageQueue.ReceiveCurrent(System.TimeSpan,System.Int32,System.Messaging.Interop.CursorHandle,System.Messaging.MessagePropertyFilter,System.Messaging.MessageQueueTransaction,System.Messaging.MessageQueueTransactionType):System.Messaging.Message")]
  59. [module: SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "member", Target = "System.Messaging.MessageQueue.ResetPermissions():System.Void")]
  60. [module: SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "member", Target = "System.Messaging.MessageQueue.SaveQueueProperties():System.Void")]
  61. [module: SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "member", Target = "System.Messaging.MessageQueue.InternalReceiveByLookupId(System.Boolean,System.Messaging.MessageLookupAction,System.Int64,System.Messaging.MessageQueueTransaction,System.Messaging.MessageQueueTransactionType):System.Messaging.Message")]
  62. [module: SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "member", Target = "System.Messaging.MessageQueue.Delete(System.String):System.Void")]
  63. [module: SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "member", Target = "System.Messaging.MessageQueue.SendInternal(System.Object,System.Messaging.MessageQueueTransaction,System.Messaging.MessageQueueTransactionType):System.Void")]
  64. [module: SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "member", Target = "System.Messaging.MessageQueue.ReceiveAsync(System.TimeSpan,System.Messaging.Interop.CursorHandle,System.Int32,System.AsyncCallback,System.Object):System.IAsyncResult")]
  65. [module: SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "member", Target = "System.Messaging.MessageQueue.Purge():System.Void")]
  66. [module: SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "member", Target = "System.Messaging.MessageQueue.get_ReadHandle():System.IntPtr")]
  67. [module: SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "member", Target = "System.Messaging.MessageQueue.get_Transactional():System.Boolean")]
  68. [module: SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "member", Target = "System.Messaging.MessageQueue.GetMessageEnumerator2():System.Messaging.MessageEnumerator")]
  69. [module: SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "member", Target = "System.Messaging.MessageQueue.add_PeekCompleted(System.Messaging.PeekCompletedEventHandler):System.Void")]
  70. [module: SuppressMessage("Microsoft.Security", "CA2103:ReviewImperativeSecurity", Scope = "member", Target = "System.Messaging.MessageQueuePermissionAttribute.CreatePermission():System.Security.IPermission")]
  71. [module: SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Scope = "member", Target = "System.Messaging.MessageQueueCriteria.set_MachineName(System.String):System.Void")]
  72. // Following two calls don't do check on MessageEnumerator.MoveNext path. However, MoveNext by itself doesn't expose any information.
  73. // Current or RemoveCurrent will do the check
  74. [module: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope = "member", Target = "System.Messaging.Interop.UnsafeNativeMethods.MQReceiveMessage(System.Messaging.Interop.MessageQueueHandle,System.UInt32,System.Int32,System.Messaging.Interop.MessagePropertyVariants+MQPROPS,System.Threading.NativeOverlapped*,System.Messaging.Interop.SafeNativeMethods+ReceiveCallback,System.Messaging.Interop.CursorHandle,System.IntPtr):System.Int32")]
  75. [module: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope = "member", Target = "System.Messaging.Interop.UnsafeNativeMethods.MQReceiveMessage(System.Messaging.Interop.MessageQueueHandle,System.UInt32,System.Int32,System.Messaging.Interop.MessagePropertyVariants+MQPROPS,System.Threading.NativeOverlapped*,System.Messaging.Interop.SafeNativeMethods+ReceiveCallback,System.Messaging.Interop.CursorHandle,System.Messaging.Interop.ITransaction):System.Int32")]
  76. // This call is exposed through Cursor ctor called in MessageQueue.CreateCursor. However, Cursor by itself doesn't expose any information.
  77. [module: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope = "member", Target = "System.Messaging.Interop.UnsafeNativeMethods.IntMQOpenQueue(System.String,System.Int32,System.Int32,System.Messaging.Interop.MessageQueueHandle&):System.Int32")]
  78. // This call is exposed through Message.SourceMachine. Message has been received, implying that receiver has necessary permissions.
  79. [module: SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage", Scope = "member", Target = "System.Messaging.Interop.UnsafeNativeMethods.IntMQGetMachineProperties(System.String,System.IntPtr,System.Messaging.Interop.MessagePropertyVariants+MQPROPS):System.Int32")]