- /* Load information about the unnamed data stream and any named data
- * streams. */
- ret = winnt_scan_streams(h,
- full_path,
- full_path_nchars,
- inode,
- params->unhashed_streams,
- file_info.StandardInformation.EndOfFile.QuadPart,
- vol_flags);
- if (ret)
- goto out;
+ /* If this is a reparse point, load the reparse data. */
+ if (unlikely(inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT)) {
+ if (inode->i_attributes & FILE_ATTRIBUTE_ENCRYPTED) {
+ /* See comment above assign_stream_types_encrypted() */
+ WARNING("Ignoring reparse data of encrypted file \"%ls\"",
+ printable_path(full_path));
+ } else {
+ u8 rpbuf[REPARSE_POINT_MAX_SIZE] _aligned_attribute(8);
+ u16 rpbuflen;
+
+ ret = winnt_get_reparse_data(h, full_path, params,
+ rpbuf, &rpbuflen);
+ switch (ret) {
+ case RP_FIXED:
+ inode->i_not_rpfixed = 0;
+ break;
+ case RP_NOT_FIXED:
+ inode->i_not_rpfixed = 1;
+ break;
+ default:
+ goto out;
+ }
+ inode->i_reparse_tag = le32_to_cpu(*(le32*)rpbuf);
+ if (!inode_add_stream_with_data(inode,
+ STREAM_TYPE_REPARSE_POINT,
+ NO_STREAM_NAME,
+ rpbuf + REPARSE_DATA_OFFSET,
+ rpbuflen - REPARSE_DATA_OFFSET,
+ params->blob_table))
+ {
+ ret = WIMLIB_ERR_NOMEM;
+ goto out;
+ }
+ }
+ }