+
+ strm = inode_add_stream(inode,
+ attr_type_to_wimlib_stream_type(type),
+ stream_name ? stream_name : NO_STREAM_NAME,
+ blob);
+ if (unlikely(!strm)) {
+ ret = WIMLIB_ERR_NOMEM;
+ goto out_cleanup;
+ }
+ prepare_unhashed_blob(blob, inode, strm->stream_id, unhashed_blobs);
+ blob = NULL;
+ ret = 0;
+out_cleanup:
+ free_blob_descriptor(blob);
+ FREE(stream_name);
+ return ret;
+}
+
+/* Scan attributes of the specified type from a file in the NTFS volume */
+static int
+scan_ntfs_attrs_with_type(struct wim_inode *inode,
+ ntfs_inode *ni,
+ const char *path,
+ size_t path_len,
+ struct list_head *unhashed_blobs,
+ struct ntfs_volume_wrapper *volume,
+ ATTR_TYPES type)
+{
+ ntfs_attr_search_ctx *actx;
+ int ret;
+
+ actx = ntfs_attr_get_search_ctx(ni, NULL);
+ if (!actx) {
+ ERROR_WITH_ERRNO("Failed to get NTFS attribute search "
+ "context for \"%s\"", path);
+ return WIMLIB_ERR_NTFS_3G;
+ }
+
+ while (!ntfs_attr_lookup(type, NULL, 0,
+ CASE_SENSITIVE, 0, NULL, 0, actx))
+ {
+ ret = scan_ntfs_attr(inode,
+ ni,
+ path,
+ path_len,
+ unhashed_blobs,
+ volume,
+ type,
+ actx->attr);
+ if (ret)
+ goto out_put_actx;