GetExpandedNameA function

Retrieves the original name of a compressed file, if the file was compressed by the Lempel-Ziv algorithm.


INT GetExpandedNameA(
  LPSTR lpszSource,
  LPSTR lpszBuffer



The name of the compressed file.


A pointer to a buffer that receives the original name of the compressed file.

Return Value

If the function succeeds, the return value is 1.

If the function fails, the return value is LZERROR_BADVALUE. There is no extended error information for this function; do not call GetLastError.

Note  GetExpandedName calls neither SetLastError nor SetLastErrorEx; thus, its failure does not affect a thread's last-error code.


The contents of the buffer pointed to by the lpszBuffer parameter is the original file name if the file was compressed by using the /r option. If the /r option was not used, this function duplicates the name in the lpszSource parameter into the lpszBuffer buffer.

In Windows 8 and Windows Server 2012, this function is supported by the following technologies.

Technology Supported
Server Message Block (SMB) 3.0 protocol Yes
SMB 3.0 Transparent Failover (TFO) Yes
SMB 3.0 with Scale-out File Shares (SO) Yes
Cluster Shared Volume File System (CsvFS) Yes
Resilient File System (ReFS) Yes


Windows version Windows XP [desktop apps only] Windows Server 2003 [desktop apps only]
Target Platform Windows
Header lzexpand.h (include Windows.h)
Library Lz32.lib
DLL Lz32.dll

See Also

File Compression and Decompression

File Management Functions