请问如何解决的,我也遇到这个问题了。
补:
readfile第四个参数,msdn上解释为
OVERLAPPED structure
For an hFile that supports byte offsets, if you use this parameter you must specify a byte offset at which to start reading from the file or device. This offset is specified by setting the Offset and OffsetHighmembers of the OVERLAPPED structure. For an hFile that does not support byte offsets, Offset andOffsetHigh are ignored.
The calling process must set this member before passing the OVERLAPPED structure to functions that use an offset, such as the ReadFile or WriteFile (and related) functions.
根据我的经验,对于关闭Flow Control的文件,readfile第四个参数OVERLAPPED structure需要手动设置offset、OffsetHigh为0或其他需要的值,否则readfile正确返回,但读取长度为0,即读不出来数据
对于打开Flow Control的文件,似乎offset、OffsetHigh参数对readfile函数不是必须的
看 龚建伟 的书 吧