title: Number of bytes read by synchronous ReadFile
body: <p>Assume I have 1Mb file, file pointer is at the beginning of the file. I call synchronous ReadFile:</p>
  
  <pre><code>ReadFile(Handle, Buffer, 1024, Result, nil);
  </code></pre>
  
  <p>the call is succesful, no error occured. Is it possible that Result value (number of bytes read) is less than 1024 (number of bytes to read)?</p>
  
  <p>I think that is impossible for disk files, I am not sure about other resources that can be accessed by ReadFile. Should I take the above scenario into account while writing a general code that can work with different resources?</p>
  
  <hr>
  
  <p>To avoid philosophical speculations I can reformulate the question as follows:</p>
  
  <p>Synchronous ReadFile was executed without error and a number of bytes read is less than a number of to read. Can I be sure that EOF is reached?</p>