Add progress messages for WIMBoot apply exclude
authorEric Biggers <ebiggers3@gmail.com>
Tue, 29 Apr 2014 19:34:32 +0000 (14:34 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Tue, 29 Apr 2014 19:34:32 +0000 (14:34 -0500)
include/wimlib.h
programs/imagex.c
src/win32_apply.c

index fc6526a..6a5ba2f 100644 (file)
@@ -576,9 +576,18 @@ enum wimlib_progress_msg {
 
        /** A file in the WIM image is being replaced as a result of a
         * ::wimlib_add_command without ::WIMLIB_ADD_FLAG_NO_REPLACE specified.
-        * This is only received when ::WIMLIB_ADD_FLAG_VERBOSE is also
-        * specified in the add command.  */
+        * @p info will point to ::wimlib_progress_info.replace.  This is only
+        * received when ::WIMLIB_ADD_FLAG_VERBOSE is also specified in the add
+        * command.  */
        WIMLIB_PROGRESS_MSG_REPLACE_FILE_IN_WIM,
+
+       /** A WIM image is being applied with ::WIMLIB_EXTRACT_FLAG_WIMBOOT, and
+        * a file is being extracted normally (not as a WIMBoot "pointer file")
+        * due to it matching a pattern in the [PrepopulateList] section of the
+        * configuration file \Windows\System32\WimBootCompress.ini in the WIM
+        * image.  @info will point to ::wimlib_progress_info.wimboot_exclude.
+        */
+       WIMLIB_PROGRESS_MSG_WIMBOOT_EXCLUDE,
 };
 
 /** A pointer to this union is passed to the user-supplied
@@ -930,6 +939,15 @@ union wimlib_progress_info {
                /** Path to the file in the WIM image that is being replaced  */
                const wimlib_tchar *path_in_wim;
        } replace;
+
+       /** Valid on messages ::WIMLIB_PROGRESS_MSG_WIMBOOT_EXCLUDE  */
+       struct wimlib_progress_info_wimboot_exclude {
+               /** Path to the file in the WIM image  */
+               const wimlib_tchar *path_in_wim;
+
+               /** Path to which the file is being extracted  */
+               const wimlib_tchar *extraction_path;
+       } wimboot_exclude;
 };
 
 /** A user-supplied function that will be called periodically during certain WIM
index 32f24c3..bc16624 100644 (file)
@@ -1208,6 +1208,10 @@ imagex_progress_func(enum wimlib_progress_msg msg,
                imagex_printf(T("Updating \"%"TS"\" in WIM image\n"),
                              info->replace.path_in_wim);
                break;
+       case WIMLIB_PROGRESS_MSG_WIMBOOT_EXCLUDE:
+               imagex_printf(T("\nExtracting \"%"TS"\" as normal file (not WIMBoot pointer)\n"),
+                             info->wimboot_exclude.path_in_wim);
+               break;
        default:
                break;
        }
index c78683b..9135a7d 100644 (file)
@@ -431,16 +431,27 @@ win32_extract_unnamed_stream(file_spec_t file,
            && lte
            && lte->resource_location == RESOURCE_IN_WIM
            && lte->rspec->wim == ctx->wim
-           && lte->size == lte->rspec->uncompressed_size
-           && !in_prepopulate_list(dentry, ctx))
+           && lte->size == lte->rspec->uncompressed_size)
        {
-               const struct win32_apply_private_data *dat;
+               if (in_prepopulate_list(dentry, ctx)) {
+                       if (ctx->progress_func) {
+                               union wimlib_progress_info info;
 
-               dat = get_private_data(ctx);
-               return wimboot_set_pointer(file.path, lte,
-                                          dat->data_source_id,
-                                          dat->wim_lookup_table_hash,
-                                          dat->wof_running);
+                               info.wimboot_exclude.path_in_wim = dentry->_full_path;
+                               info.wimboot_exclude.extraction_path = file.path;
+
+                               ctx->progress_func(WIMLIB_PROGRESS_MSG_WIMBOOT_EXCLUDE,
+                                                  &info);
+                       }
+               } else {
+                       const struct win32_apply_private_data *dat;
+
+                       dat = get_private_data(ctx);
+                       return wimboot_set_pointer(file.path, lte,
+                                                  dat->data_source_id,
+                                                  dat->wim_lookup_table_hash,
+                                                  dat->wof_running);
+               }
        }
 
        return win32_extract_stream(file.path, NULL, 0, lte, ctx);