goto fail_close_handle;
} else {
if (lte) {
- DEBUG("Extracting \"%ls\" (len = %zu)",
+ DEBUG("Extracting \"%ls\" (len = %"PRIu64")",
stream_path, wim_resource_size(lte));
ret = do_win32_extract_stream(h, lte);
if (ret)
size_t utf16_path_len;
DWORD err;
HANDLE h;
- BOOL bret1, bret2;
ret = utf8_to_utf16(output_path, len, &utf16_path, &utf16_path_len);
if (ret)
return ret;
- DEBUG("Opening \"%ls\" to set timestamps", utf16_path);
+ DEBUG("Opening \"%s\" to set timestamps", output_path);
h = CreateFileW((const wchar_t*)utf16_path,
GENERIC_WRITE | WRITE_OWNER | WRITE_DAC | ACCESS_SYSTEM_SECURITY,
FILE_SHARE_READ,
if (h == INVALID_HANDLE_VALUE)
goto fail;
- FILETIME creationTime = {.dwLowDateTime = dentry->d_inode->i_creation_time & 0xffffffff,
- .dwHighDateTime = dentry->d_inode->i_creation_time >> 32};
- FILETIME lastAccessTime = {.dwLowDateTime = dentry->d_inode->i_last_access_time & 0xffffffff,
- .dwHighDateTime = dentry->d_inode->i_last_access_time >> 32};
- FILETIME lastWriteTime = {.dwLowDateTime = dentry->d_inode->i_last_write_time & 0xffffffff,
- .dwHighDateTime = dentry->d_inode->i_last_write_time >> 32};
+ FILETIME creationTime = {.dwLowDateTime = inode->i_creation_time & 0xffffffff,
+ .dwHighDateTime = inode->i_creation_time >> 32};
+ FILETIME lastAccessTime = {.dwLowDateTime = inode->i_last_access_time & 0xffffffff,
+ .dwHighDateTime = inode->i_last_access_time >> 32};
+ FILETIME lastWriteTime = {.dwLowDateTime = inode->i_last_write_time & 0xffffffff,
+ .dwHighDateTime = inode->i_last_write_time >> 32};
DEBUG("Calling SetFileTime() on \"%s\"", output_path);
if (!SetFileTime(h, &creationTime, &lastAccessTime, &lastWriteTime)) {
w->lookup_table = joined_tab;
}
+#if defined(__CYGWIN__) || defined(__WIN32__)
+ win32_acquire_privilege(SE_RESTORE_NAME);
+ win32_acquire_privilege(SE_SECURITY_NAME);
+ win32_acquire_privilege(SE_TAKE_OWNERSHIP_NAME);
+#endif
if (image == WIMLIB_ALL_IMAGES) {
extract_flags |= WIMLIB_EXTRACT_FLAG_MULTI_IMAGE;
ret = extract_all_images(w, target, extract_flags,
ret = extract_single_image(w, image, target, extract_flags,
progress_func);
}
+#if defined(__CYGWIN__) || defined(__WIN32__)
+ win32_release_privilege(SE_RESTORE_NAME);
+ win32_release_privilege(SE_SECURITY_NAME);
+ win32_release_privilege(SE_TAKE_OWNERSHIP_NAME);
+#endif
if (extract_flags & (WIMLIB_EXTRACT_FLAG_SYMLINK |
WIMLIB_EXTRACT_FLAG_HARDLINK))