]> wimlib.net Git - wimlib/commitdiff
Fix path passed to wimboot_set_pointer()
authorEric Biggers <ebiggers3@gmail.com>
Thu, 22 May 2014 02:26:10 +0000 (21:26 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 22 May 2014 02:26:10 +0000 (21:26 -0500)
include/wimlib/wimboot.h
src/wimboot.c
src/win32_apply.c

index 1c4b0fc3c79967d7dd8cf6ed2fdf290a64300fbf..6be4fae204d6c294b8a9a435abe3bec19e023dde 100644 (file)
@@ -14,7 +14,7 @@ wimboot_alloc_data_source_id(const wchar_t *wim_path,
                             bool *wof_running_ret);
 
 extern int
                             bool *wof_running_ret);
 
 extern int
-wimboot_set_pointer(UNICODE_STRING *name,
+wimboot_set_pointer(OBJECT_ATTRIBUTES *attr,
                    const wchar_t *printable_path,
                    const struct wim_lookup_table_entry *lte,
                    u64 data_source_id,
                    const wchar_t *printable_path,
                    const struct wim_lookup_table_entry *lte,
                    u64 data_source_id,
index d5cfe4d807f6d7be6ccc26a00ea8d9afd0339bb0..914f20fbcbd66c02d645183661819e4e5c24296e 100644 (file)
@@ -1040,10 +1040,10 @@ out:
  * This turns it into a reparse point that redirects accesses to it, to the
  * corresponding resource in the WIM archive.
  *
  * This turns it into a reparse point that redirects accesses to it, to the
  * corresponding resource in the WIM archive.
  *
- * @name
- *     Path to extracted file (already created), NT namespace.
+ * @attr
+ *     Object attributes that specify the path to the file.
  * @printable_name
  * @printable_name
- *     Printable representation of @name.
+ *     Printable representation of the path encoded in @attr.
  * @lte
  *     Unnamed data stream of the file.
  * @data_source_id
  * @lte
  *     Unnamed data stream of the file.
  * @data_source_id
@@ -1057,7 +1057,7 @@ out:
  * Returns 0 on success, or a positive error code on failure.
  */
 int
  * Returns 0 on success, or a positive error code on failure.
  */
 int
-wimboot_set_pointer(UNICODE_STRING *name,
+wimboot_set_pointer(OBJECT_ATTRIBUTES *attr,
                    const wchar_t *printable_name,
                    const struct wim_lookup_table_entry *lte,
                    u64 data_source_id,
                    const wchar_t *printable_name,
                    const struct wim_lookup_table_entry *lte,
                    u64 data_source_id,
@@ -1067,16 +1067,11 @@ wimboot_set_pointer(UNICODE_STRING *name,
        int ret;
        HANDLE h = NULL;
        NTSTATUS status;
        int ret;
        HANDLE h = NULL;
        NTSTATUS status;
-       OBJECT_ATTRIBUTES attr;
        IO_STATUS_BLOCK iosb;
        DWORD bytes_returned;
        DWORD err;
 
        IO_STATUS_BLOCK iosb;
        DWORD bytes_returned;
        DWORD err;
 
-       memset(&attr, 0, sizeof(attr));
-       attr.Length = sizeof(attr);
-       attr.ObjectName = name;
-
-       status = (*func_NtOpenFile)(&h, GENERIC_WRITE | SYNCHRONIZE, &attr,
+       status = (*func_NtOpenFile)(&h, GENERIC_WRITE | SYNCHRONIZE, attr,
                                    &iosb, FILE_SHARE_VALID_FLAGS,
                                    FILE_OPEN_FOR_BACKUP_INTENT |
                                        FILE_OPEN_REPARSE_POINT |
                                    &iosb, FILE_SHARE_VALID_FLAGS,
                                    FILE_OPEN_FOR_BACKUP_INTENT |
                                        FILE_OPEN_REPARSE_POINT |
index f249197a39524a3624bda261c458a4c229936ac7..5c861c2cbcf88b81438b4b0dafeb14fdadfcf455 100644 (file)
@@ -1358,7 +1358,7 @@ begin_extract_stream_instance(const struct wim_lookup_table_entry *stream,
                } else {
                        FREE(dentry->_full_path);
                        dentry->_full_path = NULL;
                } else {
                        FREE(dentry->_full_path);
                        dentry->_full_path = NULL;
-                       return wimboot_set_pointer(&ctx->pathbuf,
+                       return wimboot_set_pointer(&ctx->attr,
                                                   current_path(ctx),
                                                   stream,
                                                   ctx->wimboot.data_source_id,
                                                   current_path(ctx),
                                                   stream,
                                                   ctx->wimboot.data_source_id,