Skip to content

Navigation Menu

Sign in
Sign up

Fix WOF handle access and DeviceIoControl error handling - #100

Open
wefalltomorrow wants to merge 1 commit into
Freaky:master from
wefalltomorrow:upstream/wof-correctness
Open

Fix WOF handle access and DeviceIoControl error handling #100
wefalltomorrow wants to merge 1 commit into
Freaky:master from
wefalltomorrow:upstream/wof-correctness

Conversation

@wefalltomorrow

@wefalltomorrow wefalltomorrow commented Sep 7, 2026
edited
Loading

Copy link
Copy Markdown

Summary

Fix the low-level WOF compression/decompression calls so Win32 return values and errors are handled correctly.

Changes

Treat DeviceIoControl as returning a Win32 BOOL, rather than passing its result to SUCCEEDED() as though it were an HRESULT.
Read the actual Win32 error with last_os_error() when DeviceIoControl fails.
Continue treating ERROR_COMPRESSION_NOT_BENEFICIAL as a normal no-benefit result rather than a hard error.
Open WOF targets with FILE_READ_DATA | FILE_WRITE_ATTRIBUTES, which are the access rights required by these WOF operations.
Apply the same corrected BOOL handling to removal of external backing.

These fixes are already used in my maintained fork and are included in v0.11.2:
https://github.com/wefalltomorrow/Compactor/releases/tag/v0.11.2

I’m splitting the fork improvements into focused upstream PRs rather than submitting the full fork diff at once; this PR is intentionally limited to the low-level WOF path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /