+static int
+read_reparse_tag(ntfs_inode *ni, struct ntfs_location *loc,
+ u32 *reparse_tag_ret)
+{
+ int ret;
+ u8 buf[8];
+ ntfs_attr *na;
+
+ na = open_ntfs_attr(ni, loc);
+ if (!na) {
+ ret = WIMLIB_ERR_NTFS_3G;
+ goto out;
+ }
+
+ if (ntfs_attr_pread(na, 0, 8, buf) != 8) {
+ ERROR_WITH_ERRNO("Error reading reparse data");
+ ret = WIMLIB_ERR_NTFS_3G;
+ goto out_close_ntfs_attr;
+ }
+ *reparse_tag_ret = le32_to_cpu(*(u32*)buf);
+ DEBUG("ReparseTag = %#x", *reparse_tag_ret);
+ ret = 0;
+out_close_ntfs_attr:
+ ntfs_attr_close(na);
+out:
+ return ret;
+
+}
+