X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fwin32_apply.c;h=c91315cf2f162695d24d9703dc03f8b40c6de95f;hb=f2f293a1759c81e7bd5deb904c3909368f3feaa5;hp=dcec1c5d558e5a181bdf701dc1b90cbc930f3846;hpb=8f2b2ae78181c9ba6b107df623c514cadce602bb;p=wimlib diff --git a/src/win32_apply.c b/src/win32_apply.c index dcec1c5d..c91315cf 100644 --- a/src/win32_apply.c +++ b/src/win32_apply.c @@ -23,13 +23,22 @@ #ifdef __WIN32__ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include /* for SetSecurityInfo() */ -#include "win32_common.h" -#include "wimlib_internal.h" -#include "dentry.h" -#include "lookup_table.h" -#include "endianness.h" +#include "wimlib/win32_common.h" + +#include "wimlib/apply.h" +#include "wimlib/dentry.h" +#include "wimlib/endianness.h" +#include "wimlib/error.h" +#include "wimlib/lookup_table.h" +#include "wimlib/metadata.h" +#include "wimlib/reparse.h" +#include "wimlib/security.h" #define MAX_CREATE_HARD_LINK_WARNINGS 5 #define MAX_CREATE_SOFT_LINK_WARNINGS 5 @@ -144,10 +153,11 @@ win32_set_reparse_data(HANDLE h, int ret; u8 rpbuf[REPARSE_POINT_MAX_SIZE]; DWORD bytesReturned; + u16 rpbuflen; DEBUG("Setting reparse data on \"%ls\"", path); - ret = wim_inode_get_reparse_data(inode, rpbuf); + ret = wim_inode_get_reparse_data(inode, rpbuf, &rpbuflen); if (ret) return ret; @@ -185,7 +195,7 @@ win32_set_reparse_data(HANDLE h, * "Not used with this operation; set to NULL." */ if (!DeviceIoControl(h, FSCTL_SET_REPARSE_POINT, rpbuf, - 8 + le16_to_cpu(*(u16*)(rpbuf + 4)), + rpbuflen, NULL, 0, &bytesReturned /* lpBytesReturned */, NULL /* lpOverlapped */)) @@ -668,7 +678,6 @@ win32_finish_extract_stream(HANDLE h, const struct wim_dentry *dentry, { int ret = 0; const struct wim_inode *inode = dentry->d_inode; - const wchar_t *short_name; if (stream_name_utf16 == NULL) { /* Unnamed stream. */ @@ -724,7 +733,7 @@ win32_finish_extract_stream(HANDLE h, const struct wim_dentry *dentry, } if (dentry_has_short_name(dentry)) - SetFileShortNameW(h, short_name); + SetFileShortNameW(h, dentry->short_name); else if (running_on_windows_7_or_later()) SetFileShortNameW(h, L""); } else { @@ -1089,7 +1098,7 @@ win32_check_vol_flags(const wchar_t *output_path, win32_get_vol_flags(output_path, &args->vol_flags); args->have_vol_flags = true; - missing_features = dentry_features ^ args->vol_flags; + missing_features = dentry_features & ~args->vol_flags; /* Warn the user about data that may not be extracted. */ if (missing_features & FILE_SUPPORTS_SPARSE_FILES)