Role of LZ32.DLL in Windows 95 Setup

During the installation of Windows 95, storage space was at a premium, requiring installation media such as floppy disks and CD-ROMs to hold tightly compressed system archives. The LZ32.DLL dynamic-link library served as the foundational 32-bit decompression engine during the graphical phase of Windows 95 setup, allowing the installer to extract operating system components on the fly without consuming excessive memory or CPU cycles.

Before Windows 95, setup programs operated primarily under 16-bit MS-DOS or 16-bit Windows environments, relying on utilities like EXPAND.EXE or LZEXPAND.DLL. With the architectural shift toward a 32-bit protected-mode operating system, Microsoft needed a robust 32-bit API that could unpack system files while the setup engine ran in protected mode. LZ32.DLL fulfilled this role by exposing 32-bit Win32 decompression APIs, including LZOpenFile, LZCopy, LZRead, and LZClose.

Files distributed on Windows 95 media often featured compressed extensions ending in underscores (such as .EX_ or .DL_) or were packed using variants of the Lempel-Ziv (LZ) compression algorithm, notably LZX and Microsoft's proprietary LZ compression formats. When LZ32.DLL opened a source file, it inspected the header for internal signatures—such as the standard SZDD magic number. If the signature was present, the library automatically detected the compression format, read the ring buffer parameters, and decoded the data stream directly to the target destination path without requiring the caller to manually parse compression headers.

The performance of LZ32.DLL was critical to reducing total installation times. Running in 32-bit flat memory space allowed the DLL to take advantage of larger buffer sizes and 32-bit register operations. This made the stream-based decompression process significantly faster than real-mode DOS equivalents, preventing I/O bottlenecks when writing thousands of files to the newly formatted hard drive.

Furthermore, LZ32.DLL provided graceful handling for uncompressed files. If a component on the installation media was already raw and uncompressed, the library transparently fell back to standard file-copy routines using the same API calls. This abstraction simplified the Windows 95 setup engine, enabling a single unified pipeline to process every file on the installation disk. Once setup was complete, LZ32.DLL remained in the System32 directory as a permanent OS component, maintaining backward compatibility for third-party application installers that relied on standard Windows decompression services.