﻿<?xml version="1.0" encoding="utf-8"?>
<annotationReport annotatorVersion="4.0.21105.0">
  <requiredAnnotations>
    <assembly name="buffer">
      <type name="Buffer">
        <method name=".ctor(Int32)">
          <annotations>
            <critical>
              <rule name="TransparentMethodsMustNotReferenceCriticalCode">
                <reason pass="1" sourceFile="c:\blog\buffer.cs" sourceLine="20">Transparent method 'Buffer..ctor(System.Int32)' references security critical method 'System.Runtime.InteropServices.Marshal.AllocCoTaskMem(System.Int32)'.  In order for this reference to be allowed under the security transparency rules, either 'Buffer..ctor(System.Int32)' must become security critical or safe-critical, or 'System.Runtime.InteropServices.Marshal.AllocCoTaskMem(System.Int32)' become security safe-critical or transparent.</reason>
              </rule>
            </critical>
          </annotations>
        </method>
        <method name="Dispose()">
          <annotations>
            <safeCritical>
              <rule name="MethodsMustOverrideWithConsistentTransparency">
                <reason pass="3" sourceFile="c:\blog\buffer.cs" sourceLine="29">Critical method 'Buffer.Dispose()' is overriding transparent or safe critical method 'System.IDisposable.Dispose()' in violation of method override rules.  'Buffer.Dispose()' must become transparent or safe-critical in order to override a transparent or safe-critical virtual method or implement a transparent or safe-critical interface method.</reason>
              </rule>
            </safeCritical>
            <critical>
              <rule name="TransparentMethodsMustNotReferenceCriticalCode">
                <reason pass="2" sourceFile="c:\blog\buffer.cs" sourceLine="30">Transparent method 'Buffer.Dispose()' references security critical method 'Buffer.Dispose(System.Boolean)'.  In order for this reference to be allowed under the security transparency rules, either 'Buffer.Dispose()' must become security critical or safe-critical, or 'Buffer.Dispose(System.Boolean)' become security safe-critical or transparent.</reason>
              </rule>
            </critical>
          </annotations>
        </method>
        <method name="Dispose(Boolean)">
          <annotations>
            <critical>
              <rule name="TransparentMethodsMustNotReferenceCriticalCode">
                <reason pass="1" sourceFile="c:\blog\buffer.cs" sourceLine="38">Transparent method 'Buffer.Dispose(System.Boolean)' references security critical method 'System.Runtime.InteropServices.Marshal.FreeCoTaskMem(System.IntPtr)'.  In order for this reference to be allowed under the security transparency rules, either 'Buffer.Dispose(System.Boolean)' must become security critical or safe-critical, or 'System.Runtime.InteropServices.Marshal.FreeCoTaskMem(System.IntPtr)' become security safe-critical or transparent.</reason>
              </rule>
            </critical>
          </annotations>
        </method>
        <method name="Finalize()">
          <annotations>
            <safeCritical>
              <rule name="MethodsMustOverrideWithConsistentTransparency">
                <reason pass="3" sourceFile="c:\blog\buffer.cs" sourceLine="24">Critical method 'Buffer.Finalize()' is overriding transparent or safe critical method 'System.Object.Finalize()' in violation of method override rules.  'Buffer.Finalize()' must become transparent or safe-critical in order to override a transparent or safe-critical virtual method or implement a transparent or safe-critical interface method.</reason>
              </rule>
            </safeCritical>
            <critical>
              <rule name="TransparentMethodsMustNotReferenceCriticalCode">
                <reason pass="2" sourceFile="c:\blog\buffer.cs" sourceLine="25">Transparent method 'Buffer.Finalize()' references security critical method 'Buffer.Dispose(System.Boolean)'.  In order for this reference to be allowed under the security transparency rules, either 'Buffer.Finalize()' must become security critical or safe-critical, or 'Buffer.Dispose(System.Boolean)' become security safe-critical or transparent.</reason>
              </rule>
            </critical>
          </annotations>
        </method>
        <method name="get_NativePointer()">
          <annotations>
            <critical>
              <rule name="SecurityRuleSetLevel2MethodsShouldNotBeProtectedWithLinkDemands">
                <reason pass="1" sourceFile="c:\blog\buffer.cs" sourceLine="47">'Buffer.get_NativePointer()' is protected with a LinkDemand for 'SecurityPermissionAttribute'.  In the level 2 security rule set, it should be protected by being security critical instead.  Remove the LinkDemand and mark 'Buffer.get_NativePointer()' security critical.</reason>
              </rule>
              <rule name="TransparentMethodsShouldNotBeProtectedWithLinkDemands">
                <reason pass="1" sourceFile="c:\blog\buffer.cs" sourceLine="47">Transparent method 'Buffer.get_NativePointer()' is protected with a LinkDemand for 'SecurityPermissionAttribute'.  Remove this LinkDemand, or make the method security critical or safe-critical.</reason>
              </rule>
            </critical>
          </annotations>
        </method>
      </type>
    </assembly>
  </requiredAnnotations>
  <ruleInformation>
    <ruleDescription name="MethodsMustOverrideWithConsistentTransparency">
      <description>Transparency visibility must be preserved between overriding methods and the methods that are being overridden.  If the virtual method being overridden or interface method being implemented is security safe-critical or security transparent, then the overriding method must also be either security safe-critical or security transparent.  Similarly, if the method being overridden is security critical, the overriding method must be security critical.</description>
    </ruleDescription>
    <ruleDescription name="SecurityRuleSetLevel2MethodsShouldNotBeProtectedWithLinkDemands">
      <description>LinkDemands are deprecated in the level 2 security rule set.  Instead of using LinkDemands to enforce JIT time security, SecurityCritical methods, types, and fields should be used instead.</description>
    </ruleDescription>
    <ruleDescription name="TransparentMethodsMustNotReferenceCriticalCode">
      <description>Transparent code cannot refer to security critical methods, types, or fields.  At runtime these references will result in MemberAccessExceptions or TypeLoadExceptions.</description>
    </ruleDescription>
    <ruleDescription name="TransparentMethodsShouldNotBeProtectedWithLinkDemands">
      <description>Security transparent code should not be responsible for verifying the security of an operation, and therefore should not be protected from partial trust callers with LinkDemands.</description>
    </ruleDescription>
  </ruleInformation>
</annotationReport>
