| title | Compress Function |
|---|---|
| description | Learn how the Compress function compresses data given the compression context, input buffer, output buffer, and compression level. |
| ms.date | 10/07/2016 |
| ms.assetid | 254d5fc4-8abd-4410-84e3-d7f13ee6cd68 |
Compresses data given the compression context, input buffer, output buffer, and compression level.
HRESULT WINAPI Compress(
IN OUT PVOID context,
IN CONST BYTE* input_buffer,
IN LONG input_buffer_size,
IN PBYTE output_buffer,
IN LONG output_buffer_size,
OUT PLONG input_used,
OUT PLONG output_used,
IN INT compression_level
); context
[IN][OUT] Pointer to the new compression context.
input_buffer
[IN] Pointer to the input buffer.
input_buffer_size
[IN] The size of the input buffer.
output_buffer
[IN] Pointer to the output buffer.
output_buffer_size
[IN] Size of the output buffer.
input_used
[IN] Amount of input buffer used.
output_used
[OUT] Amount of output buffer used.
compression_level
[IN] Compression level (1…10).
An HRESULT. Possible values include, but are not limited to, those in the following table.
| Value | Description |
|---|---|
| S_OK | Indicates that the operation was successful. |
When used with IIS, this method is called repeatedly until all the data required to fulfill the request is compressed.
| Type | Description |
|---|---|
| Client | - IIS 7.0 on [!INCLUDEwinvista] - IIS 7.5 on Windows 7 - IIS 8.0 on Windows 8 - IIS 10.0 on Windows 10 |
| Server | - IIS 7.0 on [!INCLUDEwinsrv2008] - IIS 7.5 on Windows Server 2008 R2 - IIS 8.0 on Windows Server 2012 - IIS 8.5 on Windows Server 2012 R2 - IIS 10.0 on Windows Server 2016 |
| Product | - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0 - [!INCLUDEiisexp75], [!INCLUDEiisexp80], [!INCLUDEiisexp100] |
| Header | Httpcompression.h |