* along with wimlib; if not, see http://www.gnu.org/licenses/.
*/
+#ifdef __WIN32__
#ifdef HAVE_CONFIG_H
# include "config.h"
if (wimlib_print_errors) {
print_byte_field((const u8 *)hdr,
sizeof(struct WimOverlay_dat_header),
- stderr);
- fputc('\n', stderr);
+ wimlib_error_file);
+ fputc('\n', wimlib_error_file);
}
ret = WIMLIB_ERR_UNSUPPORTED;
goto out_free_contents;
path, i, entry_1->data_source_id);
if (wimlib_print_errors) {
print_byte_field((const u8 *)entry_2->wim_file_name,
- wim_file_name_length, stderr);
- fputc('\n', stderr);
+ wim_file_name_length,
+ wimlib_error_file);
+ fputc('\n', wimlib_error_file);
}
ret = WIMLIB_ERR_UNSUPPORTED;
goto out_free_contents;
if (wimlib_print_errors) {
print_byte_field((const u8 *)entry_2,
entry_1->entry_2_length,
- stderr);
- fputc('\n', stderr);
+ wimlib_error_file);
+ fputc('\n', wimlib_error_file);
}
ret = WIMLIB_ERR_UNSUPPORTED;
goto out_free_contents;
if (ret) {
ERROR_WITH_ERRNO("Can't rename \"%ls\" => \"%ls\"",
path_main, path_wimlib_backup);
+ ret = WIMLIB_ERR_RENAME;
goto out_free_new_contents;
}
}
if (ret) {
ERROR_WITH_ERRNO("Can't rename \"%ls\" => \"%ls\"",
path_new, path_main);
+ ret = WIMLIB_ERR_RENAME;
}
out_free_new_contents:
FREE(new_contents);
* 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 representation of @name.
+ * Printable representation of the path encoded in @attr.
* @lte
* Unnamed data stream of the file.
* @data_source_id
* 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,
int ret;
HANDLE h = NULL;
NTSTATUS status;
- OBJECT_ATTRIBUTES attr;
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 |
return ret;
}
+
+#endif /* __WIN32__ */