WIMLIB_EXTRACT_FLAG_STRICT_GLOB | \
WIMLIB_EXTRACT_FLAG_NO_ATTRIBUTES | \
WIMLIB_EXTRACT_FLAG_NO_PRESERVE_DIR_STRUCTURE | \
- WIMLIB_EXTRACT_FLAG_WIMBOOT)
+ WIMLIB_EXTRACT_FLAG_WIMBOOT | \
+ WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K | \
+ WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS8K | \
+ WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS16K | \
+ WIMLIB_EXTRACT_FLAG_COMPACT_LZX \
+ )
/* Send WIMLIB_PROGRESS_MSG_EXTRACT_FILE_STRUCTURE or
* WIMLIB_PROGRESS_MSG_EXTRACT_METADATA. */
* - file is a directory
* - file is encrypted
* - backend needs to create the file as UNIX symlink
- * - backend will extract the stream as externally backed
+ * - backend will extract the stream as externally
+ * backed from the WIM archive itself
*/
- if (ctx->apply_ops->will_externally_back) {
- int ret = (*ctx->apply_ops->will_externally_back)(dentry, ctx);
+ if (ctx->apply_ops->will_back_from_wim) {
+ int ret = (*ctx->apply_ops->will_back_from_wim)(dentry, ctx);
if (ret > 0) /* Error? */
return ret;
if (ret < 0) /* Won't externally back? */
* subtract <HARDLINKBYTES> from this if hard links are
* supported by the extraction mode.) */
ctx->progress.extract.total_bytes =
- wim_info_get_image_total_bytes(wim->wim_info,
- wim->current_image);
+ xml_get_image_total_bytes(wim->xml_info,
+ wim->current_image);
if (ctx->supported_features.hard_links) {
ctx->progress.extract.total_bytes -=
- wim_info_get_image_hard_link_bytes(wim->wim_info,
- wim->current_image);
+ xml_get_image_hard_link_bytes(wim->xml_info,
+ wim->current_image);
}
}
#endif
}
+ if (extract_flags & (WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K |
+ WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS8K |
+ WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS16K |
+ WIMLIB_EXTRACT_FLAG_COMPACT_LZX))
+ {
+ #ifdef __WIN32__
+ int count = 0;
+ count += ((extract_flags & WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS4K) != 0);
+ count += ((extract_flags & WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS8K) != 0);
+ count += ((extract_flags & WIMLIB_EXTRACT_FLAG_COMPACT_XPRESS16K) != 0);
+ count += ((extract_flags & WIMLIB_EXTRACT_FLAG_COMPACT_LZX) != 0);
+ if (count != 1) {
+ ERROR("Only one compression format can be specified "
+ "for compact-mode extraction!");
+ return WIMLIB_ERR_INVALID_PARAM;
+ }
+ if (extract_flags & WIMLIB_EXTRACT_FLAG_WIMBOOT) {
+ ERROR("Compact-mode extraction and WIMBoot-mode "
+ "extraction are mutually exclusive!");
+ return WIMLIB_ERR_INVALID_PARAM;
+ }
+ #else
+ ERROR("Compact-mode extraction (System Compression) "
+ "is only supported on Windows!");
+ return WIMLIB_ERR_UNSUPPORTED;
+ #endif
+ }
+
if ((extract_flags & (WIMLIB_EXTRACT_FLAG_RPFIX |
WIMLIB_EXTRACT_FLAG_NORPFIX |
return image_name && *image_name &&
!tstrpbrk(image_name, filename_forbidden_chars) &&
tstrcmp(image_name, T(".")) &&
- tstrcmp(image_name, T(".."));
+ tstrcmp(image_name, T("..")) &&
+ tstrlen(image_name) <= 128;
}
/* Extracts all images from the WIM to the directory @target, with the images
static int
extract_all_images(WIMStruct *wim, const tchar *target, int extract_flags)
{
- size_t image_name_max_len = max(xml_get_max_image_name_len(wim), 20);
size_t output_path_len = tstrlen(target);
- tchar buf[output_path_len + 1 + image_name_max_len + 1];
+ tchar buf[output_path_len + 1 + 128 + 1];
int ret;
int image;
const tchar *image_name;
if (ret)
goto out_wimlib_free;
- if (wim_info_get_num_images(pwm->wim_info) != pwm->hdr.image_count) {
+ if (xml_get_image_count(pwm->xml_info) != pwm->hdr.image_count) {
ERROR("Image count in XML data is not the same as in WIM header.");
ret = WIMLIB_ERR_IMAGE_COUNT;
goto out_wimlib_free;