X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fwin32_apply.c;h=26814f68eab5b3535b63ee2bb00e7550fbafa03f;hb=d619be5a9d45567a740875ed90ef617967772c44;hp=b66717ec78666a1d8654c9db0518e4230e66c3e8;hpb=277d7798255f0f5f63b5659cee55eba9d9d1054d;p=wimlib diff --git a/src/win32_apply.c b/src/win32_apply.c index b66717ec..26814f68 100644 --- a/src/win32_apply.c +++ b/src/win32_apply.c @@ -1370,6 +1370,20 @@ create_directory(const struct wim_dentry *dentry, struct win32_apply_ctx *ctx) return WIMLIB_ERR_MKDIR; } + if (ctx->iosb.Information == FILE_OPENED) { + /* If we opened an existing directory, try to clear its file + * attributes. As far as I know, this only actually makes a + * difference in the case where a FILE_ATTRIBUTE_READONLY + * directory has a named data stream which needs to be + * extracted. You cannot create a named data stream of such a + * directory, even though this contradicts Microsoft's + * documentation for FILE_ATTRIBUTE_READONLY which states it is + * not honored for directories! */ + FILE_BASIC_INFORMATION basic_info = { .FileAttributes = FILE_ATTRIBUTE_NORMAL }; + (*func_NtSetInformationFile)(h, &ctx->iosb, &basic_info, + sizeof(basic_info), FileBasicInformation); + } + if (!dentry_is_root(dentry)) { ret = set_short_name(h, dentry, ctx); if (ret)