Takes a block of information and compresses it.
BOOL Compress( COMPRESSOR_HANDLE CompressorHandle, LPCVOID UncompressedData, SIZE_T UncompressedDataSize, PVOID CompressedBuffer, SIZE_T CompressedBufferSize, PSIZE_T CompressedDataSize );
Handle to a compressor returned by CreateCompressor.
Contains the block of information that is to be compressed. The size in bytes of the uncompressed block is given by UncompressedDataSize.
Size in bytes of the uncompressed information.
The buffer that receives the compressed information. The maximum size in bytes of the buffer is given by CompressedBufferSize.
Maximum size in bytes of the buffer that receives the compressed information.
Actual size in bytes of the compressed information received.
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.
If the compression algorithm fails for some internal reason, the error from GetLastError can be ERROR_FUNCTION_FAILED. If the system cannot locate the compression algorithm handle, the error can be ERROR_INVALID_HANDLE. If the output buffer is too small to hold the compressed data, the error can be ERROR_INSUFFICIENT_BUFFER.
If CompressedBuffer output buffer is too small to hold the compressed data, the function fails and the error from GetLastError can be ERROR_INSUFFICIENT_BUFFER. In this case, the CompressedDataSize parameter receives with the size that the CompressedBuffer needs to be to guarantee success for that input buffer. You can set CompressedBufferSize to zero to determine the size of the output buffer to allocate.