X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fresource.c;h=69a531fbce354309867ca3bc2cc42689517ab983;hp=8f3ba1169a353d8c6ec3c939decb895918a47293;hb=ebd6c0ec0ff47ac18af4ef918fd78fb8d9f19540;hpb=c8b34bffb7884de559d6ac208e0bd982ea318a36 diff --git a/src/resource.c b/src/resource.c index 8f3ba116..69a531fb 100644 --- a/src/resource.c +++ b/src/resource.c @@ -539,8 +539,8 @@ int read_wim_resource(const struct wim_lookup_table_entry *lte, u8 buf[], 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) { @@ -558,6 +558,14 @@ int read_wim_resource(const struct wim_lookup_table_entry *lte, u8 buf[], 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); + DEBUG("Calling win32_read_file()"); + 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. */