RtlCompressBuffer() implements LZNT1 compression. It’s fast enough and good enough, though not great. You can only compress up to 64K at a time (hardcoded limit), which really limits the overall compression ratio you can achieve when compressing a large stream. This is the compression routine that NTFS uses for its compression feature. NTFS compresses a file in units of up to 64K at a time, which jives nicely with the hardcoded limit in RtlCompressBuffer().
Explorer’s “Send to compressed (zipped) folder” feature simply creates a .zip file, using the public domain ZIP format.
CABARC creates .cab files, which use the Cabinet format. Cabinet is a proprietary Microsoft format which is most definitely not the same as the ZIP format. The codec options (MSZIP, LZX) are also proprietary Microsoft formats and not the same as those used in ZIP. MSZIP is based on Huffman, while LZX is based on Lempel-Ziv and is generally much better than MSZIP. Note that Cabinet takes advantage of cross-file compression (giving Cabinet a compression advantage over ZIP), whereas ZIP compresses each file individually (giving ZIP a speed advantage when extracting a single file).
Hope this clarifies things a bit.
Craig
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-409962-
xxxxx@lists.osr.com] On Behalf Of xxxxx@evitechnology.com
Sent: Friday, April 30, 2010 1:53 PM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] RtlCompressBuffer compression ratio
I don’t know much about RtlCompressBuffer(), but based on the difference
in sizes, I would guess that Explorer is probably using LZX compression.
You can experiment with this out one the command line with CABARC:
cabarc -m MSZIP …
cabarc -m LZX …
mm
NTFSD is sponsored by OSR
For our schedule of debugging and file system seminars (including our new fs
mini-filter seminar) 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