+static int
+dentry_clear_inode_visited(struct wim_dentry *dentry, void *_ignore)
+{
+ dentry->d_inode->i_visited = 0;
+ return 0;
+}
+
+static int
+dentry_get_features(struct wim_dentry *dentry, void *_features_p)
+{
+ DWORD features = 0;
+ DWORD *features_p = _features_p;
+ struct wim_inode *inode = dentry->d_inode;
+
+ if (inode->i_visited) {
+ features |= FILE_SUPPORTS_HARD_LINKS;
+ } else {
+ inode->i_visited = 1;
+ if (inode->i_attributes & FILE_ATTRIBUTE_SPARSE_FILE)
+ features |= FILE_SUPPORTS_SPARSE_FILES;
+ if (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT)
+ features |= FILE_SUPPORTS_REPARSE_POINTS;
+ for (unsigned i = 0; i < inode->i_num_ads; i++)
+ if (inode->i_ads_entries[i].stream_name_nbytes)
+ features |= FILE_NAMED_STREAMS;
+ if (inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED)
+ features |= FILE_SUPPORTS_ENCRYPTION;
+ if (inode->i_attributes & FILE_ATTRIBUTE_COMPRESSED)
+ features |= FILE_FILE_COMPRESSION;
+ if (inode->i_security_id != -1)
+ features |= FILE_PERSISTENT_ACLS;
+ }
+ *features_p |= features;
+ return 0;
+}
+