[cifs-protocol] RE: LZ77 + DIRECT2 compression MS-OXCRPC
Tom.Devey at microsoft.com
Fri Aug 29 16:24:44 GMT 2008
Let me dig into this. Also note there is a problem in the current documentation for [MS-OXCRPC] 22.214.171.124.2.4 Match Length for decoding.
The feedback to the resolution was posted below:
The [MS-OXCRPC] document says that if the match length is greater than 9 then we have to read an additional byte and use high-order nibble as an additive length. The low-order nibble should be kept and used when the next time the match length is greater than nine. As it turned out we should do quite opposite: use LOW-order nibble the first time and HIGH-order nibble the next time.
From: Matthieu Suiche [mailto:msuiche at gmail.com]
Sent: Thursday, August 28, 2008 4:37 PM
To: Interoperability Documentation Help
Cc: pfif at tridgell.net; cifs-protocol at samba.org; Stefan (metze) Metzmacher
Subject: LZ77 + DIRECT2 compression MS-OXCRPC
As a PFIF subcontractor, I am requesting correction assistance:
In MS-OXCRPC, 126.96.36.199.1.2 is claims "2. Find the longest match in the
window for the lookahead buffer." in the "Using the compression
But it looks Microsoft implementation has an unexpected behavior
regarding the above line. Actually, I've implemented both
decompression and compression of (LZ77+DIRECT2) algorithm and it works
well. But the problem I have is my compression function doesn't return
the same output has MSFT does. The routine I've implemented to find
the longest match in the window for the lookahead buffer returns a
longer length than MSFT implementation.
My compression routine returns:
string found at uncompressed_position 0x00000052
[ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ]
comp = 00BF = Metadata (len,offset) = (22, 00000017) -
bestlen < 25
comp = 0C (shared byte)
Comparaison of the compressed chunk:
comp_chunk_by_microsoft 32 != BF mycomp
comp_chunk_by_microsoft 00 == 00 mycomp
comp_chunk_by_microsoft 07 != DC mycomp
As you can see, MSFT implementation encode a 0x0032 metadata at offset
0x35 which means size of 5 (2 + 3) at position -6, and my
implementation encode a three bytes metadata at offset 0x35.
Here, http://www.msuiche.net/samba/debug_lzxpress.zip, you can found
debug outputs and concerned file. All files concern only
Could you please describe the exact process to retrieve the longest
match in the window for the lookahead buffer?
More information about the cifs-protocol