X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=programs%2Fimagex.c;h=34eefedf36fa45f8d14f1bebe01499227d109de4;hp=c1d817b970490255eb9dfc303f80737b95fe5c50;hb=03c0995c472eb5b9084e998cf91065b131ddedfb;hpb=145a20679ef30eafd0defbed295127f27aca27e9 diff --git a/programs/imagex.c b/programs/imagex.c index c1d817b9..34eefedf 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -2399,6 +2399,38 @@ out_usage: goto out; } +static void print_byte_field(const uint8_t field[], size_t len) +{ + while (len--) + tprintf(T("%02hhx"), *field++); +} + +static void +print_wim_information(const tchar *wimfile, WIMStruct *wim) +{ + struct wimlib_wim_info info; + + wimlib_get_wim_info((WIMStruct*)wim, &info); + + tputs(T("WIM Information:")); + tputs(T("----------------")); + tprintf(T("Path: %"TS"\n"), wimfile); + tfputs(T("GUID: 0x"), stdout); + print_byte_field(info.guid, WIMLIB_GUID_LEN); + tputchar(T('\n')); + tprintf(T("Image Count: %d\n"), info.image_count); + tprintf(T("Compression: %"TS"\n"), + wimlib_get_compression_type_string(info.compression_type)); + tprintf(T("Part Number: %d/%d\n"), info.part_number, info.total_parts); + tprintf(T("Boot Index: %d\n"), info.boot_index); + tprintf(T("Size: %"PRIu64" bytes\n"), info.total_bytes); + tprintf(T("Integrity Info: %"TS"\n"), + info.has_integrity_table ? T("yes") : T("no")); + tprintf(T("Relative path junction: %"TS"\n"), + info.has_rpfix ? T("yes") : T("no")); + tputchar(T('\n')); +} + /* Prints information about a WIM file; also can mark an image as bootable, * change the name of an image, or change the description of an image. */ static int @@ -2542,7 +2574,7 @@ imagex_info(int argc, tchar **argv) } if (image == WIMLIB_ALL_IMAGES && short_header) - wimlib_print_wim_information(w); + print_wim_information(wimfile, w); if (header) wimlib_print_header(w);