title: How to pass a nullable type to a P/invoked function
body: <p>I have a few p/invoked functions (but I'm rewriting my code at the moment so I'm tidying up) and I want to know how to use/pass a nullable type as one of the parameters. working with int types isn't a problem but given the following:</p>
  
  <pre><code>[DllImport("setupapi.dll", CharSet = CharSet.Auto, SetLastError = true)]
      static extern IntPtr SetupDiGetClassDevs(ref Guid ClassGuid, int? enumerator, IntPtr hwndParent, uint Flags);
  </code></pre>
  
  <p>I'd like to be able to pass the <code>Guid</code> parameter as a nullable type. As it stands at the moment I can call it as:</p>
  
  <pre><code>SetupDiGetClassDevs(ref tGuid, null, IntPtr.Zero, (uint)SetupDiFlags.DIGCF_PRESENT );
  </code></pre>
  
  <p>but I need the first parameter to also be passable as <code>null</code>.</p>