It isn’t ideal, but a pre create open name query should not be a lot of overhead relative to the overall remote create. Fltmgr is just allocating some memory and parsing the fileobject->Filename. Another benefit is if anyone else needs the name, it will now be in fltmgr’s name cache.
For a mailslot you should always have the \servname*\MAILSLOT\ format. For a pipe, as you’ve seen you might get IPC$. I’d recommend checking the fileobject flags for FO_NAMED_PIPE in post create.
Thanks,
Scott [MSFT]
This posting is provided “AS IS” with no warranties, and confers no rights.
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@vmware.com
Sent: Tuesday, January 31, 2012 12:23 AM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] Best way to ignore remote mailslot/named pipe activity in file system filter driver
Thanks Scott and Maxim for your responses.
Scott, I agree with your advice to use the filter manager API. However, I had concerns about the overheads of calling FltGetFileNameInformation on each PreOpCreate just to check if the FILE_OBJECT is pointing to named pipe/mailslot. Hence, I was asking if it is safe to directly parse fltObjects->FileObject->FileName instead (after doing standard NULL, length checks etc). Is it possible to have a FILE_OBJECT referring to named pipe/mailslot when fltObjects->FileObject->FileName is not having the pattern \servername*\MAILSLOT.… OR \servername\PIPE.…?
Maxim, I am not sure about what you mean by client ends of the network pipe here? When machine A creates a named pipe say “hello” and machine B connects to it, our filter driver running on machine B sees PreOpCreate with FileName=\A\PIPE\Hello. We want to ignore this request and return FLT_PREOP_SUCCESS_NO_CALLBACK from PreOpCreate. Are you saying that, in this case, Drv0 name will be msfs/npfs? Filter on machine B doesn’t see this request at all since it will be directly served by NPFS and our filter doesn’t attach to it anyways.
Thanks.
-Prasad
NTFSD is sponsored by OSR
For our schedule of debugging and file system seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer