Win32 fixes
authorEric Biggers <ebiggers3@gmail.com>
Sat, 17 Aug 2013 19:07:02 +0000 (14:07 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sat, 17 Aug 2013 19:07:02 +0000 (14:07 -0500)
include/wimlib/apply.h
programs/imagex.c
src/extract.c
src/win32_apply.c
src/win32_common.c

index 97497d7..1a2647d 100644 (file)
@@ -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;
 
index 9f3939c..da58a14 100644 (file)
@@ -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;
index b7b3399..2cc134d 100644 (file)
@@ -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;
 
index 6a44707..ffc4c55 100644 (file)
@@ -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:
index a996378..c6605b4 100644 (file)
@@ -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