*/
/*
- * Copyright (C) 2012 Eric Biggers
+ * Copyright (C) 2012, 2013 Eric Biggers
*
* This file is part of wimlib, a library for working with WIM files.
*
bool is_partial_chunk = (partial_chunk_size !=
uncompressed_chunk_size);
- DEBUG2("start_offset = %u, end_offset = %u", start_offset,
- end_offset);
- DEBUG2("partial_chunk_size = %u", partial_chunk_size);
+ DEBUG2("start_offset = %"PRIu64", end_offset = %"PRIu64"",
+ start_offset, end_offset);
+ DEBUG2("partial_chunk_size = %"PRIu64"", partial_chunk_size);
/* This is undocumented, but chunks can be uncompressed. This
* appears to always be the case when the compressed chunk size
case RESOURCE_IN_FILE_ON_DISK:
/* The resource is in some file on the external filesystem and
* needs to be read uncompressed */
- wimlib_assert(lte->file_on_disk);
- wimlib_assert(<e->file_on_disk == <e->staging_file_name);
+ wimlib_assert(lte->file_on_disk != NULL);
+ BUILD_BUG_ON(<e->file_on_disk != <e->staging_file_name);
/* Use existing file pointer if available; otherwise open one
* temporarily */
if (lte->file_on_disk_fp) {
if (fp != lte->file_on_disk_fp)
fclose(fp);
break;
+#if defined(__CYGWIN__) || defined(__WIN32__)
+ case RESOURCE_WIN32:
+ wimlib_assert(lte->file_on_disk_fp != NULL);
+ ret = win32_read_file(lte->file_on_disk, lte->file_on_disk_fp,
+ offset, size, buf);
+ break;
+#endif
case RESOURCE_IN_ATTACHED_BUFFER:
/* The resource is directly attached uncompressed in an
* in-memory buffer. */
if (!hashes_equal(hash, lte->hash)) {
#ifdef ENABLE_ERROR_MESSAGES
ERROR("Invalid checksum on the following WIM resource:");
- print_lookup_table_entry(lte);
+ print_lookup_table_entry(lte, stderr);
#endif
return WIMLIB_ERR_INVALID_RESOURCE_HASH;
}