title: Createfile works, but handle is invalid on FileStream Construction
body: <p>I'm trying to connect to a Wiimote in Unity3D through HID.</p>
  
  <p>When I call <code>CreateFile()</code> (from kernel32) a "valid" pointer is returned, and I can even get the Wiimote's capabilities through <code>HidD_GetPreparsedData</code> and <code>HidP_GetCaps</code>. Buffer-size etc. is returned, and is the size that I'm expecting. However, when I try to open a <code>FileStream</code> on the handle, it errors with "Invalid Handle".</p>
  
  <p>How can this handle be invalid here if I can <code>GetCaps</code>? <code>Marshal32.GetLastWinError()</code> is also returning 0.</p>
  
  <p>Relevant code:</p>
  
  <pre><code>int i = 0;
  foreach (string devPath in devicePaths)
  {
      Debug.Log(i);
      i++;
      if (devPath.Contains(VID_NINTENDO))
          if (devPath.Contains(PID_WIIMOTE)) // ADD OTHER PID (IF EVER FOUND)
          {
              try
              {
                  IntPtr dev_Handle = CreateFile(devPath, FileAccess.Read | FileAccess.Write, FileShare.Read | FileShare.Write, IntPtr.Zero, FileMode.Open, FILE_FLAG_OVERLAPPED, IntPtr.Zero); // Gives a "Valid" pointer
                  IntPtr device_data = IntPtr.Zero;
                  int inputLength = 0;
                  try
                  {
                      if (!HidD_GetPreparsedData(dev_Handle, out device_data))
                      {
                          throw new HIDException("Unable to get Preparsed data from device");
                      }
                      HidCaps device_capabilities; // Struct to contain inputlength etc.
                      HidP_GetCaps(device_data, out device_capabilities);
                      inputLength = device_capabilities.InputReportByteLength;
                      int outputLength = device_capabilities.OutputReportByteLength;
                      FileStream stream = new FileStream(dev_Handle, FileAccess.Read | FileAccess.Write, true, inputLength); // INVALID HANDLE
                      //FileStream stream = new FileStream(new SafeFileHandle(dev_Handle, false), FileAccess.Read | FileAccess.Write, inputLength, true); // Invalid Handle
                      //FileStream stream = new FileStream(dev_Handle, FileAccess.Read | FileAccess.Write, true, inputLength); // Invalid Handle
                      //FileStream stream = new FileStream(devPath, FileMode.Open, FileAccess.Read | FileAccess.Write, FileShare.Read | FileShare.Write, inputLength); // nullref (The file isnt being created in this path)
                      Debug.Log(dev_Handle);
                  }
                  catch (Exception e)
                  {
                      HandleException(e, "HIDException");
                  }
                  finally
                  {
                      HidD_FreePreparsedData(ref device_data);
                  }
              }
              catch (Exception e)
              {
                  HandleException(e, "HIDException");
              }
          }                            
      }
  </code></pre>
  
  <p>Also, in a regular C# project it simply works :( (although I did have to set useAsync = true in the FileStream Constructor (still <code>Invalid Handle</code> in Unity though)</p>