-static int apply_stream_list(struct list_head *stream_list,
- struct apply_args *args,
- const struct apply_operations *ops,
- wimlib_progress_func_t progress_func)
-{
- uint64_t bytes_per_progress = args->progress.extract.total_bytes / 100;
- uint64_t next_progress = bytes_per_progress;
- struct lookup_table_entry *lte;
- struct inode *inode;
- struct dentry *dentry;
- int ret = 0;
-
- /* This complicated loop is actually just looping through the dentries
- * (as for_dentry_in_tree() does), but the outer loop is actually over
- * the distinct streams to be extracted so that sequential reading of
- * the WIM can be implemented. */
-
- /* For each distinct stream to be extracted */
- list_for_each_entry(lte, stream_list, staging_list) {
- /* For each inode that contains the stream */
- list_for_each_entry(inode, <e->inode_list, lte_inode_list) {
- /* For each dentry that points to the inode */
- inode_for_each_dentry(dentry, inode) {
- ret = ops->apply_dentry(dentry, args);
- if (ret != 0)
- goto out;
- if (progress_func &&
- args->progress.extract.completed_bytes >= next_progress &&
- args->progress.extract.total_bytes != 0)
- {
- progress_func(WIMLIB_PROGRESS_MSG_EXTRACT_STREAMS,
- &args->progress);
- next_progress += bytes_per_progress;
- }
+static int
+do_feature_check(const struct wim_features *required_features,
+ const struct wim_features *supported_features,
+ int extract_flags)
+{
+ /* File attributes. */
+ if (!(extract_flags & WIMLIB_EXTRACT_FLAG_NO_ATTRIBUTES)) {
+ /* Note: Don't bother the user about FILE_ATTRIBUTE_ARCHIVE.
+ * We're an archive program, so theoretically we can do what we
+ * want with it. */
+
+ if (required_features->hidden_files &&
+ !supported_features->hidden_files)
+ WARNING("Ignoring FILE_ATTRIBUTE_HIDDEN of %lu files",
+ required_features->hidden_files);
+
+ if (required_features->system_files &&
+ !supported_features->system_files)
+ WARNING("Ignoring FILE_ATTRIBUTE_SYSTEM of %lu files",
+ required_features->system_files);
+
+ if (required_features->compressed_files &&
+ !supported_features->compressed_files)
+ WARNING("Ignoring FILE_ATTRIBUTE_COMPRESSED of %lu files",
+ required_features->compressed_files);
+
+ if (required_features->not_context_indexed_files &&
+ !supported_features->not_context_indexed_files)
+ WARNING("Ignoring FILE_ATTRIBUTE_NOT_CONTENT_INDEXED of %lu files",
+ required_features->not_context_indexed_files);
+
+ if (required_features->sparse_files &&
+ !supported_features->sparse_files)
+ WARNING("Ignoring FILE_ATTRIBUTE_SPARSE_FILE of %lu files",
+ required_features->sparse_files);
+
+ if (required_features->encrypted_directories &&
+ !supported_features->encrypted_directories)
+ WARNING("Ignoring FILE_ATTRIBUTE_ENCRYPTED of %lu directories",
+ required_features->encrypted_directories);
+ }
+
+ /* Encrypted files. */
+ if (required_features->encrypted_files &&
+ !supported_features->encrypted_files)
+ WARNING("Ignoring %lu encrypted files",
+ required_features->encrypted_files);
+
+ /* Named data streams. */
+ if (required_features->named_data_streams &&
+ (!supported_features->named_data_streams))
+ WARNING("Ignoring named data streams of %lu files",
+ required_features->named_data_streams);
+
+ /* Hard links. */
+ if (required_features->hard_links && !supported_features->hard_links)
+ WARNING("Extracting %lu hard links as independent files",
+ required_features->hard_links);
+
+ /* Symbolic links and reparse points. */
+ if ((extract_flags & WIMLIB_EXTRACT_FLAG_STRICT_SYMLINKS) &&
+ required_features->symlink_reparse_points &&
+ !supported_features->symlink_reparse_points &&
+ !supported_features->reparse_points)
+ {
+ ERROR("Extraction backend does not support symbolic links!");
+ return WIMLIB_ERR_UNSUPPORTED;
+ }
+ if (required_features->reparse_points &&
+ !supported_features->reparse_points)
+ {
+ if (supported_features->symlink_reparse_points) {
+ if (required_features->other_reparse_points) {
+ WARNING("Ignoring %lu non-symlink/junction "
+ "reparse point files",
+ required_features->other_reparse_points);