*
* Return values:
* WIMLIB_ERR_SUCCESS (0)
- * WIMLIB_ERR_INVALID_INTEGRITY_TABLE
* WIMLIB_ERR_NOMEM
- * WIMLIB_ERR_READ
* WIMLIB_ERR_UNEXPECTED_END_OF_FILE
* WIMLIB_ERR_WRITE
*/
int ret;
u32 new_table_size;
+ DEBUG("Writing integrity table "
+ "(new_lookup_table_end=%"PRIu64", old_lookup_table_end=%"PRIu64")",
+ new_lookup_table_end, old_lookup_table_end);
+
wimlib_assert(old_lookup_table_end <= new_lookup_table_end);
- if (wim->hdr.integrity.offset == 0 || old_lookup_table_end == 0) {
- old_table = NULL;
- } else {
+ old_table = NULL;
+ if (wim_has_integrity_table(wim) && old_lookup_table_end != 0) {
ret = read_integrity_table(wim,
old_lookup_table_end - WIM_HEADER_DISK_SIZE,
&old_table);
WIMLIB_COMPRESSION_TYPE_NONE,
&wim->hdr.integrity,
NULL,
- 0);
+ 0,
+ &wim->lzx_context);
FREE(new_table);
out_free_old_table:
FREE(old_table);
+ DEBUG("ret=%d", ret);
return ret;
}
struct integrity_table *table;
u64 end_lookup_table_offset;
- if (wim->hdr.integrity.offset == 0) {
+ if (!wim_has_integrity_table(wim)) {
DEBUG("No integrity information.");
return WIM_INTEGRITY_NONEXISTENT;
}