<Type Name="MarshalBooleansInPInvokeDeclarationsRule" FullName="Gendarme.Rules.Interoperability.MarshalBooleansInPInvokeDeclarationsRule">
  <TypeSignature Language="C#" Value="public class MarshalBooleansInPInvokeDeclarationsRule : Gendarme.Framework.Rule, Gendarme.Framework.IMethodRule" />
  <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit MarshalBooleansInPInvokeDeclarationsRule extends Gendarme.Framework.Rule implements class Gendarme.Framework.IMethodRule, class Gendarme.Framework.IRule" />
  <AssemblyInfo>
    <AssemblyName>Gendarme.Rules.Interoperability</AssemblyName>
    <AssemblyVersion>2.11.0.0</AssemblyVersion>
  </AssemblyInfo>
  <Base>
    <BaseTypeName>Gendarme.Framework.Rule</BaseTypeName>
  </Base>
  <Interfaces>
    <Interface>
      <InterfaceName>Gendarme.Framework.IMethodRule</InterfaceName>
    </Interface>
  </Interfaces>
  <Attributes>
    <Attribute>
      <AttributeName>Gendarme.Framework.FxCopCompatibility("Microsoft.Interoperability", "CA1414:MarkBooleanPInvokeArgumentsWithMarshalAs")</AttributeName>
    </Attribute>
    <Attribute>
      <AttributeName>Gendarme.Framework.Problem("No marshaling information is supplied for boolean parameters(s) on this p/invoke declaration.")</AttributeName>
    </Attribute>
    <Attribute>
      <AttributeName>Gendarme.Framework.Solution("Specify, even if just for clarity, the size of the unmanaged boolean representation.")</AttributeName>
    </Attribute>
  </Attributes>
  <Docs>
    <summary>
            This rule warns the developer if a <code>[MarshalAs]</code> attribute has not been
            specified for boolean parameters of a P/Invoke method. The size of boolean types varies
            across language (e.g. the C++ <c>bool</c> type is four bytes on some platforms and
            one byte on others). By default the CLR will marshal <b>System.Boolean</b> as a 32 bit value
            (<c>UnmanagedType.Bool</c>) like the Win32 API <b>BOOL</b> uses. But, for clarity,
            you should always specify the correct value.
            </summary>
    <remarks>To be added.</remarks>
    <example>
            Bad example:
            <code>
            // bad assuming the last parameter is a single byte being mapped to a bool
            [DllImport ("liberty")]
            private static extern bool Bad (bool b1, ref bool b2);
            </code></example>
    <example>
            Good example:
            <code>
            [DllImport ("liberty")]
            [return: MarshalAs (UnmanagedType.Bool)]
            private static extern bool Good ([MarshalAs (UnmanagedType.Bool)] bool b1, [MarshalAs (UnmanagedType.U1)] ref bool b2);
            </code></example>
  </Docs>
  <Members>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public MarshalBooleansInPInvokeDeclarationsRule ();" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.11.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Parameters />
      <Docs>
        <summary>To be added.</summary>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="CheckMethod">
      <MemberSignature Language="C#" Value="public Gendarme.Framework.RuleResult CheckMethod (Mono.Cecil.MethodDefinition method);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance valuetype Gendarme.Framework.RuleResult CheckMethod(class Mono.Cecil.MethodDefinition method) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>2.11.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>Gendarme.Framework.RuleResult</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="method" Type="Mono.Cecil.MethodDefinition" />
      </Parameters>
      <Docs>
        <param name="method">To be added.</param>
        <summary>To be added.</summary>
        <returns>To be added.</returns>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
  </Members>
</Type>
