Filter driver - Denied access

Hello All,
My driver-filter attached to logical disk device (like FileMon by
SysInternals). I want to denied access for some files with help of
it. It is work, but not for all. Help me, please.


Dispatch routine:
...
PIO_STACK_LOCATION currentIrpStack = IoGetCurrentIrpStackLocation(pIrp);
pDeviceContext = pDeviceObject ->DeviceExtension;
if(IsHooked){
fileObject = currentIrpStack->FileObject;

if (GetFileName(fileObject, pDeviceContext->Drive, fullPathName) &&
PbxFileIsProtected(pDeviceContext->Drive, fullPathName))
{
pIrp->IoStatus.Status = STATUS_ACCESS_DENIED;
pIrp->IoStatus.Information = 0;
IoCompleteRequest (pIrp, IO_NO_INCREMENT);
return STATUS_ACCESS_DENIED;
}
...

Fast I/O :
...
if (
IsHooked &&
GetFileName(FileObject, pDevContext->Drive, fullPathName) &&
PbxFileIsProtected(pDevContext->Drive, fullPathName)
)
{
IoStatus->Status = STATUS_ACCESS_DENIED;
return FALSE;
}

retval = pDevContext->pFileSystem->DriverObject->FastIoDispatch->
FastIoXXX( FileObject, FileOffset, Length,
Wait, LockKey, Buffer, IoStatus, pDevContext->pFileSystem );
...
return retval;


Is it correct? Is anything missed?
Sorry for stupid answers - I'm beginner(In english, too).
Thanks in advance.

Best regards,
Gena mailto:xxxxx@tut.by