X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fwin32_apply.c;h=c8f65ef0e2db218c4a1ba203c04900497bcee6af;hb=d9675dd5814394373d9871c6e9b7b35325b3d21d;hp=4c66575280f431109810bc244ef8f0f47f227a7b;hpb=51f8edf82794f07055e3d9bcc8cd51bf0d86fae0;p=wimlib diff --git a/src/win32_apply.c b/src/win32_apply.c index 4c665752..c8f65ef0 100644 --- a/src/win32_apply.c +++ b/src/win32_apply.c @@ -195,8 +195,7 @@ win32_extract_stream(const wchar_t *path, const wchar_t *stream_name, ret = 0; if (!lte) goto out_close_handle; - ret = extract_wim_resource(lte, wim_resource_size(lte), - win32_extract_wim_chunk, h); + ret = extract_stream(lte, lte->size, win32_extract_wim_chunk, h); out_close_handle: if (!CloseHandle(h)) goto error; @@ -239,9 +238,9 @@ win32_encrypted_import_cb(unsigned char *data, void *_import_ctx, unsigned long len = *len_p; const struct wim_lookup_table_entry *lte = import_ctx->lte; - len = min(len, wim_resource_size(lte) - import_ctx->offset); + len = min(len, lte->size - import_ctx->offset); - if (read_partial_wim_resource_into_buf(lte, len, import_ctx->offset, data)) + if (read_partial_wim_stream_into_buf(lte, len, import_ctx->offset, data)) return ERROR_READ_FAULT; import_ctx->offset += len; @@ -531,6 +530,7 @@ win32_set_security_descriptor(const wchar_t *path, const u8 *desc, ctx->no_security_descriptors++; break; } + SetLastError(err); goto error; } ret = 0;