#include <sys/stat.h>
#include <unistd.h>
-#define WIMLIB_EXTRACT_FLAG_MULTI_IMAGE 0x80000000
-#define WIMLIB_EXTRACT_FLAG_FROM_PIPE 0x40000000
-#define WIMLIB_EXTRACT_FLAG_IMAGEMODE 0x20000000
+#define WIMLIB_EXTRACT_FLAG_FROM_PIPE 0x80000000
+#define WIMLIB_EXTRACT_FLAG_IMAGEMODE 0x40000000
/* Keep in sync with wimlib.h */
#define WIMLIB_EXTRACT_MASK_PUBLIC \
#define PWM_ALLOW_WIM_HDR 0x00001
-#define PWM_SILENT_EOF 0x00002
/* Read the header from a stream in a pipable WIM. */
static int
if (ret)
goto read_error;
- if ((flags & PWM_ALLOW_WIM_HDR) && buf.stream_hdr.magic == PWM_MAGIC) {
+ if ((flags & PWM_ALLOW_WIM_HDR) &&
+ le64_to_cpu(buf.stream_hdr.magic) == PWM_MAGIC)
+ {
BUILD_BUG_ON(sizeof(buf.pwm_hdr) < sizeof(buf.stream_hdr));
ret = full_read(&pwm->in_fd, &buf.stream_hdr + 1,
sizeof(buf.pwm_hdr) - sizeof(buf.stream_hdr));
return 0;
read_error:
- if (ret != WIMLIB_ERR_UNEXPECTED_END_OF_FILE || !(flags & PWM_SILENT_EOF))
- ERROR_WITH_ERRNO("Error reading pipable WIM from pipe");
+ ERROR_WITH_ERRNO("Error reading pipable WIM from pipe");
return ret;
}
if (dentry_is_root(dentry))
return 0;
+#ifdef WITH_NTFS_3G
if (ctx->extract_flags & WIMLIB_EXTRACT_FLAG_NTFS) {
dentry->d_extraction_name = dentry->file_name;
dentry->d_extraction_name_nchars = dentry->file_name_nbytes /
sizeof(utf16lechar);
return 0;
}
+#endif
if (!ctx->supported_features.case_sensitive_filenames) {
struct wim_dentry *other;
int image;
const tchar *image_name;
- extract_flags |= WIMLIB_EXTRACT_FLAG_MULTI_IMAGE;
-
if (extract_flags & WIMLIB_EXTRACT_FLAG_NTFS) {
ERROR("Cannot extract multiple images in NTFS extraction mode.");
return WIMLIB_ERR_INVALID_PARAM;