Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9047515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:55:47+00:00 2026-06-16T11:55:47+00:00

Note: this question is about the Windows LZ functions, which are File Management Functions

  • 0

Note: this question is about the Windows LZ functions, which are File Management Functions beginning with the prefix LZ: LZOpenFile, LZCopy, LZClose, etc. If Google isn’t wrong, these are probably among the most poorly documented functions of the Windows API.

I’m trying to figure out what kind of files are actually suited for usage with the Windows LZ functions.
The official documentation mentions “data that was compressed using Compress.exe”, but the functions are also able to handle uncompressed files, in which case no decompression is applied.

Now, when I compress a file with the compress.exe utility from the resource kit (using either the -Z or -ZX switches), and then decompress it using the procedure described here, all I get is the source file unchanged, as if it were not compressed as expected. Even with a compressed file from the original Windows XP setup CD (those named with an underscore at the end in the i386 folder), I get the same result.
Conclusion: no matter what file I try to decompress, I get it back unchanged.

The code I’m using is pretty straightforward, it basically reproduces the steps described in the MSDN article, so if I have a bug, I guess it must be somewhere else. But I’m still prone to thinking I’m just using the wrong input files. Does anyone have any experience with those LZ functions already? Here’s my code in C++.

#include <iostream>
#include <Windows.h>

using namespace std;

int main(int argc, char ** argv) {
    OFSTRUCT ofs1, ofs2;
    INT hfSrc = -1, hfDest = -1;

    if (argc <= 2) {
        cerr << "Usage: LZTEST Source Destination";
        return 1;
    }
    __try {
        hfSrc = LZOpenFile(argv[1], &ofs1, OF_READ);
        if (hfSrc < 0) {
            cerr << "Error invoking LZOpenFile on source file: " << hfSrc;
            return 1;
        }
        hfDest = LZOpenFile(argv[2], &ofs2, OF_CREATE);
        if (hfDest < 0) {
            cerr << "Error invoking LZOpenFile on destination file: " << hfDest;
            return 1;
        }
        INT result = LZCopy(hfSrc, hfDest);
        if (result < 0) {
            cerr << "Error invoking LZCopy: " << result;
            return 1;
        }
    } __finally {
        if (hfSrc >= 0) LZClose(hfSrc);
        if (hfDest >= 0) LZClose(hfDest);
    }
    cout << "Success";
    return 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T11:55:49+00:00Added an answer on June 16, 2026 at 11:55 am

    Try the compress.exe here with no options.

    Unless you need to uncompress some old files, use DotNetZip instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

NOTE: This question is not about MFC/CRT DLL linking with/without .manifest file, avoiding manifest-lookup
Please note: This is a question about the Eclipse plugin Subversive , and not
(Note: This is not a question about what is the best way with code
(note that this question is not about CAS, it's about the May fail spuriously
Note: I originally asked this question about an hour ago but only recently realized
Note: this question has nothing to do with Knockout.js, but it's about the selectedOptions
Please note this is not a question about online/hosted SVN services. I am working
This question is about limits imposed to me by ASP.NET (like script timeout etc').
Note: This is a question about simulating the Browser on the iPhone, not simulating
Note: This question is about pasting from the clipboard, not copying to the clipboard.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.