ExpandBuffer Function  
 
BOOL WINAPI ExpandBuffer(
  LPVOIDlpvInputBuffer,  
  DWORD cbInputBuffer  
  LPVOIDlpvOutputBuffer,  
  LPDWORD lpcbOutputBuffer  
);

The ExpandBuffer function expands the contents of the previously compressed buffer.

Parameters

lpvInputBuffer
A pointer to the buffer which contains the compressed data.
cbInputBuffer
The number of bytes in the input buffer. This value must be greater than zero.
lpvOutputBuffer
A pointer to the buffer which will contain the expanded data. This parameter may be NULL, which can be used to determine the size of the of the resulting expanded data prior to allocating memory for it.
lpcbOutputBuffer
A pointer to the number of bytes that may be copied into the output buffer. If the lpvOutputBuffer parameter is not NULL, this must be initialized to a non-zero value. When the function returns, the actual number of bytes of expanded data is returned in this parameter.

Return Value

A non-zero value is returned if the data was successfully expanded. A zero value indicates that the data could not be expanded. Failure typically indicates that the compressed data was not in a recognized format.

Remarks

The compressed data buffer passed to the ExpandBuffer function must have been compressed by either the CompressBuffer or CompressFile functions. Data read from files that were compressed using third-party utilities such as WinZip will not be recognized by this function.

Example

cbOutputBuffer = 0;
bResult = ExpandBuffer(lpInputBuffer,
                         cbInputBuffer,
                         NULL,
                         &cbOutputBuffer);

if (bResult)
{
    lpOutputBuffer = (LPBYTE)LocalAlloc(LPTR, cbOutputBuffer);
    bResult = ExpandBuffer(lpInputBuffer,
                             cbInputBuffer,
                             lpOutputBuffer,
                             &cbOutputBuffer);
}
      

Requirements

Client: Requires Windows 7, Windows Vista or Windows XP.
Server: Requires Windows Server 2008 or Windows Server 2003.
Header: Include cstools7.h.
Library: Use csncdav7.lib.
Unicode: Implemented as Unicode and ANSI versions.

See Also

CompressBuffer, CompressFile, DecodeFile, EncodeFile, ExpandFile