title: ReadFile function returns ERROR_INVALID_PARAMETER
body: <p>I'm trying to get to work ReadFile function. Here's my code:</p>
  
  <pre><code>#define BUFFERSIZE 5
  
  int main(int argc, char* argv[])
  {
      OVERLAPPED overlapIn = {};
      HANDLE tHandle;
      char buf[BUFFERSIZE] = {};
      DWORD  lpNumberOfBytesRead;
  
      tHandle = CreateFile(
          L"\\\\.\\D:",
          GENERIC_READ,
          FILE_SHARE_READ,
          NULL,
          OPEN_EXISTING,
          FILE_ATTRIBUTE_NORMAL,
          NULL);
  
      if (tHandle == INVALID_HANDLE_VALUE)
      {
          DWORD error = GetLastError();
          assert(0);
      }
  
      if (ReadFile(tHandle, &amp;buf, BUFFERSIZE - 1, &amp;lpNumberOfBytesRead, NULL) == 0)
      {
          int error = GetLastError();
          printf("Terminal failure: Unable to read from disk.\n GetLastError=%d\n", error);
          CloseHandle(tHandle);
          return 1;
      }
  </code></pre>
  
  <p>The GetLastError function returns code 87, which is ERROR_INVALID_PARAMETER.</p>
  
  <p>It's clear that one of the parameters is wrong, but I have no idea which one, since I tried to do everything like it's written in the documentation.</p>