title: CreateFile in Kernel32.dll returns an invalid handle
body: <p>I'm trying to create a safe file handle for "C:" using the CreateFile method of kernel32.dll which always returns me an invalid handle. </p>
  
  <p>Any help on what am i doing wrong here?"C:</p>
  
  <pre><code>CreateFile(
      lpFileName: "C:",
      dwDesiredAccess: FileAccess.ReadWrite,
      dwShareMode: FileShare.ReadWrite,
      lpSecurityAttributes: IntPtr.Zero,
      dwCreationDisposition: FileMode.OpenOrCreate,
      dwFlagsAndAttributes: FileAttributes.Normal,
      hTemplateFile: IntPtr.Zero);
  
  [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
  public static extern SafeFileHandle CreateFile(
      string lpFileName,
      [MarshalAs(UnmanagedType.U4)] FileAccess dwDesiredAccess,
      [MarshalAs(UnmanagedType.U4)] FileShare dwShareMode,
      IntPtr lpSecurityAttributes,
      [MarshalAs(UnmanagedType.U4)] FileMode dwCreationDisposition,
      [MarshalAs(UnmanagedType.U4)] FileAttributes dwFlagsAndAttributes,
      IntPtr hTemplateFile);
  </code></pre>