Hi,all.
i have written a file system filter driver. i want to set some information in the special file header (information,the file context).In IRP_MJ_CREATE dispatch ,i look for the information to validate that the file is the special file,The FileObject will be inserted into a array if it is .Then in IRP_MJ_READ dispatch i must modify the IrpSp->Parameters.Read.ByteOffset and the FileOffset in FastIoread routine to get the file context.But this is something wrong, the information readed is wrong . Can someone help me ?
case IRP_MJ_READ:
if(FileObjectInHashTable(FileObject))//this is my specail file
{
LARGE_INTEGER StartingOffset={FILE_HEAD,0};
nextIrpStack->Parameters.Read.ByteOffset=RtlLargeIntegerAdd(nextIrpStack->Parameters.Read.ByteOffset,StartingOffset);
IoSetCompletionRoutine( Irp, QueryCompletion,&eveComplete,TRUE, TRUE, TRUE );
status=IoCallDriver( hookExt->FileSystem, Irp );
if (status == STATUS_PENDING)
{
status = KeWaitForSingleObject( &eveComplete, Executive,KernelMode, FALSE, NULL );
}
return Irp->IoStatus.Status;
}
else
…
Thanks!
Yanming Xiang
Your header must be exactly 1 page in size, otherwise, paging IO will be very much confused.
Max
----- Original Message -----
From: Xiang Yanming
To: File Systems Developers
Sent: Tuesday, May 14, 2002 6:07 AM
Subject: [ntfsd] How to modify the file offset in IRP_MJ_READ
Hi,all.
i have written a file system filter driver. i want to set some information in the special file header (information,the file context).In IRP_MJ_CREATE dispatch ,i look for the information to validate that the file is the special file,The FileObject will be inserted into a array if it is .Then in IRP_MJ_READ dispatch i must modify the IrpSp->Parameters.Read.ByteOffset and the FileOffset in FastIoread routine to get the file context.But this is something wrong, the information readed is wrong . Can someone help me ?
case IRP_MJ_READ:
if(FileObjectInHashTable(FileObject))//this is my specail file
{
LARGE_INTEGER StartingOffset={FILE_HEAD,0};
nextIrpStack->Parameters.Read.ByteOffset=RtlLargeIntegerAdd(nextIrpStack->Parameters.Read.ByteOffset,StartingOffset);
IoSetCompletionRoutine( Irp, QueryCompletion,&eveComplete,TRUE, TRUE, TRUE );
status=IoCallDriver( hookExt->FileSystem, Irp );
if (status == STATUS_PENDING)
{
status = KeWaitForSingleObject( &eveComplete, Executive,KernelMode, FALSE, NULL );
}
return Irp->IoStatus.Status;
}
else
…
Thanks!
Yanming Xiang
b???.???????v???jɚ???ځ?+i??d??{.n???zwZnV??隊[h???z{_?ݴ?p%??l??