cwindowswinapiio

is there a 64 bit version of _read() or read()?


_read() and read() 3rd argument (_MaxCharCount) is unsigned int, which limits the read to 2GB, is there a version that uses a 64 bit third argument? because there is _lseeki64 so doesnt make sense why no 64 bit read function.


Solution

  • no. look for ZwReadFile - for Length - The size, in bytes, of the buffer- used ULONG ( 32 bit size). so windows by design not support more than 4GB read in sigle I/O operation. the ZwReadFileScatter have the same restriction about Length ( ULONG). any other api, like _read is only shell over ZwReadFile . so it can not support more that ULONG (32 bit) for size, in bytes, of the buffer