]> wimlib.net Git - wimlib/log
9 years agoRemove some dead assignments
Eric Biggers [Sun, 8 Jun 2014 03:43:00 +0000 (22:43 -0500)]
Remove some dead assignments

9 years agomount_image.c: Don't pass NULL to mq_send()
Eric Biggers [Sun, 8 Jun 2014 03:28:30 +0000 (22:28 -0500)]
mount_image.c: Don't pass NULL to mq_send()

9 years agoxpress-decompress.c: Remove unused 'lens' parameter to xpress_lz_decode()
Eric Biggers [Sun, 8 Jun 2014 03:25:37 +0000 (22:25 -0500)]
xpress-decompress.c: Remove unused 'lens' parameter to xpress_lz_decode()

9 years agowimboot.c, win32_apply.c: Bracket file by #ifdef __WIN32__
Eric Biggers [Sun, 8 Jun 2014 03:16:16 +0000 (22:16 -0500)]
wimboot.c, win32_apply.c:  Bracket file by #ifdef __WIN32__

This makes compiling all non-Windows source files manually (e.g. with
clang-scan-build.sh) easier.

9 years agodecompress_common.c: Add util.h back
Eric Biggers [Sun, 8 Jun 2014 03:15:38 +0000 (22:15 -0500)]
decompress_common.c: Add util.h back

9 years agoUpdate date
Eric Biggers [Sun, 8 Jun 2014 02:36:31 +0000 (21:36 -0500)]
Update date

9 years agolzms-compress.c: Don't underrun window when checking recent offsets
Eric Biggers [Sun, 8 Jun 2014 02:32:06 +0000 (21:32 -0500)]
lzms-compress.c: Don't underrun window when checking recent offsets

In LZMS, not all recent offsets are initialized to 1, unlike in LZX.

9 years agoA few comment fixes
Eric Biggers [Sun, 8 Jun 2014 02:30:10 +0000 (21:30 -0500)]
A few comment fixes

9 years agoRemove a few unnecessary includes
Eric Biggers [Sun, 8 Jun 2014 02:28:22 +0000 (21:28 -0500)]
Remove a few unnecessary includes

9 years agoUpdate public domain dedications
Eric Biggers [Sun, 8 Jun 2014 01:04:23 +0000 (20:04 -0500)]
Update public domain dedications

9 years agowimexport: Document --wimboot option
Eric Biggers [Sat, 7 Jun 2014 22:31:51 +0000 (17:31 -0500)]
wimexport: Document --wimboot option

9 years agowimextract: Rename --no-wildcards to --no-globs; update man page
Eric Biggers [Sat, 7 Jun 2014 22:09:11 +0000 (17:09 -0500)]
wimextract: Rename --no-wildcards to --no-globs; update man page

9 years agowimextract: Suggest --nullglob
Eric Biggers [Sat, 7 Jun 2014 21:54:33 +0000 (16:54 -0500)]
wimextract: Suggest --nullglob

9 years agoUpdate NEWS
Eric Biggers [Sat, 7 Jun 2014 21:48:32 +0000 (16:48 -0500)]
Update NEWS

9 years agolzx-compress.c: Honor cache_limit
Eric Biggers [Sat, 7 Jun 2014 21:46:39 +0000 (16:46 -0500)]
lzx-compress.c:  Honor cache_limit

This ensures the match cache is never overrun.  If for some reason we
average more than LZX_CACHE_PER_POS (currently 8) matches per position,
_excluding skipped positions_, just don't return any more matches.

9 years agoMerge branch 'lz_bt'
Eric Biggers [Sat, 7 Jun 2014 21:34:14 +0000 (16:34 -0500)]
Merge branch 'lz_bt'

9 years agoSwitch from suffix array match-finder to binary tree match-finder
Eric Biggers [Mon, 2 Jun 2014 03:01:14 +0000 (22:01 -0500)]
Switch from suffix array match-finder to binary tree match-finder

This uses less memory (8 bytes overhead per position vs. 14), is faster,
requires less code (no libdivsufsort), and in some tests actually results
in a better compression ratio.

A binary tree match-finder was used in wimlib v1.5.2 but it didn't seem
as good then, probably because it was combined with a slow block division
algorithm for LZX.

Repeat offsets are now handled differently.  The binary tree match-finder
itself doesn't have any logic for repeat offsets at all; instead, the
match-choosing code (now implemented separately for LZX and LZMS) now
does special checks for matches at repeat offsets.

Since less memory is used for match-finding now, increase the default
LZMS pack chunk size from 2^25 (33554432) to 2^26 (67108864).

9 years agolzms-common.c, lzms-compress.c: Use pthread_once()
Eric Biggers [Thu, 5 Jun 2014 13:10:18 +0000 (08:10 -0500)]
lzms-common.c, lzms-compress.c:  Use pthread_once()

9 years agoFix creating large solid blocks
Eric Biggers [Thu, 5 Jun 2014 03:19:18 +0000 (22:19 -0500)]
Fix creating large solid blocks

Dumb bug that only appeared when at least 4 GiB of data was being

9 years agolzms-compress.c: Fix typo
Eric Biggers [Wed, 4 Jun 2014 02:09:19 +0000 (21:09 -0500)]
lzms-compress.c: Fix typo

9 years agoShare most e8 processing code between LZX compressor and decompressor
Eric Biggers [Sun, 1 Jun 2014 20:42:02 +0000 (15:42 -0500)]
Share most e8 processing code between LZX compressor and decompressor

9 years agolzx-compress.c: Clarify there must be at least one optimization pass
Eric Biggers [Sun, 1 Jun 2014 13:31:50 +0000 (08:31 -0500)]
lzx-compress.c: Clarify there must be at least one optimization pass

9 years agolzx-compress.c: Use pointers in lzx_optimize_block()
Eric Biggers [Sun, 1 Jun 2014 13:25:55 +0000 (08:25 -0500)]
lzx-compress.c:  Use pointers in lzx_optimize_block()

This makes the performance less reliant on the compiler recognizing that
the 'struct lzx_block_spec' does not change throughout the loop.

9 years agoinode_fixup.c: Fix check for directory hard links
Eric Biggers [Sat, 31 May 2014 15:12:28 +0000 (10:12 -0500)]
inode_fixup.c: Fix check for directory hard links

We shouldn't assume that the attributes are consistent, so we should
check both ways for directory hard links.  Specifically, in the case
where the being-inserted dentry is not marked as a directory but for some
reason it shares an inode number with a dentry marked as a directory, we
want to detect that as a directory hard link.

9 years agoOptimize Huffman code generation
Eric Biggers [Thu, 29 May 2014 05:42:54 +0000 (00:42 -0500)]
Optimize Huffman code generation

This commit significantly improves the performance of length-limited
canonical Huffman code generation by introducing several optimizations
based on the 7-Zip implementation.

Altlhough Huffman code generation is not the main bottleneck of any of
the compression algorithms implemented here, an optimized implementation
can still improve overall performance by several percent.  In addition,
it significantly speeds up LZMS decompression, which requires frequent
rebuilding of adaptive Huffman codes.

Some peformance comparisons:

    - The average time taken to generate all three LZX codes (main,
      length, and aligned offset) when compressing a Windows PE
      filesystem with LZX decreased from 73.9 us to 17.3 us.

    - The time taken to compress a Windows PE filesystem with LZX, using
      the "fast" LZX algorithm (hash chain match finder and lazy
      parsing), decreased from 12.3 s to 11.6 s (a 5.7% improvement).

    - The time taken to decompress a Windows PE filesystem with LZMS,
      using solid blocks, decreased from 12.3 s to 9.0 s (a 27%

9 years agoRevert "lzx-compress.c: Simplify calculation of position footer"
Eric Biggers [Sat, 31 May 2014 00:34:34 +0000 (19:34 -0500)]
Revert "lzx-compress.c: Simplify calculation of position footer"

This reverts commit 3adc1ac1ebe221427857d8f6fd06cfb823b4bea6.

If the position footer is unconditionally calculated as the match offset
minus the position base value, the (ultimately unused) position footer
for repeat matches can overflow the number of bits in which it is stored
in the intermediate representation used by this implementation.  For now,
use the old version, which would set the position footers of repeat
matches to 0.

9 years agolzx-compress.c: Simplify output of length footer
Eric Biggers [Thu, 29 May 2014 00:16:33 +0000 (19:16 -0500)]
lzx-compress.c: Simplify output of length footer

9 years agolzx-compress.c: Simplify calculation of position footer
Eric Biggers [Thu, 29 May 2014 00:05:19 +0000 (19:05 -0500)]
lzx-compress.c: Simplify calculation of position footer

9 years agolzx-decompress.c: Simplify handling of recent offsets
Eric Biggers [Wed, 28 May 2014 15:44:03 +0000 (10:44 -0500)]
lzx-decompress.c: Simplify handling of recent offsets

The recent offsets can all be handled by the same code.  This should
remove at least one branch from the generated code.

9 years agoRemove unused 'num_syms' argument to read_huffsym()
Eric Biggers [Wed, 28 May 2014 00:20:31 +0000 (19:20 -0500)]
Remove unused 'num_syms' argument to read_huffsym()

The updated decoder no longer requires that the number of symbols in the
alphabet be provided when decoding each symbol.

9 years agoFaster Huffman symbol decoding
Eric Biggers [Tue, 27 May 2014 21:51:24 +0000 (16:51 -0500)]
Faster Huffman symbol decoding

When decoding a codeword short enough for a direct mapping, we can read
the codeword length at the same time we read the symbol itself.  This
speeds up Huffman decoding slightly.

This commit also updates and improves the comments for

9 years agolzx-decompress.c: One fewer branch in undo_call_insn_translation()
Eric Biggers [Tue, 27 May 2014 16:23:22 +0000 (11:23 -0500)]
lzx-decompress.c:  One fewer branch in undo_call_insn_translation()

9 years agoLZX, XPRESS decompression: Return 0 bits on overrun
Eric Biggers [Tue, 27 May 2014 16:03:07 +0000 (11:03 -0500)]
LZX, XPRESS decompression:  Return 0 bits on overrun

If the compressed data is invalid such that the compressed data buffer is
overrun, it's simpler to just return 0 bits instead of explicitly
checking the return value at every call site of bitstream_read_bits() and

This doesn't necessarily mean that invalid data will go undetected.  Just
for LZX decompression, chances are there will be another problem if all
0's start being returned (e.g. invalid match or invalid Huffman tree).
For WIM operations like extraction, the uncompressed data is checked with
SHA-1 message digests anyway, so it's virtually impossible for corruption
to go undetected.

Also, the LZMS decompressor already does this.

9 years agolzx-decompress.c: Add SSE2 version of undo_call_insn_preprocessing()
Eric Biggers [Tue, 27 May 2014 14:28:59 +0000 (09:28 -0500)]
lzx-decompress.c:  Add SSE2 version of undo_call_insn_preprocessing()

9 years agoresource.c: Fix two comments
Eric Biggers [Tue, 27 May 2014 02:25:29 +0000 (21:25 -0500)]
resource.c: Fix two comments

9 years agoresource.c: Don't call lseek() if not necessary
Eric Biggers [Tue, 27 May 2014 02:22:23 +0000 (21:22 -0500)]
resource.c:  Don't call lseek() if not necessary

To be reading a pipable resource from a pipe, is_pipable must be set in
the 'struct wim_resource_spec', so check that first before calling

9 years agoextract.c: Remove unused internal flag
Eric Biggers [Tue, 27 May 2014 01:51:24 +0000 (20:51 -0500)]
extract.c: Remove unused internal flag

9 years agoUpdate NEWS
Eric Biggers [Mon, 26 May 2014 23:39:12 +0000 (18:39 -0500)]
Update NEWS

9 years agoxml.c: Export <ARCH> and <WIMBOOT> nodes correctly
Eric Biggers [Mon, 26 May 2014 23:31:03 +0000 (18:31 -0500)]
xml.c: Export <ARCH> and <WIMBOOT> nodes correctly

The XML data still needs to be handled better in general, but this fixes
the bug that this information was missing from clone_image_info().

9 years agoCheck for case where too many identical files are being extracted
Eric Biggers [Mon, 26 May 2014 22:52:58 +0000 (17:52 -0500)]
Check for case where too many identical files are being extracted

Hoping to add a real fix for this, but for now at least avoid the buffer
overflow in UNIX and NTFS-3g extraction modes.

9 years agomount_image.c: Don't use tchar when not necessary
Eric Biggers [Mon, 26 May 2014 21:21:47 +0000 (16:21 -0500)]
mount_image.c:  Don't use tchar when not necessary

9 years agomount_image.c: Add error.h outside WITH_FUSE conditional
Eric Biggers [Mon, 26 May 2014 21:09:38 +0000 (16:09 -0500)]
mount_image.c: Add error.h outside WITH_FUSE conditional

9 years agoFix file locking
Eric Biggers [Mon, 26 May 2014 20:42:50 +0000 (15:42 -0500)]
Fix file locking

- Lock in_fd only
- Unlock WIM immediately after commiting mounted image (before
  fuse_main() returns)
- Don't lock WIM for read-only mount

9 years agotest-imagex-mount: Always use tmp.mnt for mounts
Eric Biggers [Mon, 26 May 2014 16:35:23 +0000 (11:35 -0500)]
test-imagex-mount: Always use tmp.mnt for mounts

9 years agomount_image.c: Use setxattr wimfs.unmount_info, getxattr wimfs.unmount
Eric Biggers [Mon, 26 May 2014 15:32:42 +0000 (10:32 -0500)]
mount_image.c:  Use setxattr wimfs.unmount_info, getxattr wimfs.unmount

This lets us return the unmount status directly, instead of sending it
over the message queue (which is subject to problems, like it being

Also, if commit fails, leave the image mounted, unless doing a forced

9 years agomount_image.c: Fix comment
Eric Biggers [Mon, 26 May 2014 14:35:10 +0000 (09:35 -0500)]
mount_image.c: Fix comment

9 years agoinode.h: Fix comment
Eric Biggers [Mon, 26 May 2014 14:25:55 +0000 (09:25 -0500)]
inode.h: Fix comment

9 years agoRemove references to libwim9
Eric Biggers [Mon, 26 May 2014 14:12:38 +0000 (09:12 -0500)]
Remove references to libwim9

9 years agoRevert "lzx-compress.c: Disable verification by default"
Eric Biggers [Mon, 26 May 2014 14:06:52 +0000 (09:06 -0500)]
Revert "lzx-compress.c:  Disable verification by default"

This reverts commit 5448b9cd60e9b1ebf4efcd2d1b2aac346b2e829c.

Switched from libdivsufsort to libdivsufsort-lite; should be the same,
but just in case I'm leaving verification on for the "slow" algorithm.

9 years agotagged_items.c: Include header size when searching items
Eric Biggers [Mon, 26 May 2014 14:01:20 +0000 (09:01 -0500)]
tagged_items.c: Include header size when searching items

9 years agoTrack divsufsort.h
Eric Biggers [Mon, 26 May 2014 05:28:04 +0000 (00:28 -0500)]
Track divsufsort.h

9 years agoUse libdivsufsort-lite, not the full libdivsufsort
Eric Biggers [Mon, 26 May 2014 05:15:16 +0000 (00:15 -0500)]
Use libdivsufsort-lite, not the full libdivsufsort

9 years agoRemove xattr configuration option
Eric Biggers [Mon, 26 May 2014 04:47:24 +0000 (23:47 -0500)]
Remove xattr configuration option

9 years agolzx-compress.c: Disable verification by default
Eric Biggers [Mon, 26 May 2014 04:41:18 +0000 (23:41 -0500)]
lzx-compress.c:  Disable verification by default

The algorithm seems to be sufficiently well tested now.  And the data is
checked with SHA-1 message digests anyway.  This slightly improves LZX
compression performance.

9 years agodentry.h: Remove unneeded forwards declarations
Eric Biggers [Mon, 26 May 2014 04:28:57 +0000 (23:28 -0500)]
dentry.h: Remove unneeded forwards declarations

9 years agoMove wim_pathname_to_stream() to mount_image.c
Eric Biggers [Mon, 26 May 2014 04:21:05 +0000 (23:21 -0500)]
Move wim_pathname_to_stream() to mount_image.c

9 years agoRemove unused function lte_filename_valid()
Eric Biggers [Mon, 26 May 2014 04:04:20 +0000 (23:04 -0500)]
Remove unused function lte_filename_valid()

9 years agostruct wim_dentry: Union subdir_offset and tmp_list
Eric Biggers [Mon, 26 May 2014 03:44:04 +0000 (22:44 -0500)]
struct wim_dentry:  Union subdir_offset and tmp_list

9 years agostruct wim_dentry: Remove 'length' field
Eric Biggers [Mon, 26 May 2014 03:40:49 +0000 (22:40 -0500)]
struct wim_dentry: Remove 'length' field

9 years agostruct wim_dentry: Rename 'parent' to 'd_parent'
Eric Biggers [Mon, 26 May 2014 03:13:39 +0000 (22:13 -0500)]
struct wim_dentry: Rename 'parent' to 'd_parent'

9 years agomount_image.c: Update directory timestamps
Eric Biggers [Mon, 26 May 2014 03:07:15 +0000 (22:07 -0500)]
mount_image.c: Update directory timestamps

9 years agoRemove unused error codes
Eric Biggers [Sun, 25 May 2014 18:47:10 +0000 (13:47 -0500)]
Remove unused error codes

9 years agoExplicitly declare error code numbers
Eric Biggers [Sun, 25 May 2014 18:39:53 +0000 (13:39 -0500)]
Explicitly declare error code numbers

9 years agoUpdate mount implementation
Eric Biggers [Sat, 24 May 2014 02:43:19 +0000 (21:43 -0500)]
Update mount implementation

- Improve comments and documentation
- Speed up fd allocation by tracking lower bound on next available slot
- Open staging files by directory-relative names
- Simplify, and hopefully improve, how unmounting images works.

9 years agowin32_apply.c: Fix extraction of non-WIMBoot files in WIMBoot mode
Eric Biggers [Sun, 25 May 2014 12:20:31 +0000 (07:20 -0500)]
win32_apply.c: Fix extraction of non-WIMBoot files in WIMBoot mode

9 years agoReport progress for capture symlink fixups
Eric Biggers [Fri, 23 May 2014 15:32:37 +0000 (10:32 -0500)]
Report progress for capture symlink fixups

wimcapture: On non-Windows, warn when the target of an absolute symbolic
link is adjusted.

9 years agoextract.c: Warn when UNIX metadata is not being extracted
Eric Biggers [Fri, 23 May 2014 15:05:01 +0000 (10:05 -0500)]
extract.c: Warn when UNIX metadata is not being extracted

9 years agoAdd support for special files on UNIX
Eric Biggers [Fri, 23 May 2014 14:58:19 +0000 (09:58 -0500)]
Add support for special files on UNIX

9 years agoUpdate version: v1.7.0-BETA
Eric Biggers [Fri, 23 May 2014 05:42:14 +0000 (00:42 -0500)]
Update version: v1.7.0-BETA

There are too many changes to call the next release 1.6.3.

9 years agoRecognize tagged metadata items and use for UNIX data
Eric Biggers [Fri, 23 May 2014 01:39:31 +0000 (20:39 -0500)]
Recognize tagged metadata items and use for UNIX data

This is undocumented, but the Microsoft implementation seems to allow
variable-length, tagged metadata items to be appended to WIM dentries.
Currently it uses them for Object IDs, which DISM (Windows 8.1) will
backup and restore by default.

This commit adds support for these items, so they can be read and written

In addition, for our UNIX data extension, instead of storing the UNIX
data in the reserved fields of the dentry or in alternate data streams,
store it in a custom tagged item with a randomly chosen tag.  This is
perhaps the best choice compatibility-wise.

9 years agosplit.c: Allow customizing part names
Eric Biggers [Thu, 22 May 2014 20:40:10 +0000 (15:40 -0500)]
split.c: Allow customizing part names

9 years agowin32_capture.c: Remove unused 'struct winnt_scan_stats' member
Eric Biggers [Thu, 22 May 2014 20:17:59 +0000 (15:17 -0500)]
win32_capture.c: Remove unused 'struct winnt_scan_stats' member

9 years agoupdate_image.c: Fix call to progress function in handle_conflict()
Eric Biggers [Thu, 22 May 2014 19:28:39 +0000 (14:28 -0500)]
update_image.c:  Fix call to progress function in handle_conflict()

journaled_link() needs to be last because it commits the branch.

Also, it's supposed to check WIMLIB_ADD_FLAG_VERBOSE.

9 years agowin32_apply.c: Allocate space just before writing each stream
Eric Biggers [Thu, 22 May 2014 19:16:01 +0000 (14:16 -0500)]
win32_apply.c:  Allocate space just before writing each stream

This seems to give better performance compared to allocating space when
each file is created.

9 years agowin32_apply.c: Fallback to RtlDosPathNameToNtPathName_U()
Eric Biggers [Thu, 22 May 2014 16:53:38 +0000 (11:53 -0500)]
win32_apply.c: Fallback to RtlDosPathNameToNtPathName_U()

RtlDosPathNameToNtPathName_U_WithStatus() is not available on Windows XP.

9 years agowin32_apply.c: Fix error message
Eric Biggers [Thu, 22 May 2014 16:53:35 +0000 (11:53 -0500)]
win32_apply.c: Fix error message

9 years agowin32_apply.c: Use sizeof(wchar_t)
Eric Biggers [Thu, 22 May 2014 16:52:58 +0000 (11:52 -0500)]
win32_apply.c: Use sizeof(wchar_t)

9 years agoUpdate progress functions
Eric Biggers [Thu, 22 May 2014 15:50:47 +0000 (10:50 -0500)]
Update progress functions

- Register progress function with WIM instead of explicitly specifying it
  with each function call
- Add support for user-supplied context
- Add support for aborting the current operation by returning a status
  from the progress function

9 years agowimlib-imagex: Return --unix-data to help output
Eric Biggers [Thu, 22 May 2014 04:01:44 +0000 (23:01 -0500)]
wimlib-imagex: Return --unix-data to help output

9 years agoNew format for UNIX data
Eric Biggers [Thu, 22 May 2014 03:21:20 +0000 (22:21 -0500)]
New format for UNIX data

This moves the UNIX data into reserved fields of the WIM dentry.

This is theoretically less extensible than the previous format, which was
to add a specially-named alternate data stream entry to each file with
UNIX data.  However, having the UNIX data present in the metadata
resource is simpler and avoids problems when doing sequential extraction.

For now, this also seems to maintain compatibility with the MS
implementation, since it seems simply ignore the reserve fields.

Also, use 32-bit uids, gids, and modes.

9 years agoFix path passed to wimboot_set_pointer()
Eric Biggers [Thu, 22 May 2014 02:26:10 +0000 (21:26 -0500)]
Fix path passed to wimboot_set_pointer()

9 years agowimexport: Add --wimboot flag
Eric Biggers [Thu, 22 May 2014 02:21:44 +0000 (21:21 -0500)]
wimexport: Add --wimboot flag

9 years agoFix extract progress when hard links not supported
Eric Biggers [Thu, 22 May 2014 01:53:13 +0000 (20:53 -0500)]
Fix extract progress when hard links not supported

9 years agoMerge branch 'new_extract'
Eric Biggers [Mon, 19 May 2014 17:05:11 +0000 (12:05 -0500)]
Merge branch 'new_extract'

This rewrites much of the extraction code to give more freedom to
extraction backends about how they extract the files.  This has
advantages for all three backends:

UNIX:  Now does a lot fewer path lookups and should exhibit better data
locality.  Final "set timestamps" pass only processes directories, since
nondirectory timestamps are set before that point.

NTFS-3g:  Now completely based on inode numbers; no paths are ever
created, unless a printable path is needed for an error message.  Got rid
of final "set attributes" and "set timestamps" passes, since all
attributes and timestamps are set before that point.

Windows:  Now uses NT paths relative to the target directory, performs
fewer path lookups, extracts encrypted files without individually reading
ranges from the WIM (expensive for ESD files), and a few other changes.
A lot of code previously in the generic file extract.c actually could be
moved here.

Also, there are no longer any temporary files needed.  All three backends
simply write all the instances of each stream at the same time, which is
more efficient.

Still TODO:
- New format for UNIX data
- Add fallbacks for when number of open files gets too high
- Add fallback for huge encrypted files
- If possible add hardlink and symlink modes back, however these
  are pretty useless.

9 years agostreamifier_cb(): Adjust cur_stream_offset even if ->consume_chunk() fails
Eric Biggers [Wed, 21 May 2014 20:09:13 +0000 (15:09 -0500)]
streamifier_cb(): Adjust cur_stream_offset even if ->consume_chunk() fails

This ensures that ->end_stream() gets called.

9 years agodentry.h: Remove unnused declaration of put_dentry()
Eric Biggers [Sun, 18 May 2014 20:49:54 +0000 (15:49 -0500)]
dentry.h: Remove unnused declaration of put_dentry()

9 years agometadata.h: Parenthesize 'imd' argument to macros
Eric Biggers [Sun, 18 May 2014 20:33:53 +0000 (15:33 -0500)]
metadata.h: Parenthesize 'imd' argument to macros

9 years agoDon't set FILE_ATTRIBUTE_SPARSE on Windows
Eric Biggers [Sun, 18 May 2014 05:43:24 +0000 (00:43 -0500)]
Don't set FILE_ATTRIBUTE_SPARSE on Windows

9 years agowinnt_openat(): Use FILE_SHARE_VALID_FLAGS
Eric Biggers [Sun, 18 May 2014 02:54:22 +0000 (21:54 -0500)]
winnt_openat(): Use FILE_SHARE_VALID_FLAGS

No change in meaning, but this is simpler.

9 years agowimextract: For --to-stdout, set stdout to binary mode on Windows
Eric Biggers [Sun, 18 May 2014 02:41:21 +0000 (21:41 -0500)]
wimextract:  For --to-stdout, set stdout to binary mode on Windows

9 years agowin32_common.c: Remove duplicate declaration of func_NtOpenFile
Eric Biggers [Sat, 17 May 2014 06:23:26 +0000 (01:23 -0500)]
win32_common.c: Remove duplicate declaration of func_NtOpenFile

9 years agoinode_fixup.c: Further simplify MS bug workaround
Eric Biggers [Sat, 17 May 2014 06:09:06 +0000 (01:09 -0500)]
inode_fixup.c:  Further simplify MS bug workaround

Based on what WIMGAPI does, and assuming it sufficiently works around its
own [presumably fixed] bug, the workaround can be simplified to just
"don't hard link dentries that have different unnamed data streams".

9 years agoinode_fixup.c: Simplify logic
Eric Biggers [Sat, 17 May 2014 03:08:16 +0000 (22:08 -0500)]
inode_fixup.c:  Simplify logic

Most of the logic in this file is working around a Microsoft bug, but
there must be an easier way to do it.  This commits strips the code down
to something more logical that still seems to "do the right thing" on a
Windows 7 WIM affected by the Microsoft bug.

9 years agodentry.h: Remove declaration of dentry_tree_fix_inodes()
Eric Biggers [Sat, 17 May 2014 02:36:05 +0000 (21:36 -0500)]
dentry.h:  Remove declaration of dentry_tree_fix_inodes()

This is already declared in inode.h.

9 years agowin32_replacements.c: Remove unnecessary 'extern'
Eric Biggers [Fri, 16 May 2014 01:37:50 +0000 (20:37 -0500)]
win32_replacements.c: Remove unnecessary 'extern'

9 years agoRewrite code for capture rpfix
Eric Biggers [Fri, 16 May 2014 01:13:34 +0000 (20:13 -0500)]
Rewrite code for capture rpfix

The previous code had many potential problems on the Windows side.
Targets of Windows native symbolic links (except those with
SYMBOLIC_LINK_RELATIVE set) and junction points are stored in the reparse
points as NT namespace paths.  Therefore they can validly include
prefixes like '\??\', '\DosDevices\', or '\Device\HardDiskVolume1'.  They
potentially do not use drive letters at all, and they may be over
MAX_PATH characters.  Such paths should be accessed using the native API
(NtOpenFile), not Win32 (CreateFile).  This commit changes the code to do

9 years agoreparse.c: Fix volume_junction_prefix
Eric Biggers [Thu, 15 May 2014 17:53:57 +0000 (12:53 -0500)]
reparse.c: Fix volume_junction_prefix

This uses an NT namespace path, so it's \??\ prefix not \\?\.

9 years agoUpdate NEWS
Eric Biggers [Thu, 15 May 2014 17:14:51 +0000 (12:14 -0500)]
Update NEWS

9 years agoRemove unused win32_truncate_replacement()
Eric Biggers [Thu, 15 May 2014 04:50:12 +0000 (23:50 -0500)]
Remove unused win32_truncate_replacement()

9 years agoMove code from win32_common.c to win32_apply.c
Eric Biggers [Thu, 15 May 2014 04:48:17 +0000 (23:48 -0500)]
Move code from win32_common.c to win32_apply.c