title: What happens when I do ReadFile() on a HID device on Windows?
body: <p>When I do a ReadFile/WriteFile on a handle provided by CreateFile(HID_DEVICE_NAME,...), what happens in a terms of HID operations?</p>
  
  <p>Does it issues a direct write/read request to HID device (USB, in my case), or is it transformed somewhere in underlying drivers to read last cached HID report with such ID?</p>
  
  <hr>
  
  <p><em>ReadFile call:</em></p>
  
  <pre><code>syncDevice.OutputReportBuffer[0] = 0;
  syncDevice.OutputReportBuffer[1] = reportID;
  HANDLE writeHandle = CreateFile(pDevice-&gt;DevicePath, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0);
  HANDLE readHandle = CreateFile(pDevice-&gt;DevicePath, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, 0, 0);
  success = WriteFile(writeHandle, (void*) syncDevice.OutputReportBuffer, syncDevice.Caps.OutputReportByteLength, &amp;bytecnt, 0);
  success = ReadFile(readHandle, syncDevice.InputReportBuffer, syncDevice.Caps.InputReportByteLength, &amp;bytecnt, 0);
  </code></pre>