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. */
if (ret)
return ret;
- if (progress->extract.completed_bytes >=
- progress->extract.total_bytes)
- {
- ctx->next_progress = UINT64_MAX;
- } else {
- /* Send new message as soon as another 1/128 of the
- * total has been extracted. (Arbitrary number.) */
- ctx->next_progress =
- progress->extract.completed_bytes +
- progress->extract.total_bytes / 128;
-
- /* ... Unless that would be more than 5000000 bytes, in
- * which case send the next after the next 5000000
- * bytes. (Another arbitrary number.) */
- if (progress->extract.completed_bytes + 5000000 <
- ctx->next_progress)
- ctx->next_progress =
- progress->extract.completed_bytes + 5000000;
-
- /* ... But always send a message as soon as we're
- * completely done. */
- if (progress->extract.total_bytes < ctx->next_progress)
- ctx->next_progress = progress->extract.total_bytes;
- }
+ set_next_progress(progress->extract.completed_bytes,
+ progress->extract.total_bytes,
+ &ctx->next_progress);
}
if (unlikely(filedes_valid(&ctx->tmpfile_fd))) {
if (num_chars == 0)
return true;
for (i = 0; i < num_chars; i++) {
- switch (name[i]) {
+ switch (le16_to_cpu(name[i])) {
#ifdef __WIN32__
- case cpu_to_le16('\\'):
- case cpu_to_le16(':'):
- case cpu_to_le16('*'):
- case cpu_to_le16('?'):
- case cpu_to_le16('"'):
- case cpu_to_le16('<'):
- case cpu_to_le16('>'):
- case cpu_to_le16('|'):
+ case '\x01'...'\x1F':
+ case '\\':
+ case ':':
+ case '*':
+ case '?':
+ case '"':
+ case '<':
+ case '>':
+ case '|':
#endif
- case cpu_to_le16('/'):
- case cpu_to_le16('\0'):
+ case '/':
+ case '\0':
if (fix)
name[i] = replacement_char;
else
}
}
-#ifdef __WIN32__
- if (name[num_chars - 1] == cpu_to_le16(' ') ||
- name[num_chars - 1] == cpu_to_le16('.'))
- {
- if (fix)
- name[num_chars - 1] = replacement_char;
- else
- return false;
- }
-#endif
return true;
}
* - 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? */
#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 |