X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fwimboot.c;h=67798da3fd02f0deefc8591fd915f98509246a67;hb=8df639463ae0c754d2b1af3d6c1d22e59ee3ccf8;hp=9a61ba510bab13075ef60e40ceab270fcae47336;hpb=b8ebc57d493d7b6e660a50f7789fcb5451f5d77d;p=wimlib diff --git a/src/wimboot.c b/src/wimboot.c index 9a61ba51..67798da3 100644 --- a/src/wimboot.c +++ b/src/wimboot.c @@ -36,8 +36,9 @@ #include "wimlib/win32_common.h" #include "wimlib/assert.h" +#include "wimlib/blob_table.h" +#include "wimlib/inode.h" #include "wimlib/error.h" -#include "wimlib/lookup_table.h" #include "wimlib/util.h" #include "wimlib/wimboot.h" #include "wimlib/win32.h" @@ -346,7 +347,7 @@ static u8 * fill_in_wimoverlay_dat(u8 *buf, const struct WimOverlay_dat_header *old_hdr, const wchar_t *wim_path, - const u8 wim_guid[WIM_GUID_LEN], + const u8 wim_guid[GUID_SIZE], int image, u64 new_data_source_id, const PARTITION_INFORMATION_EX *part_info, @@ -394,8 +395,8 @@ fill_in_wimoverlay_dat(u8 *buf, new_entry_1->entry_2_length = new_entry_2_size; new_entry_1->wim_type = WIM_BOOT_NOT_OS_WIM; new_entry_1->wim_index = image; - BUILD_BUG_ON(sizeof(new_entry_1->guid) != WIM_GUID_LEN); - memcpy(new_entry_1->guid, wim_guid, WIM_GUID_LEN); + BUILD_BUG_ON(sizeof(new_entry_1->guid) != GUID_SIZE); + copy_guid(new_entry_1->guid, wim_guid); p += sizeof(struct WimOverlay_dat_entry_1); @@ -491,7 +492,7 @@ fill_in_wimoverlay_dat(u8 *buf, static int prepare_wimoverlay_dat(const struct WimOverlay_dat_header *old_hdr, const wchar_t *wim_path, - const u8 wim_guid[WIM_GUID_LEN], + const u8 wim_guid[GUID_SIZE], int image, void **new_contents_ret, u32 *new_contents_size_ret, @@ -790,7 +791,7 @@ out_free_contents: */ static int update_wimoverlay_manually(const wchar_t *drive, const wchar_t *wim_path, - const u8 wim_guid[WIM_GUID_LEN], + const u8 wim_guid[GUID_SIZE], int image, u64 *data_source_id_ret) { wchar_t path_main[] = L"A:\\System Volume Information\\WimOverlay.dat"; @@ -926,7 +927,7 @@ try_to_attach_wof(const wchar_t *drive) */ int wimboot_alloc_data_source_id(const wchar_t *wim_path, - const u8 wim_guid[WIM_GUID_LEN], + const u8 wim_guid[GUID_SIZE], int image, const wchar_t *target, u64 *data_source_id_ret, bool *wof_running_ret) { @@ -1057,12 +1058,12 @@ out: * * @h * Open handle to the file, with GENERIC_WRITE access. - * @lte - * Unnamed data stream of the file. + * @blob + * The blob for the unnamed data stream of the file. * @data_source_id * Allocated identifier for the WIM data source on the destination volume. - * @lookup_table_hash - * SHA-1 message digest of the WIM's lookup table. + * @blob_table_hash + * SHA-1 message digest of the WIM's blob table. * @wof_running * %true if the WOF driver appears to be available and working; %false if * not. @@ -1071,9 +1072,9 @@ out: */ bool wimboot_set_pointer(HANDLE h, - const struct wim_lookup_table_entry *lte, + const struct blob_descriptor *blob, u64 data_source_id, - const u8 lookup_table_hash[SHA1_HASH_SIZE], + const u8 blob_table_hash[SHA1_HASH_SIZE], bool wof_running) { DWORD bytes_returned; @@ -1096,9 +1097,9 @@ wimboot_set_pointer(HANDLE h, in.wim_info.version = WIM_PROVIDER_CURRENT_VERSION; in.wim_info.flags = 0; in.wim_info.data_source_id = data_source_id; - copy_hash(in.wim_info.resource_hash, lte->hash); + copy_hash(in.wim_info.unnamed_data_stream_hash, blob->hash); - /* lookup_table_hash is not necessary */ + /* blob_table_hash is not necessary */ if (!DeviceIoControl(h, FSCTL_SET_EXTERNAL_BACKING, &in, sizeof(in), NULL, 0, @@ -1138,7 +1139,7 @@ wimboot_set_pointer(HANDLE h, sizeof(struct wof_external_info) + sizeof(struct wim_provider_rpdata)); - in.hdr.rptag = WIMLIB_REPARSE_TAG_WOF; + in.hdr.rptag = WIM_IO_REPARSE_TAG_WOF; in.hdr.rpdatalen = sizeof(in) - sizeof(in.hdr); in.hdr.rpreserved = 0; @@ -1148,11 +1149,11 @@ wimboot_set_pointer(HANDLE h, in.wim_info.version = 2; in.wim_info.flags = 0; in.wim_info.data_source_id = data_source_id; - copy_hash(in.wim_info.resource_hash, lte->hash); - copy_hash(in.wim_info.wim_lookup_table_hash, lookup_table_hash); - in.wim_info.stream_uncompressed_size = lte->size; - in.wim_info.stream_compressed_size = lte->rspec->size_in_wim; - in.wim_info.stream_offset_in_wim = lte->rspec->offset_in_wim; + copy_hash(in.wim_info.unnamed_data_stream_hash, blob->hash); + copy_hash(in.wim_info.blob_table_hash, blob_table_hash); + in.wim_info.unnamed_data_stream_size = blob->size; + in.wim_info.unnamed_data_stream_size_in_wim = blob->rdesc->size_in_wim; + in.wim_info.unnamed_data_stream_offset_in_wim = blob->rdesc->offset_in_wim; if (!DeviceIoControl(h, FSCTL_SET_REPARSE_POINT, &in, sizeof(in), NULL, 0, &bytes_returned, NULL)) @@ -1167,7 +1168,7 @@ wimboot_set_pointer(HANDLE h, return false; if (!SetFilePointerEx(h, - (LARGE_INTEGER){ .QuadPart = lte->size}, + (LARGE_INTEGER){ .QuadPart = blob->size}, NULL, FILE_BEGIN)) return false;