Port of CreateFile INVALID_HANDLE_VALUE
<p>So I'm porting this stuff from c++ to c#.  And part of it looks like this:</p>

<pre><code>      m_hParstat = CreateFile( _T("\\\\.\\LPTSTAT1"), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );

  if( m_hParstat == INVALID_HANDLE_VALUE )
  {
     // do some stuff
  }
</code></pre>

<p>So in my c# code I've got </p>

<pre><code>[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
static extern IntPtr CreateFile(string lpFileName, uint dwDesiredAccess,
                     uint dwShareMode, IntPtr lpSecurityAttributes, uint dwCreationDisposition,
                     uint dwFlagsAndAttributes, IntPtr hTemplateFile);

public const int FILE_ATTRIBUTE_NORMAL = 0x00000080;
public const uint GENERIC_READ = 0x80000000;
public const uint OPEN_EXISTING = 3;
public const UInt32 INVALID_HANDLE_VALUE = 0xffffffff;
</code></pre>

<p>And then </p>

<pre><code>  m_hParstat = CreateFile("\\\\.\\LPTSTAT1", GENERIC_READ, 0, IntPtr.Zero, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, IntPtr.Zero);
  if (m_hParstat.ToInt32() == INVALID_HANDLE_VALUE)
  {

  }
</code></pre>

<p>But VS is saying that the comparison is useless because the constant is outside the range of int.  How do I check my handle for a valid value?</p>
