Hi,all!
I am writting a file filter.when some kind of file is written and
closed,I must append some information to the file.I do this in
IRP_MJ_CLEANUP dispatch. In it ,I build an IRP_MJ_WRITE and send the Irp
,the send the IRP_MJ_CLEANUP down.But When logout ,a page failour
occur.If this is not possible is there any alternate way to do this?
case IRP_MJ_CLEANUP:
if(the file is interested )
{
if(get file EndOfFile size)
{
tmpCreateIrp = IoBuildSynchronousFsdRequest( IRP_MJ_WRITE,
hookExt->FileSystem,
chrTmpFileHeader,//point to an buffer
FILE_HEAD,
(PLARGE_INTEGER) &standinfo.EndOfFile,
&eventComplete,
& tmpCreateIoStatus);
if (!tmpCreateIrp)
{
break;
}
nextIrpStack = IoGetNextIrpStackLocation(tmpCreateIrp);
nextIrpStack->FileObject = FileObject;
nextIrpStack->MinorFunction =IRP_MN_NORMAL ;
nextIrpStack->DeviceObject=hookExt->FileSystem;
IoSetCompletionRoutine(tmpCreateIrp,GenericCompletion,&eveComplete,TRUE,TRUE,TRUE);
status = IoCallDriver( hookExt->FileSystem, tmpCreateIrp );
}
}
//send the irp_mj_cleanup down.
Thanks in advance!
Yanming Xiang