+#endif /* !__WIN32__ */
+
+/* Extracts a file, directory, or symbolic link from the WIM archive. */
+static int
+apply_dentry_normal(struct wim_dentry *dentry, void *arg)
+{
+ struct apply_args *args = arg;
+ size_t len;
+ tchar *output_path;
+
+ len = tstrlen(args->target);
+ if (dentry_is_root(dentry)) {
+ output_path = (tchar*)args->target;
+ } else {
+ output_path = alloca(len * sizeof(tchar) + dentry->full_path_nbytes +
+ sizeof(tchar));
+ memcpy(output_path, args->target, len * sizeof(tchar));
+ memcpy(output_path + len, dentry->_full_path, dentry->full_path_nbytes);
+ len += dentry->full_path_nbytes / sizeof(tchar);
+ output_path[len] = T('\0');
+ }
+#ifdef __WIN32__
+ return win32_do_apply_dentry(output_path, len, dentry, args);
+#else
+ return unix_do_apply_dentry(output_path, len, dentry, args);
+#endif
+}
+
+
+/* Apply timestamps to an extracted file or directory */
+static int
+apply_dentry_timestamps_normal(struct wim_dentry *dentry, void *arg)
+{
+ struct apply_args *args = arg;
+ size_t len;
+ tchar *output_path;
+
+ len = tstrlen(args->target);
+ if (dentry_is_root(dentry)) {
+ output_path = (tchar*)args->target;
+ } else {
+ output_path = alloca(len * sizeof(tchar) + dentry->full_path_nbytes +
+ sizeof(tchar));
+ memcpy(output_path, args->target, len * sizeof(tchar));
+ memcpy(output_path + len, dentry->_full_path, dentry->full_path_nbytes);
+ len += dentry->full_path_nbytes / sizeof(tchar);
+ output_path[len] = T('\0');
+ }
+
+#ifdef __WIN32__
+ return win32_do_apply_dentry_timestamps(output_path, len, dentry, args);
+#else
+ return unix_do_apply_dentry_timestamps(output_path, len, dentry, args);
+#endif
+}