Ignoring UNC paths

Hi,

I’m using the file filter sample from the WDK and it’s working great, my only problem is that when the user tries to access network files using \server\share there’s a delay which some users notice, what I want is just to ignore network shares.

My code is inside: PtPreOperationPassThrough what’s the best way to bypass network requests in my driver.

Thanks,
Barak

It sounds like your filter is running on the client. If that’s the case, and you don’t care about remote files, the best thing to do is not attach to networked file systems.

Christian [MSFT]
This posting is provided “AS IS” with no warranties, and confers no rights.

Thanks for the feedback, I looked into: FltRegisterFilter and didn’t see a way to limit the registration to the file system only. Could you point me to the location you had in mind that I can limit the attach type.

Thanks

You limit your attachment in the instance setup callback; see http://msdn.microsoft.com/en-us/library/windows/hardware/ff551096(v=vs.85).aspx. Looks like you’re using the passthrough sample, so that would be PtInstanceSetup. The VolumeFilesystemType parameter to that routine tells you what filesystem you’re being attached to. If you want to attach to the given file system you return STATUS_SUCCESS from that routine, otherwise you return STATUS_FLT_DO_NOT_ATTACH.

Here are the values you could get in VolumeFilesystemType:

typedef enum _FLT_FILESYSTEM_TYPE {

FLT_FSTYPE_UNKNOWN, //an UNKNOWN file system type
FLT_FSTYPE_RAW, //Microsoft’s RAW file system (\FileSystem\RAW)
FLT_FSTYPE_NTFS, //Microsoft’s NTFS file system (\FileSystem\Ntfs)
FLT_FSTYPE_FAT, //Microsoft’s FAT file system (\FileSystem\Fastfat)
FLT_FSTYPE_CDFS, //Microsoft’s CDFS file system (\FileSystem\Cdfs)
FLT_FSTYPE_UDFS, //Microsoft’s UDFS file system (\FileSystem\Udfs)
FLT_FSTYPE_LANMAN, //Microsoft’s LanMan Redirector (\FileSystem\MRxSmb)
FLT_FSTYPE_WEBDAV, //Microsoft’s WebDav redirector (\FileSystem\MRxDav)
FLT_FSTYPE_RDPDR, //Microsoft’s Terminal Server redirector (\Driver\rdpdr)
FLT_FSTYPE_NFS, //Microsoft’s NFS file system (\FileSystem\NfsRdr)
FLT_FSTYPE_MS_NETWARE, //Microsoft’s NetWare redirector (\FileSystem\nwrdr)
FLT_FSTYPE_NETWARE, //Novell’s NetWare redirector
FLT_FSTYPE_BSUDF, //The BsUDF CD-ROM driver (\FileSystem\BsUDF)
FLT_FSTYPE_MUP, //Microsoft’s Mup redirector (\FileSystem\Mup)
FLT_FSTYPE_RSFX, //Microsoft’s WinFS redirector (\FileSystem\RsFxDrv)
FLT_FSTYPE_ROXIO_UDF1, //Roxio’s UDF writeable file system (\FileSystem\cdudf_xp)
FLT_FSTYPE_ROXIO_UDF2, //Roxio’s UDF readable file system (\FileSystem\UdfReadr_xp)
FLT_FSTYPE_ROXIO_UDF3, //Roxio’s DVD file system (\FileSystem\DVDVRRdr_xp)
FLT_FSTYPE_TACIT, //Tacit FileSystem (\Device\TCFSPSE)
FLT_FSTYPE_FS_REC, //Microsoft’s File system recognizer (\FileSystem\Fs_rec)
FLT_FSTYPE_INCD, //Nero’s InCD file system (\FileSystem\InCDfs)
FLT_FSTYPE_INCD_FAT, //Nero’s InCD FAT file system (\FileSystem\InCDFat)
FLT_FSTYPE_EXFAT, //Microsoft’s EXFat FILE SYSTEM (\FileSystem\exfat)
FLT_FSTYPE_PSFS, //PolyServ’s file system (\FileSystem\psfs)
FLT_FSTYPE_GPFS, //IBM General Parallel File System (\FileSystem\gpfs)
FLT_FSTYPE_NPFS, //Microsoft’s Named Pipe file system(\FileSystem\npfs)
FLT_FSTYPE_MSFS, //Microsoft’s Mailslot file system (\FileSystem\msfs)
FLT_FSTYPE_CSVFS, //Microsoft’s Cluster Shared Volume file system (\FileSystem\csvfs)
FLT_FSTYPE_REFS //Microsoft’s ReFS file system (\FileSystem\Refs)

} FLT_FILESYSTEM_TYPE, *PFLT_FILESYSTEM_TYPE;


Christian [MSFT]
This posting is provided “AS IS” with no warranties, and confers no rights.

Thanks, this is what I was looking for.