Heads or Tails!

Hi All,

I am making some modifications to my filter driver and would like to
pre/append some information to each file I am filtering. This has come up
numerous times on the list but I don’t think there has been a definitive
list of pros and cons on each method. The question is, should I add my
metadata to the beginning or end of the file? What problems might I
encounter using each method? And, what are others experience of doing this?

Ben Curley
Software Engineer
Data Encryption Systems Ltd.

Tel: +44 (0)1823 352357 (Main)
Tel: +44 (0)1823 358320 (Direct Dial)

Web: http://www.deslock.com

Consider using named streams, rather than modifying the default file
stream.

– arlie

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@des.co.uk
Sent: Saturday, August 30, 2003 8:56 AM
To: File Systems Developers
Subject: [ntfsd] Heads or Tails!

Hi All,

I am making some modifications to my filter driver and would like to
pre/append some information to each file I am filtering. This has come
up numerous times on the list but I don’t think there has been a
definitive list of pros and cons on each method. The question is,
should I add my metadata to the beginning or end of the file? What
problems might I encounter using each method? And, what are others
experience of doing this?

Ben Curley
Software Engineer
Data Encryption Systems Ltd.

Tel: +44 (0)1823 352357 (Main)
Tel: +44 (0)1823 358320 (Direct Dial)

Web: http://www.deslock.com


You are currently subscribed to ntfsd as: xxxxx@sublinear.org To
unsubscribe send a blank email to xxxxx@lists.osr.com

Arlie Davis has a better idea if you product will be usable on NTFS only,
but with the new file system promised by Microsoft, storing your encryption
data in the data stream might be better and will be required for FAT. Ok,
for the answer:

A. Begin - Never done it this way myself

  1. All requests must be adjusted to skip over the special data.
  2. Access via no caching requests require special data to be modulus of
    sector size.
  3. Memory mapping becomes a little more difficult, I think because of these
    issues.

B. End - Did this about 1.5 years ago

  1. Extending of file requires special handling to keep special data at end
    of cache.
  2. Special data probably cannot be kept in driver’s memory and just written
    out during close because paging IO is only thing permitted after cleanup.
    Extending file size probably won’t work after cleanup, so each write request
    requires that the special data keeps appending the data. Little inefficient
    and keeping the special data in the driver’s structures, or whatever is
    required to recreate it, makes it easier to do and keep it correct.
  3. Simple subtraction needed for file size queries.
  4. Memory mapped files might permit program to overwrite your stuff, so be
    careful to ensure user program thinks file size doesn’t include your special
    data.

C. Both - Not special data on both ends of real data, but problems common to
both

  1. All file size requests need to be adjusted.
  2. Watch any structure, e.g. FCB, that might be accessible by those above
    you in stack and user mode programs.
  3. Office programs may copy file to various special names with or without a
    handle remaining open to the original file.
  4. No way to keep data encrypted until given to user program. Just won’t
    work with NT’s implementation of memory mapping.

Summary:
I like it at the end, but that might just be because I have done it that
way. Will the encrypted data with the special data be accessible from user
mode? If so, this is easier to permit sending an encrypted file to someone.
So, only adjust file sizes if decryption/encryption being done. How does a
user indicate a new file should be encrypted? The project I was involved
with had a separate user selection to encrypt a file that already exists.
It was not possible to indicate that a new file was to be encrypted as it
was created, but only after it was written and closed the first time.

wrote in message news:xxxxx@ntfsd…
>
>
> Hi All,
>
> I am making some modifications to my filter driver and would like to
> pre/append some information to each file I am filtering. This has come up
> numerous times on the list but I don’t think there has been a definitive
> list of pros and cons on each method. The question is, should I add my
> metadata to the beginning or end of the file? What problems might I
> encounter using each method? And, what are others experience of doing
this?
>
> Ben Curley
> Software Engineer
> Data Encryption Systems Ltd.
>
> Tel: +44 (0)1823 352357 (Main)
> Tel: +44 (0)1823 358320 (Direct Dial)
>
> Web: http://www.deslock.com
>
>
>

It makes life easier to append it to the end, but prepending it is OK too.
Your block should/must be sector aligned. For example, adding 256 bytes or
728 byte to the front or end makes it almost impossible to maintain
performance.

In one of my filters, I added meta-data to the front and made sure it was
512 byte aligned.

Regards,

Jamey Kirby, Windows DDK MVP
StorageCraft Inc.
xxxxx@storagecraft.com
http://www.storagecraft.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@des.co.uk
Sent: Saturday, August 30, 2003 5:56 AM
To: File Systems Developers
Subject: [ntfsd] Heads or Tails!

Hi All,

I am making some modifications to my filter driver and would like to
pre/append some information to each file I am filtering. This has come up
numerous times on the list but I don’t think there has been a definitive
list of pros and cons on each method. The question is, should I add my
metadata to the beginning or end of the file? What problems might I
encounter using each method? And, what are others experience of doing this?

Ben Curley
Software Engineer
Data Encryption Systems Ltd.

Tel: +44 (0)1823 352357 (Main)
Tel: +44 (0)1823 358320 (Direct Dial)

Web: http://www.deslock.com


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com