[cifs-protocol] [MS-XCA] is LZ77 + Huffman the same as the Win32 compression API? - TrackingID#2210190040006868

Douglas Bagnall douglas.bagnall at catalyst.net.nz
Sun Oct 30 23:22:21 UTC 2022

This is more for the other people following along on cifs-protocol, rather than 
Obaid and the dochelp team.

On 20/10/22 10:13, Obaid Farooqi wrote:
> SMB does not use the API that you mentioned for compression. It uses the following API
> https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/ntifs/nf-ntifs-rtlcompressbuffer

I haven't been able to compile and link a test utility using this API, which 
seems to be available in kernel mode only.

I think it is possible, but you need to compile the thing as a driver, rather 
than a plain executable.

Some of the trouble is no doubt that I have been muddling around with emacs and 
gcc in various kinds of Cygwin, MinGW, MSYS2, and WSL, rather than committing to 
learning Visual Studio and its ecosystem.

The test vectors I developed using the user mode "Compression API" appear to 
work (by which I mean they flatter my implementation) for strings between 301 
and 64k in size, inclusive, so long as the input is not so random as to be 
uncompressible. Excerpts from /dev/urandom (for example) are returned unchanged 
by this API.

With regard to the >64k inputs, these are possibly relevant to another question 
("[MS-XCA] LZ77+ Huffman: questions about blocks - TrackingID#2210140040006030",
https://lists.samba.org/archive/cifs-protocol/2022-October/003796.html). The 
other inconsistencies are where the Compression API diverges from MS-XCA.


More information about the cifs-protocol mailing list