win32_capture: pass proper path to scan callback
authorEric Biggers <ebiggers3@gmail.com>
Sun, 17 Jan 2016 17:34:50 +0000 (11:34 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 17 Jan 2016 17:58:27 +0000 (11:58 -0600)
NEWS
src/capture_common.c
src/win32_capture.c

diff --git a/NEWS b/NEWS
index 82632cd..c9e05d3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ Version 1.9.0-BETA:
        have been slightly tweaked.
 
        Progress information for directory tree scans now counts all hard links.
+       Also, on Windows "\\?\" is no longer stripped from the current path.
 
        Added a new '--image-property' option to 'wimcapture', 'wimappend', and
        'wiminfo'.  This option lets you assign values to elements in a WIM
index 8279497..3c06012 100644 (file)
@@ -53,6 +53,9 @@ int
 do_capture_progress(struct capture_params *params, int status,
                    const struct wim_inode *inode)
 {
+       int ret;
+       tchar *cookie;
+
        switch (status) {
        case WIMLIB_SCAN_DENTRY_OK:
                if (!(params->add_flags & WIMLIB_ADD_FLAG_VERBOSE))
@@ -93,8 +96,12 @@ do_capture_progress(struct capture_params *params, int status,
        }
 
        /* Call the user-provided progress function.  */
-       return call_progress(params->progfunc, WIMLIB_PROGRESS_MSG_SCAN_DENTRY,
+
+       cookie = progress_get_win32_path(params->progress.scan.cur_path);
+       ret = call_progress(params->progfunc, WIMLIB_PROGRESS_MSG_SCAN_DENTRY,
                             &params->progress, params->progctx);
+       progress_put_win32_path(cookie);
+       return ret;
 }
 
 /*
index d6be112..196342e 100644 (file)
@@ -856,7 +856,7 @@ winnt_rpfix_progress(struct capture_params *params, const wchar_t *path,
        wmemcpy(print_name0, link->print_name, print_name_nchars);
        print_name0[print_name_nchars] = L'\0';
 
-       params->progress.scan.cur_path = printable_path(path);
+       params->progress.scan.cur_path = path;
        params->progress.scan.symlink_target = print_name0;
        return do_capture_progress(params, scan_status, NULL);
 }
@@ -1755,7 +1755,7 @@ retry_open:
        }
 
 out_progress:
-       ctx->params->progress.scan.cur_path = printable_path(full_path);
+       ctx->params->progress.scan.cur_path = full_path;
        if (likely(root))
                ret = do_capture_progress(ctx->params, WIMLIB_SCAN_DENTRY_OK, inode);
        else
@@ -2714,7 +2714,7 @@ generate_wim_structures_recursive(struct wim_dentry **root_ret,
        }
 
 out_progress:
-       ctx->params->progress.scan.cur_path = printable_path(path);
+       ctx->params->progress.scan.cur_path = path;
        if (likely(root))
                ret = do_capture_progress(ctx->params, WIMLIB_SCAN_DENTRY_OK, inode);
        else