Eric Biggers [Sat, 12 Oct 2013 00:11:41 +0000 (19:11 -0500)]
lzx-decompress.c: Fix alignment bug
The pretree decode table was not declared to be 16 byte aligned, as
expected by make_huffman_decode_table().
This bug had no effect if the compiler aligned this table on a 16 byte
boundary anyway, but if not it caused a segmentation fault on x86 platforms
where the SSE2 instructions were available, since in that case stores
requiring 16 byte alignment are used to fill in table entries.
Eric Biggers [Mon, 2 Sep 2013 14:03:55 +0000 (09:03 -0500)]
dentry_extract_skeleton(): Fix bug with DOS name reordering
When choosing a different dentry for an inode being extracted, the code didn't
check if it was actually in the tree being extracted.
This bug could cause an infinite loop in extraction backends that required DOS
name reordering and also allowed extracting only a subset of an image---
currently, just the Windows backend.
Eric Biggers [Sun, 1 Sep 2013 06:23:44 +0000 (01:23 -0500)]
Replace WIMLIB_OPEN_FLAG_SPLIT_OK with WIMLIB_OPEN_FLAG_ERROR_IF_SPLIT
Having to specify a special flag to open split WIM parts is no longer very
useful, since error codes will be automatically be issued when needed metadata
or file resources are not found, and this flag wouldn't affect delta WIMs which
resemble split WIMs anyway, and clients could just check themselves whether a
WIM is split. Therefore, make the default be like WIMLIB_OPEN_FLAG_SPLIT_OK,
but for completeness offer a flag WIMLIB_OPEN_FLAG_ERROR_IF_SPLIT to get
behavior like the old default.
Eric Biggers [Sun, 1 Sep 2013 00:02:33 +0000 (19:02 -0500)]
win32_capture_streams(): Handle not implemented/supported
If NtQueryInformationFile() returns STATUS_NOT_IMPLEMENTED,
STATUS_NOT_SUPPORTED, or STATUS_INVALID_INFO_CLASS when
FileStreamInformation is requested, fall back to FindFirstStream() and
FindNextStream() instead (which themselves have a fallback behavior).
Eric Biggers [Sat, 31 Aug 2013 23:29:41 +0000 (18:29 -0500)]
Win32: Define _CRT_NON_CONFORMING_SWPRINTFS
To get the "old" swprintf() declaration with all versions of MinGW, at
least until the code is fixed to use the standard form, define
_CRT_NON_CONFORMING_SWPRINTFS.
Eric Biggers [Tue, 20 Aug 2013 00:17:36 +0000 (19:17 -0500)]
Generalized support for referencing resources in external WIMs
In preparation for supporting "delta" WIMs, this commit generalizes the library
interface for handling split WIMs.
Instead of cluttering up various functions with additional split WIM parameters,
there is now a function wimlib_reference_resource_files() available that can
load additional resources (e.g. from a split WIM part) into a WIMStruct that has
metadata available (e.g. the first part of a split WIM, or a standalone WIM).
wimlib_reference_resource_files() can handle file globbing by itself, so it
actually makes it easier for library users to process split WIMs.
Lower-level APIs wimlib_reference_resources() and wimlib_unreference_resources()
are also provided, but not yet used directly by `wimlib-imagex'.
Some instances of WIMLIB_ERR_SPLIT_UNSUPPORTED error returns were changed to
the new error code WIMLIB_ERR_METADATA_NOT_FOUND.
This commit also re-writes wimlib_export_image() to correctly roll back changes
on multi-image exports and better handle resources in the source WIM being
missing, as well as add a flag to make all destination image(s) unnamed.
Eric Biggers [Sun, 18 Aug 2013 19:25:10 +0000 (14:25 -0500)]
extract.c: Fix extraction of streams of hard-linked files
Due to the re-ordering of dentries in a directory to extract correct DOS names,
was_hardlinked could be set on the dentry referenced by a stream, thereby
causing the stream not to be extracted. Fix by having each stream reference all
possible dentries.
Eric Biggers [Thu, 15 Aug 2013 19:08:00 +0000 (14:08 -0500)]
Improve write streams performance and handling of joins
Provide the number of completed WIM parts and total WIM parts in
WIMLIB_PROGRESS_MSG_WRITE_STREAMS, to replace WIMLIB_PROGRESS_MSG_JOIN.
Furthermore, write streams in a more intelligent order; e.g. sorting by WIM part
number and file offset when relevant.