+static int
+ntfs_3g_restore_reparse_point(ntfs_inode *ni, const struct wim_inode *inode,
+ unsigned blob_size, struct ntfs_3g_apply_ctx *ctx)
+{
+ complete_reparse_point(&ctx->rpbuf, inode, blob_size);
+
+ if (ntfs_set_ntfs_reparse_data(ni, (const char *)&ctx->rpbuf,
+ REPARSE_DATA_OFFSET + blob_size, 0))
+ {
+ ERROR_WITH_ERRNO("Failed to set reparse data on \"%s\"",
+ dentry_full_path(
+ inode_first_extraction_dentry(inode)));
+ return WIMLIB_ERR_SET_REPARSE_DATA;
+ }
+
+ return 0;
+}
+
+static bool
+ntfs_3g_has_empty_attributes(const struct wim_inode *inode)
+{
+ for (unsigned i = 0; i < inode->i_num_streams; i++) {
+ const struct wim_inode_stream *strm = &inode->i_streams[i];
+
+ if (stream_blob_resolved(strm) == NULL &&
+ (strm->stream_type == STREAM_TYPE_REPARSE_POINT ||
+ stream_is_named_data_stream(strm)))
+ return true;
+ }
+ return false;
+}
+