Lines Matching refs:primary_header
163 if (CGPT_OK != Load(drive, &drive->gpt.primary_header, in GptLoad()
175 GptHeader* primary_header = (GptHeader*)drive->gpt.primary_header; in GptLoad() local
176 if (CheckHeader(primary_header, 0, drive->gpt.streaming_drive_sectors, in GptLoad()
180 primary_header->entries_lba, in GptLoad()
182 CalculateEntriesSectors(primary_header))) { in GptLoad()
209 if (CGPT_OK != Save(drive, drive->gpt.primary_header, in GptSave()
225 GptHeader* primary_header = (GptHeader*)drive->gpt.primary_header; in GptSave() local
228 primary_header->entries_lba, in GptSave()
230 CalculateEntriesSectors(primary_header))) { in GptSave()
246 if (drive->gpt.primary_header) in GptSave()
247 free(drive->gpt.primary_header); in GptSave()
248 drive->gpt.primary_header = 0; in GptSave()
690 return (GptHeader*)gpt->primary_header; in GetGptHeader()
818 GptHeader *primary_header, *secondary_header; in UpdateCrc() local
820 primary_header = (GptHeader*)gpt->primary_header; in UpdateCrc()
824 memcmp(primary_header, GPT_HEADER_SIGNATURE2, in UpdateCrc()
826 size_t entries_size = primary_header->size_of_entry * in UpdateCrc()
827 primary_header->number_of_entries; in UpdateCrc()
828 primary_header->entries_crc32 = in UpdateCrc()
838 primary_header->header_crc32 = 0; in UpdateCrc()
839 primary_header->header_crc32 = Crc32( in UpdateCrc()
840 (const uint8_t *)primary_header, sizeof(GptHeader)); in UpdateCrc()
885 GptHeader* h = (GptHeader*)(gpt->primary_header); in RepairEntries()
890 h = (GptHeader*)gpt->primary_header; in RepairEntries()
938 GptHeader *primary_header, *secondary_header; in RepairHeader() local
940 primary_header = (GptHeader*)gpt->primary_header; in RepairHeader()
944 if (!IsSynonymous(primary_header, secondary_header)) { in RepairHeader()
945 CopySynonymousParts(secondary_header, primary_header); in RepairHeader()
949 memcpy(secondary_header, primary_header, sizeof(GptHeader)); in RepairHeader()
951 secondary_header->alternate_lba = primary_header->my_lba; in RepairHeader()
953 CalculateEntriesSectors(primary_header); in RepairHeader()
956 memcpy(primary_header, secondary_header, sizeof(GptHeader)); in RepairHeader()
957 primary_header->my_lba = GPT_PMBR_SECTORS; /* the second sector on drive */ in RepairHeader()
958 primary_header->alternate_lba = secondary_header->my_lba; in RepairHeader()
960 primary_header->entries_lba = primary_header->my_lba + GPT_HEADER_SECTORS; in RepairHeader()