X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=include%2Fwimlib%2Freparse.h;h=b931835bd23af98e08d5268444fb130dd5edea3f;hb=c48e2f84645abe34faec4994605d7a7b3b451672;hp=ff422a1d0fcc2b4cfc05e46ab4b14e229c1b1fb8;hpb=f2f293a1759c81e7bd5deb904c3909368f3feaa5;p=wimlib diff --git a/include/wimlib/reparse.h b/include/wimlib/reparse.h index ff422a1d..b931835b 100644 --- a/include/wimlib/reparse.h +++ b/include/wimlib/reparse.h @@ -1,13 +1,48 @@ #ifndef _WIMLIB_REPARSE_H #define _WIMLIB_REPARSE_H +#include + #include "wimlib/types.h" struct wim_inode; -struct wim_lookup_table; +struct blob_table; +struct blob_descriptor; #define REPARSE_POINT_MAX_SIZE (16 * 1024) +/* On-disk format of reparse point buffer */ +struct reparse_buffer_disk { + le32 rptag; + le16 rpdatalen; + le16 rpreserved; + union { + u8 rpdata[REPARSE_POINT_MAX_SIZE - 8]; + + struct { + le16 substitute_name_offset; + le16 substitute_name_nbytes; + le16 print_name_offset; + le16 print_name_nbytes; + le32 rpflags; + u8 data[REPARSE_POINT_MAX_SIZE - 20]; + } _packed_attribute symlink; + + struct { + le16 substitute_name_offset; + le16 substitute_name_nbytes; + le16 print_name_offset; + le16 print_name_nbytes; + u8 data[REPARSE_POINT_MAX_SIZE - 16]; + } _packed_attribute junction; + }; +} _packed_attribute; + +#define REPARSE_DATA_OFFSET (offsetof(struct reparse_buffer_disk, rpdata)) + +#define REPARSE_DATA_MAX_SIZE (REPARSE_POINT_MAX_SIZE - REPARSE_DATA_OFFSET) + + /* Structured format for symbolic link, junction point, or mount point reparse * data. */ struct reparse_data { @@ -42,41 +77,23 @@ struct reparse_data { u16 print_name_nbytes; }; -enum { - SUBST_NAME_IS_RELATIVE_LINK = -1, - SUBST_NAME_IS_VOLUME_JUNCTION = -2, - SUBST_NAME_IS_UNKNOWN = -3, -}; -extern int -parse_substitute_name(const utf16lechar *substitute_name, - u16 substitute_name_nbytes, - u32 rptag); - extern int parse_reparse_data(const u8 * restrict rpbuf, u16 rpbuflen, struct reparse_data * restrict rpdata); extern int make_reparse_buffer(const struct reparse_data * restrict rpdata, - u8 * restrict rpbuf); - -extern int -wim_inode_get_reparse_data(const struct wim_inode * restrict inode, - u8 * restrict rpbuf, - u16 * restrict rpbuflen_ret); + u8 * restrict rpbuf, + u16 * restrict rpbuflen_ret); #ifndef __WIN32__ ssize_t wim_inode_readlink(const struct wim_inode * restrict inode, char * restrict buf, - size_t buf_len); + size_t buf_len, const struct blob_descriptor *blob); extern int wim_inode_set_symlink(struct wim_inode *inode, const char *target, - struct wim_lookup_table *lookup_table); + struct blob_table *blob_table); #endif -extern tchar * -capture_fixup_absolute_symlink(tchar *dest, - u64 capture_root_ino, u64 capture_root_dev); - #endif /* _WIMLIB_REPARSE_H */