- struct apply_args *args = arg;
- struct wim_inode *inode = dentry->d_inode;
- size_t len;
-
- len = strlen(args->target);
- char output_path[len + dentry->full_path_utf8_len + 1];
- memcpy(output_path, args->target, len);
- memcpy(output_path + len, dentry->full_path_utf8, dentry->full_path_utf8_len);
- output_path[len + dentry->full_path_utf8_len] = '\0';
-
-#if defined(__CYGWIN__) || defined(__WIN32__)
- char *utf16_path;
- size_t utf16_path_len;
- DWORD err;
- int ret;
- ret = utf8_to_utf16(output_path, len + dentry->full_path_utf8_len,
- &utf16_path, &utf16_path_len);
- if (ret)
- return ret;
-
- if (inode->i_nlink > 1 && inode->i_extracted_file != NULL) {
- /* Linked file, with another name already extracted */
- if (!CreateHardLinkW((const wchar_t*)inode->i_extracted_file,
- (const wchar_t*)utf16_path,
- NULL))
- {
- err = GetLastError();
- ERROR("Can't create hard link \"%s\"", output_path);
- ret = WIMLIB_ERR_LINK;
- win32_error(err);
- goto out_free_utf16_path;
- }
- ret = 0;
- goto out_free_utf16_path;
- }
- ret = win32_extract_streams(inode, (const wchar_t*)utf16_path,
- output_path);
- if (ret)
- goto out_free_utf16_path;
-
- if (inode->i_security_id != -1) {
- ret = win32_set_security_data(inode,
- (const wchar_t*)utf16_path,
- wim_const_security_data(args->w),
- output_path);
- if (ret)
- goto out_free_utf16_path;
- }
-
- /*if (inode->i_attributes & FILE_ATTRIBUTE_REPARSE_POINT) {*/
- /*ret = win32_set_reparse_data(inode, path, output_path);*/
- /*if (ret)*/
- /*goto out_free_utf16_path;*/
- /*}*/