在MSDN中查到了这么一句话
If the call to ZwCreateFile set only the DesiredAccess flag FILE_APPEND_DATA, ByteOffset is ignored. Data in the given Buffer, for Length bytes, is written starting at the current end of file.
只要把ZwCreateFile中的DesiredAccess设置为FILE_APPEND_DATA,ZwWriteFile写入的偏移ByteOffset就会被忽略,直接从文件结尾开始写.
当使用ZwCreateFile API并仅设置DesiredAccess标志为FILE_APPEND_DATA时,不论ByteOffset参数如何设定,数据都将从文件末尾开始追加。此特性允许程序无需关心当前文件位置即可实现数据追加。

3347

被折叠的 条评论
为什么被折叠?



