]> wimlib.net Git - wimlib/commitdiff
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 97497d7bb26268e41f37d00333fd778f7f90eae2..1a2647df52dfca8145d2c18e434aa81ee9b953e8 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 9f3939c38550e9afbe6e4bbdc8367a92ef3f5269..da58a147f6cb61d733f671545d38e39c25b8054d 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 b7b3399b36eb667b35f2d0beedb4bc94d672da16..2cc134dc7b10757aeab6841045400da2354588cc 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 6a447074d02341c145ca374bd82e444dc081f352..ffc4c5528f0409968105fed25dbc629d4a6f82fe 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 a996378a82e4826a9eeab6a4e69d7d40d1594844..c6605b4b53eae1fb59984d05b533503c2bded63e 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