#include "wimlib/endianness.h"
#include "wimlib/error.h"
#include "wimlib/file_io.h"
+#include "wimlib/ntfs_3g.h" /* for read_ntfs_attribute_prefix() */
#include "wimlib/resource.h"
#include "wimlib/sha1.h"
#include "wimlib/wim.h"
# include "wimlib/win32.h"
#endif
-#ifdef WITH_NTFS_3G
-/* for read_ntfs_attribute_prefix() */
-# include "wimlib/ntfs_3g.h"
-#endif
-
-
/*
* Compressed WIM resources
*
int raw_fd;
struct filedes fd;
- wimlib_assert(size <= blob->size);
-
DEBUG("Reading %"PRIu64" bytes from \"%"TS"\"", size, blob->file_on_disk);
raw_fd = topen(blob->file_on_disk, O_BINARY | O_RDONLY);
struct filedes fd;
int ret;
- wimlib_assert(size <= blob->size);
-
DEBUG("Reading %"PRIu64" bytes from staging file \"%s\"",
size, blob->staging_file_name);
read_buffer_prefix(const struct blob_descriptor *blob,
u64 size, consume_data_callback_t cb, void *cb_ctx)
{
- wimlib_assert(size <= blob->size);
return (*cb)(blob->attached_buffer, size, cb_ctx);
}
};
wimlib_assert(blob->blob_location < ARRAY_LEN(handlers)
&& handlers[blob->blob_location] != NULL);
+ wimlib_assert(size <= blob->size);
return handlers[blob->blob_location](blob, size, cb, cb_ctx);
}
struct blob_descriptor blob;
wim_res_hdr_to_desc(reshdr, wim, &rdesc);
- blob_set_is_located_in_wim_resource(&blob, &rdesc);
-
- blob.size = rdesc.uncompressed_size;
- blob.offset_in_res = 0;
+ blob_set_is_located_in_nonsolid_wim_resource(&blob, &rdesc);
return read_full_blob_into_alloc_buf(&blob, buf_ret);
}
int ret;
wim_res_hdr_to_desc(reshdr, wim, &rdesc);
- blob_set_is_located_in_wim_resource(&blob, &rdesc);
-
- blob.size = rdesc.uncompressed_size;
- blob.offset_in_res = 0;
+ blob_set_is_located_in_nonsolid_wim_resource(&blob, &rdesc);
blob.unhashed = 1;
ret = sha1_blob(&blob);
tchar actual_hashstr[SHA1_HASH_SIZE * 2 + 1];
sprint_hash(blob->hash, expected_hashstr);
sprint_hash(hash, actual_hashstr);
- ERROR("The blob is corrupted!\n"
+ ERROR("The data is corrupted!\n"
" (Expected SHA-1=%"TS",\n"
" got SHA-1=%"TS")",
expected_hashstr, actual_hashstr);