阅读:1197回复:2
devia大牛来看下.使用FileObject写文件的问题.我在IRP_MJ_SETINFORMATION中,先把Irp下发执行完毕. 然后自己build一个MJ_WRITE的IRP向原文件尾部写4个字节. 在IoCallDriver(DeviceObject, Irp);时蓝...何解呢? IRP_MJ_SETINFORMATION中不能使用FileObject写数据? |
|
|
沙发#
发布于:2008-01-17 16:34
1。如果你要在文件尾进行追加的话就无须特意移动文件读写指针了,解释如下:
If the following condition is true, this indicates that the current end of file should be used instead of an explicit file offset value: IrpSp->Parameters.Write.ByteOffset.LowPart == FILE_WRITE_TO_END_OF_FILE and IrpSp->Parameters.Write.ByteOffset.HighPart == -1 If the file object was opened for synchronous I/O, and one of the following conditions is true, this indicates that the current file position should be used instead of an explicit file offset value: IrpSp->Parameters.Write.ByteOffset == NULL IrpSp->Parameters.Write.ByteOffset.LowPart == FILE_USE_FILE_POINTER_POSITION and IrpSp->Parameters.Write.ByteOffset.HighPart == -1 2。如何自己发IRP来完成IO,你在论坛找找我以前发的OSR上的Demo http://bbs.driverdevelop.com/htm_data/39/0704/101220.html |
|
|
板凳#
发布于:2008-01-18 09:20
历害,果然是好大牛.顶个~
|
|
|