Hi,
I need to deny access to certain operations on some files from my
filter driver. The problem I am facing is with the filenames. The
filenames can have 2^n possibilities, where n is the number of
components (based on short path and long path). I find it very
expensive to convert a path name into a fully short or long path name.
The Unix equivalent of this driver just uses inodes.
What is a smart way to solve this problem? Should I store names? What
is the smartest way to convert a given path into a longpath or
shortpath? Can i use file_id’s instead? Are file_id’s supported on all
filesystems? Do file_id’s persist across reboots for all filesystems?
Thanks
By far the easiest way to implement this would be by
making a mini-filter.
If you can’t do a mini-filter then ask again.
— foo bar wrote:
> Hi,
>
> I need to deny access to certain operations on some
> files from my
> filter driver. The problem I am facing is with the
> filenames. The
> filenames can have 2^n possibilities, where n is the
> number of
> components (based on short path and long path). I
> find it very
> expensive to convert a path name into a fully short
> or long path name.
> The Unix equivalent of this driver just uses inodes.
>
> What is a smart way to solve this problem? Should I
> store names? What
> is the smartest way to convert a given path into a
> longpath or
> shortpath? Can i use file_id’s instead? Are
> file_id’s supported on all
> filesystems? Do file_id’s persist across reboots for
> all filesystems?
>
> Thanks
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: unknown
> lmsubst tag argument: ‘’
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
No I can’t do a minifilter because this needs to work on 2kSP4 and NT4 too.
On 4/17/05, Randy Cook wrote:
> By far the easiest way to implement this would be by
> making a mini-filter.
>
> If you can’t do a mini-filter then ask again.
>
> — foo bar wrote:
> > Hi,
> >
> > I need to deny access to certain operations on some
> > files from my
> > filter driver. The problem I am facing is with the
> > filenames. The
> > filenames can have 2^n possibilities, where n is the
> > number of
> > components (based on short path and long path). I
> > find it very
> > expensive to convert a path name into a fully short
> > or long path name.
> > The Unix equivalent of this driver just uses inodes.
> >
> > What is a smart way to solve this problem? Should I
> > store names? What
> > is the smartest way to convert a given path into a
> > longpath or
> > shortpath? Can i use file_id’s instead? Are
> > file_id’s supported on all
> > filesystems? Do file_id’s persist across reboots for
> > all filesystems?
> >
> > Thanks
> >
> > —
> > Questions? First check the IFS FAQ at
> > https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as: unknown
> > lmsubst tag argument: ‘’
> > To unsubscribe send a blank email to
> > xxxxx@lists.osr.com
> >
>
> —
> Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
Filter manager is available for 2kSP4 via a “security”
patch. Tough luck on NT4. You could probably get
this going in a couple of weeks using the filter
manager. I would say much longer without. But if you
can’t…
Assuming that you are not denying opens, get the
just-opened file name in a completion routine. If you
have to work on NT4 then you won’t have per-stream
contexts either so you will have to have some way of
persisting your info about the just opened file and a
very fast way of looking it up.
What operations are you interested in denying?
Windows is somewhat picky about this and will freak
out if you deny some but not others.
— NTFSD-List wrote:
> No I can’t do a minifilter because this needs to
> work on 2kSP4 and NT4 too.
>
>
> On 4/17/05, Randy Cook wrote:
> > By far the easiest way to implement this would be
> by
> > making a mini-filter.
> >
> > If you can’t do a mini-filter then ask again.
> >
> > — foo bar wrote:
> > > Hi,
> > >
> > > I need to deny access to certain operations on
> some
> > > files from my
> > > filter driver. The problem I am facing is with
> the
> > > filenames. The
> > > filenames can have 2^n possibilities, where n is
> the
> > > number of
> > > components (based on short path and long path).
> I
> > > find it very
> > > expensive to convert a path name into a fully
> short
> > > or long path name.
> > > The Unix equivalent of this driver just uses
> inodes.
> > >
> > > What is a smart way to solve this problem?
> Should I
> > > store names? What
> > > is the smartest way to convert a given path into
> a
> > > longpath or
> > > shortpath? Can i use file_id’s instead? Are
> > > file_id’s supported on all
> > > filesystems? Do file_id’s persist across reboots
> for
> > > all filesystems?
> > >
> > > Thanks
> > >
> > > —
> > > Questions? First check the IFS FAQ at
> > > https://www.osronline.com/article.cfm?id=17
> > >
> > > You are currently subscribed to ntfsd as:
> unknown
> > > lmsubst tag argument: ‘’
> > > To unsubscribe send a blank email to
> > > xxxxx@lists.osr.com
> > >
> >
> > —
> > Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
> >
> > You are currently subscribed to ntfsd as:
> xxxxx@gmail.com
> > To unsubscribe send a blank email to
> xxxxx@lists.osr.com
> >
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: unknown
> lmsubst tag argument: ‘’
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
Well, consider using this:
On FastFat and network file systems, query the file name
after succesful create. You’ll get the long file name.
On NTFS, after successtul create operation,
save the FsContext2 of the file object, set it
to NULL and query the file name. You’ll get the long file name
too. Although it is a black magic and is undocumented,
IT WORKS since NT4 to Longhorn (at leat the last available
alfa pre-release).
This approach has only one caveat known to me.
On NT4, there is a bug in NTFS.sys, which will cause
bugcheck under these circumstances:
- You have a NTFS volume
- The computer has been shut down by reset or hard-power-off
- After restart, a file in the root directory is open
- After the successfull create, ntfs.sys begins
to fill memory with unicode backslashes, which results
BSOD.
This bug does not appear in Win2000 and/or later.
If you can avoid this bug, you may confortably get
the long file name with no overhead comparing to normal
name query.
L.
–
Ochrana proti p?esm?rov?n? na drah? linky. Ji? ??dn? vysok? ??ty!
VOLN? internet alarm - je?t? bezpe?n?j?? surfov?n?!
Sta?en? i pou??v?n? je ZDARMA na http://alarm.volny.cz