From: Eric Biggers Date: Sat, 17 Aug 2013 19:07:02 +0000 (-0500) Subject: Win32 fixes X-Git-Tag: v1.5.0~53 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=4f754f1026513b5a17d2f455d306488ac1f7975a Win32 fixes --- diff --git a/include/wimlib/apply.h b/include/wimlib/apply.h index 97497d7b..1a2647df 100644 --- a/include/wimlib/apply.h +++ b/include/wimlib/apply.h @@ -13,7 +13,7 @@ struct apply_ctx; /* Path to extracted file, or "cookie" identifying the file (e.g. inode number). * */ typedef union { - const char *path; + const tchar *path; u64 cookie; } file_spec_t; diff --git a/programs/imagex.c b/programs/imagex.c index 9f3939c3..da58a147 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -3373,13 +3373,11 @@ imagex_update(int argc, tchar **argv, int cmd) } /* Set default flags and capture config on the update commands */ - bool have_add_command = false; for (size_t i = 0; i < num_cmds; i++) { switch (cmds[i].op) { case WIMLIB_UPDATE_OP_ADD: cmds[i].add.add_flags |= default_add_flags; cmds[i].add.config = config; - have_add_command = true; break; case WIMLIB_UPDATE_OP_DELETE: cmds[i].delete.delete_flags |= default_delete_flags; diff --git a/src/extract.c b/src/extract.c index b7b3399b..2cc134dc 100644 --- a/src/extract.c +++ b/src/extract.c @@ -1817,10 +1817,10 @@ do_feature_check(const struct wim_features *required_features, const tchar *wim_source_path) { const tchar *loc; - const tchar *mode = "this extraction mode"; + const tchar *mode = T("this extraction mode"); if (wim_source_path[0] == '\0') - loc = "the WIM image"; + loc = T("the WIM image"); else loc = wim_source_path; diff --git a/src/win32_apply.c b/src/win32_apply.c index 6a447074..ffc4c552 100644 --- a/src/win32_apply.c +++ b/src/win32_apply.c @@ -61,7 +61,7 @@ win32_start_extract(const wchar_t *path, struct apply_ctx *ctx) } static int -win32_create_file(const wchar_t *path, struct apply_ctx *ctx) +win32_create_file(const wchar_t *path, struct apply_ctx *ctx, u64 *cookie_ret) { HANDLE h; @@ -78,7 +78,8 @@ error: } static int -win32_create_directory(const wchar_t *path, struct apply_ctx *ctx) +win32_create_directory(const wchar_t *path, struct apply_ctx *ctx, + u64 *cookie_ret) { if (!CreateDirectory(path, NULL)) if (GetLastError() != ERROR_ALREADY_EXISTS) @@ -203,10 +204,11 @@ win32_encrypted_import_cb(unsigned char *data, void *_import_ctx, } static int -win32_extract_encrypted_stream(const wchar_t *path, +win32_extract_encrypted_stream(file_spec_t file, struct wim_lookup_table_entry *lte, struct apply_ctx *ctx) { + const tchar *path = file.path; void *file_ctx; DWORD err; int ret; @@ -343,7 +345,6 @@ win32_set_file_attributes(const wchar_t *path, u32 attributes, goto error; } -success: return 0; error: diff --git a/src/win32_common.c b/src/win32_common.c index a996378a..c6605b4b 100644 --- a/src/win32_common.c +++ b/src/win32_common.c @@ -504,13 +504,13 @@ win32_modify_capture_and_apply_privileges(bool enable) static void win32_acquire_capture_and_apply_privileges(void) { - win32_modify_capture_privileges(true); + win32_modify_capture_and_apply_privileges(true); } static void win32_release_capture_and_apply_privileges(void) { - win32_modify_capture_privileges(false); + win32_modify_capture_and_apply_privileges(false); } HANDLE @@ -566,8 +566,6 @@ windows_version_is_at_least(unsigned major, unsigned minor) void win32_global_init(int init_flags) { - DWORD err; - /* Try to acquire useful privileges. */ if (!(init_flags & WIMLIB_INIT_FLAG_DONT_ACQUIRE_PRIVILEGES)) { win32_acquire_capture_and_apply_privileges(); @@ -591,7 +589,6 @@ win32_global_init(int init_flags) win32func_FindFirstStreamW = NULL; } } - } void