X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=include%2Fwimlib%2Fapply.h;h=ef623a6f2652a8fe0cbc5b9f3577dcf9e36892f2;hp=5063f805db282c385e8c3a19fd72e66c163612dd;hb=fd0584f6e32ed9ef19899b29d5f9aa6f4d9432f3;hpb=61db93f82eca3fe9f7676355c709c58cc425a6ad diff --git a/include/wimlib/apply.h b/include/wimlib/apply.h index 5063f805..ef623a6f 100644 --- a/include/wimlib/apply.h +++ b/include/wimlib/apply.h @@ -10,6 +10,13 @@ struct wimlib_unix_data; struct wim_dentry; struct apply_ctx; +/* Path to extracted file, or "cookie" identifying the file (e.g. inode number). + * */ +typedef union { + const tchar *path; + u64 cookie; +} file_spec_t; + /* * struct apply_operations - Callback functions for a specific extraction * mode/backend. These are lower-level functions that are called by the generic @@ -43,11 +50,11 @@ struct apply_operations { /* REQUIRED: Create a file. */ int (*create_file) - (const tchar *path, struct apply_ctx *ctx); + (const tchar *path, struct apply_ctx *ctx, u64 *cookie_ret); /* REQUIRED: Create a directory. */ int (*create_directory) - (const tchar *path, struct apply_ctx *ctx); + (const tchar *path, struct apply_ctx *ctx, u64 *cookie_ret); /* OPTIONAL: Create a hard link. In start_extract(), set * ctx->supported_features.hard_links if supported. */ @@ -63,26 +70,27 @@ struct apply_operations { /* REQUIRED: Extract unnamed data stream. */ int (*extract_unnamed_stream) - (const tchar *path, struct wim_lookup_table_entry *lte, + (file_spec_t file, struct wim_lookup_table_entry *lte, struct apply_ctx *ctx); /* OPTIONAL: Extracted named data stream. In start_extract(), set * ctx->supported_features.alternate_data_streams if supported. */ int (*extract_named_stream) - (const tchar *path, const utf16lechar *stream_name, + (file_spec_t file, const utf16lechar *stream_name, size_t stream_name_nchars, struct wim_lookup_table_entry *lte, struct apply_ctx *ctx); /* OPTIONAL: Extracted encrypted stream. In start_extract(), set * ctx->supported_features.encrypted_files if supported. */ int (*extract_encrypted_stream) - (const tchar *path, struct wim_lookup_table_entry *lte, + (file_spec_t file, struct wim_lookup_table_entry *lte, struct apply_ctx *ctx); /* OPTIONAL: Set file attributes. Calling code calls this if non-NULL. */ int (*set_file_attributes) - (const tchar *path, u32 attributes, struct apply_ctx *ctx); + (const tchar *path, u32 attributes, struct apply_ctx *ctx, + unsigned pass); /* OPTIONAL: Set reparse data. In start_extract(), set * ctx->supported_features.reparse_data if supported. */ @@ -100,7 +108,7 @@ struct apply_operations { * set ctx->supported_features.security_descriptors if supported. */ int (*set_security_descriptor) (const tchar *path, const u8 *desc, size_t desc_size, - struct apply_ctx *ctx, bool strict); + struct apply_ctx *ctx); /* OPTIONAL: Set wimlib-specific UNIX data. In start_extract(), set * ctx->supported_features.unix_data if supported. */ @@ -154,6 +162,16 @@ struct apply_operations { /* OPTIONAL: Set to 1 if the root directory of the volume (see * target_is_root() callback) should not be explicitly extracted. */ unsigned root_directory_is_special : 1; + + /* OPTIONAL: Set to 1 if extraction cookie, or inode number, is stored + * in create_file() and create_directory() callbacks. This cookie will + * then be passed to callbacks taking a 'file_spec_t', rather than the + * path. */ + unsigned uses_cookies : 1; + + /* OPTIONAL: Set to 1 if set_file_attributes() needs to be called a + * second time towards the end of the extraction. */ + unsigned requires_final_set_attributes_pass : 1; }; struct wim_features { @@ -162,6 +180,7 @@ struct wim_features { unsigned long system_files; unsigned long compressed_files; unsigned long encrypted_files; + unsigned long encrypted_directories; unsigned long not_context_indexed_files; unsigned long sparse_files; unsigned long named_data_streams; @@ -185,10 +204,13 @@ struct apply_ctx { struct wim_dentry *extract_root; const struct apply_operations *ops; struct wim_features supported_features; + u32 supported_attributes_mask; struct list_head stream_list; tchar *realtarget; size_t realtarget_nchars; unsigned long invalid_sequence; + unsigned long partial_security_descriptors; + unsigned long no_security_descriptors; u64 num_streams_remaining; bool root_dentry_is_special; uint64_t next_progress;