X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fwin32_apply.c;h=fcb2c001abd128e77861b021b5e8fbf8a87eccd5;hb=f45c157ceb31b97c4393c57b65a0e9b8fc2a3630;hp=f249197a39524a3624bda261c458a4c229936ac7;hpb=cc7b6ee47d4037ae8fa11b4c2d5154091d543704;p=wimlib diff --git a/src/win32_apply.c b/src/win32_apply.c index f249197a..fcb2c001 100644 --- a/src/win32_apply.c +++ b/src/win32_apply.c @@ -482,7 +482,7 @@ build_win32_extraction_path(const struct wim_dentry *dentry, ctx->pathbuf.Length += ctx->target_ntpath.Length + sizeof(wchar_t); ctx->pathbuf.Buffer[ctx->pathbuf.Length / sizeof(wchar_t)] = L'\0'; - wimlib_assert(ctx->pathbuf.Length >= 8 && + wimlib_assert(ctx->pathbuf.Length >= 4 * sizeof(wchar_t) && !wmemcmp(ctx->pathbuf.Buffer, L"\\??\\", 4)); ctx->pathbuf.Buffer[1] = L'\\'; @@ -517,9 +517,18 @@ prepare_target(struct list_head *dentry_list, struct win32_apply_ctx *ctx) /* Open handle to the target directory (possibly creating it). */ - status = (*func_RtlDosPathNameToNtPathName_U_WithStatus)(ctx->common.target, - &ctx->target_ntpath, - NULL, NULL); + if (func_RtlDosPathNameToNtPathName_U_WithStatus) { + status = (*func_RtlDosPathNameToNtPathName_U_WithStatus)(ctx->common.target, + &ctx->target_ntpath, + NULL, NULL); + } else { + if ((*func_RtlDosPathNameToNtPathName_U)(ctx->common.target, + &ctx->target_ntpath, + NULL, NULL)) + status = STATUS_SUCCESS; + else + status = STATUS_NO_MEMORY; + } if (!NT_SUCCESS(status)) { if (status == STATUS_NO_MEMORY) { return WIMLIB_ERR_NOMEM; @@ -1344,21 +1353,21 @@ begin_extract_stream_instance(const struct wim_lookup_table_entry *stream, if (ret) return ret; if (in_prepopulate_list(dentry, ctx)) { - if (ctx->common.progress_func) { - union wimlib_progress_info info; + union wimlib_progress_info info; - info.wimboot_exclude.path_in_wim = dentry->_full_path; - info.wimboot_exclude.extraction_path = current_path(ctx); + info.wimboot_exclude.path_in_wim = dentry->_full_path; + info.wimboot_exclude.extraction_path = current_path(ctx); - ctx->common.progress_func(WIMLIB_PROGRESS_MSG_WIMBOOT_EXCLUDE, - &info); - FREE(dentry->_full_path); - dentry->_full_path = NULL; - } + ret = call_progress(ctx->common.progfunc, + WIMLIB_PROGRESS_MSG_WIMBOOT_EXCLUDE, + &info, ctx->common.progctx); + FREE(dentry->_full_path); + dentry->_full_path = NULL; + return ret; } else { FREE(dentry->_full_path); dentry->_full_path = NULL; - return wimboot_set_pointer(&ctx->pathbuf, + return wimboot_set_pointer(&ctx->attr, current_path(ctx), stream, ctx->wimboot.data_source_id, @@ -1761,7 +1770,10 @@ end_extract_stream(struct wim_lookup_table_entry *stream, int status, void *_ctx dentry = list_first_entry(&ctx->reparse_dentries, struct wim_dentry, tmp_list); build_extraction_path(dentry, ctx); - ERROR("Invalid reparse point", current_path(ctx)); + ERROR("Reparse data of \"%ls\" has size " + "%"PRIu64" bytes (exceeds %u bytes)", + current_path(ctx), stream->size, + REPARSE_DATA_MAX_SIZE); return WIMLIB_ERR_INVALID_REPARSE_DATA; } /* In the WIM format, reparse streams are just the reparse data