]> wimlib.net Git - wimlib/blobdiff - src/ntfs-3g_apply.c
win32_apply.c: Don't use BEGIN_STREAM_STATUS_SKIP_STREAM
[wimlib] / src / ntfs-3g_apply.c
index ff145a61871a2cc98184bd9599672b8a0085ee7b..d075d3d1f377666e4810c6f27f537cac77dc05b0 100644 (file)
@@ -70,8 +70,6 @@ ntfs_3g_get_supported_features(const char *target,
        return 0;
 }
 
-#define MAX_OPEN_ATTRS 1024
-
 struct ntfs_3g_apply_ctx {
        /* Extract flags, the pointer to the WIMStruct, etc.  */
        struct apply_ctx common;
@@ -79,9 +77,9 @@ struct ntfs_3g_apply_ctx {
        /* Pointer to the open NTFS volume  */
        ntfs_volume *vol;
 
-       ntfs_attr *open_attrs[MAX_OPEN_ATTRS];
+       ntfs_attr *open_attrs[MAX_OPEN_STREAMS];
        unsigned num_open_attrs;
-       ntfs_inode *open_inodes[MAX_OPEN_ATTRS];
+       ntfs_inode *open_inodes[MAX_OPEN_STREAMS];
        unsigned num_open_inodes;
 
        struct reparse_buffer_disk rpbuf;
@@ -91,8 +89,8 @@ struct ntfs_3g_apply_ctx {
        u64 offset;
 
        unsigned num_reparse_inodes;
-       ntfs_inode *ntfs_reparse_inodes[MAX_OPEN_ATTRS];
-       struct wim_inode *wim_reparse_inodes[MAX_OPEN_ATTRS];
+       ntfs_inode *ntfs_reparse_inodes[MAX_OPEN_STREAMS];
+       struct wim_inode *wim_reparse_inodes[MAX_OPEN_STREAMS];
 };
 
 static size_t
@@ -627,7 +625,6 @@ ntfs_3g_create_nondirectory(struct wim_inode *inode,
 
        /* Create additional links if present.  */
        next = inode->i_extraction_aliases.next;
-       ret = 0;
        do {
                dentry = list_entry(next, struct wim_dentry,
                                    d_extraction_alias_node);
@@ -726,6 +723,9 @@ ntfs_3g_begin_extract_stream_to_attr(struct wim_lookup_table_entry *stream,
                return WIMLIB_ERR_NTFS_3G;
        }
 
+       /* This should be ensured by extract_stream_list()  */
+       wimlib_assert(ctx->num_open_attrs < MAX_OPEN_STREAMS);
+
        attr = ntfs_attr_open(ni, AT_DATA, stream_name, stream_name_nchars);
        if (!attr) {
                ERROR_WITH_ERRNO("Failed to open data stream of \"%s\"",