Assume I have 1Mb file, file pointer is at the beginning of the file. I call synchronous ReadFile:
ReadFile(Handle, Buffer, 1024, Result, nil);
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)?
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?
To avoid philosophical speculations I can reformulate the question as follows:
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?