-
- /* There is a volume flag for this (FILE_SUPPORTS_HARD_LINKS),
- * but it's only available on Windows 7 and later.
- *
- * Otherwise, CreateHardLinkW() will apparently return
- * ERROR_INVALID_FUNCTION if the volume does not support hard links. */
-
- DEBUG("Creating hard link \"%ls => %ls\"",
- output_path, inode->i_extracted_file);
-
- if (running_on_windows_7_or_later() &&
- !(args->vol_flags & FILE_SUPPORTS_HARD_LINKS))
- goto hard_links_unsupported;
-
- if (CreateHardLinkW(output_path, inode->i_extracted_file, NULL))
- return 0;
-
- err = GetLastError();
- if (err != ERROR_INVALID_FUNCTION) {
- ERROR("Can't create hard link \"%ls => %ls\"",
- output_path, inode->i_extracted_file);
- win32_error(err);
- return WIMLIB_ERR_LINK;
- }
-hard_links_unsupported:
- args->num_hard_links_failed++;
- if (args->num_hard_links_failed <= MAX_CREATE_HARD_LINK_WARNINGS) {
- if (running_on_windows_7_or_later())
- {
- WARNING("Extracting duplicate copy of \"%ls\" "
- "rather than hard link", output_path);
- } else {
- WARNING("Can't create hard link \"%ls\" => \"%ls\":\n"
- " Volume does not support hard links!\n"
- " Falling back to extracting a copy of the file.",
- output_path, inode->i_extracted_file);
- }
- }
- if (args->num_hard_links_failed == MAX_CREATE_HARD_LINK_WARNINGS)
- WARNING("Suppressing further hard linking warnings...");
- return -1;
-}
-
-/* Extract a file, directory, reparse point, or hard link to an
- * already-extracted file using the Win32 API */
-int
-win32_do_apply_dentry(const wchar_t *output_path,
- size_t output_path_num_chars,
- struct wim_dentry *dentry,
- struct apply_args *args)
-{