• Home
  • Raw
  • Download

Lines Matching refs:mainHeader

84    mainHeader.numParts = 0;  in GPTData()
85 mainHeader.lastUsableLBA = 0; in GPTData()
96 mainHeader = orig.mainHeader; in GPTData()
148 mainHeader.numParts = 0; in GPTData()
149 mainHeader.lastUsableLBA = 0; in GPTData()
167 mainHeader = orig.mainHeader; in operator =()
249 if (mainHeader.currentLBA != 1) { in Verify()
254 mainHeader.currentLBA = 1; in Verify()
265 if (mainHeader.currentLBA != secondHeader.backupLBA) { in Verify()
267 cout << "\nProblem: main GPT header's current LBA pointer (" << mainHeader.currentLBA in Verify()
271 if (mainHeader.backupLBA != secondHeader.currentLBA) { in Verify()
273 cout << "\nProblem: main GPT header's backup LBA pointer (" << mainHeader.backupLBA in Verify()
278 if (mainHeader.firstUsableLBA != secondHeader.firstUsableLBA) { in Verify()
280 cout << "\nProblem: main GPT header's first usable LBA pointer (" << mainHeader.firstUsableLBA in Verify()
284 if (mainHeader.lastUsableLBA != secondHeader.lastUsableLBA) { in Verify()
286 cout << "\nProblem: main GPT header's last usable LBA pointer (" << mainHeader.lastUsableLBA in Verify()
291 if ((mainHeader.diskGUID != secondHeader.diskGUID)) { in Verify()
293 cout << "\nProblem: main header's disk GUID (" << mainHeader.diskGUID in Verify()
299 if (mainHeader.numParts != secondHeader.numParts) { in Verify()
301 cout << "\nProblem: main GPT header's number of partitions (" << mainHeader.numParts in Verify()
306 if (mainHeader.sizeOfPartitionEntries != secondHeader.sizeOfPartitionEntries) { in Verify()
309 << mainHeader.sizeOfPartitionEntries << ") doesn't\n" in Verify()
318 if (mainHeader.backupLBA >= diskSize) { in Verify()
322 << mainHeader.backupLBA + UINT64_C(1) << " sectors.)\n" in Verify()
327 if (mainHeader.partitionEntriesLBA + GetTableSizeInSectors() > mainHeader.firstUsableLBA) { in Verify()
332 if (mainHeader.partitionEntriesLBA < 2) { in Verify()
342 if (mainHeader.partitionEntriesLBA != 2) { in Verify()
344 << "partition table (sector " << mainHeader.partitionEntriesLBA in Verify()
349 if (mainHeader.partitionEntriesLBA + GetTableSizeInSectors() != mainHeader.firstUsableLBA) { in Verify()
351 << mainHeader.partitionEntriesLBA + GetTableSizeInSectors() - 1 << ")\n" in Verify()
352 …<< "and the first usable sector (" << mainHeader.firstUsableLBA << "). This is helpful in some exo… in Verify()
357 if (mainHeader.sizeOfPartitionEntries * mainHeader.numParts < 16384) { in Verify()
358 …<< "\nWarning: The size of the partition table (" << mainHeader.sizeOfPartitionEntries * mainHeade… in Verify()
365 … if ((mainHeader.lastUsableLBA >= diskSize) || (mainHeader.lastUsableLBA > mainHeader.backupLBA)) { in Verify()
368 << "sector is " << mainHeader.lastUsableLBA << ", but backup header is at\n" in Verify()
369 << mainHeader.backupLBA << " and disk size is " << diskSize << " sectors.\n" in Verify()
468 if (mainHeader.firstUsableLBA > firstUsedBlock) { in CheckGPTSize()
469 overlap = mainHeader.firstUsableLBA - firstUsedBlock; in CheckGPTSize()
480 if (mainHeader.lastUsableLBA < lastUsedBlock) { in CheckGPTSize()
481 overlap = lastUsedBlock - mainHeader.lastUsableLBA; in CheckGPTSize()
508 if ((mainHeader.signature != GPT_SIGNATURE) || (!CheckHeaderCRC(&mainHeader, 1))) { in CheckHeaderValidity()
510 } else if ((mainHeader.revision != 0x00010000) && valid) { in CheckHeaderValidity()
514 cout << hex << mainHeader.revision << ", should be\n0x"; in CheckHeaderValidity()
531 if (((mainHeader.signature << 32) == APM_SIGNATURE1) || in CheckHeaderValidity()
532 (mainHeader.signature << 32) == APM_SIGNATURE2) { in CheckHeaderValidity()
598 if (mainHeader.headerSize > sizeof(GPTHeader)) in RecomputeCRCs()
599 hSize = secondHeader.headerSize = mainHeader.headerSize = HEADER_SIZE; in RecomputeCRCs()
601 hSize = secondHeader.headerSize = mainHeader.headerSize; in RecomputeCRCs()
605 ReverseHeaderBytes(&mainHeader); in RecomputeCRCs()
611 mainHeader.partitionEntriesCRC = crc; in RecomputeCRCs()
614 ReverseBytes(&mainHeader.partitionEntriesCRC, 4); in RecomputeCRCs()
619 mainHeader.headerCRC = 0; in RecomputeCRCs()
622 crc = chksum_crc32((unsigned char*) &mainHeader, hSize); in RecomputeCRCs()
625 mainHeader.headerCRC = crc; in RecomputeCRCs()
632 ReverseHeaderBytes(&mainHeader); in RecomputeCRCs()
641 mainHeader.signature = GPT_SIGNATURE; in RebuildMainHeader()
642 mainHeader.revision = secondHeader.revision; in RebuildMainHeader()
643 mainHeader.headerSize = secondHeader.headerSize; in RebuildMainHeader()
644 mainHeader.headerCRC = UINT32_C(0); in RebuildMainHeader()
645 mainHeader.reserved = secondHeader.reserved; in RebuildMainHeader()
646 mainHeader.currentLBA = secondHeader.backupLBA; in RebuildMainHeader()
647 mainHeader.backupLBA = secondHeader.currentLBA; in RebuildMainHeader()
648 mainHeader.firstUsableLBA = secondHeader.firstUsableLBA; in RebuildMainHeader()
649 mainHeader.lastUsableLBA = secondHeader.lastUsableLBA; in RebuildMainHeader()
650 mainHeader.diskGUID = secondHeader.diskGUID; in RebuildMainHeader()
651 mainHeader.numParts = secondHeader.numParts; in RebuildMainHeader()
652 mainHeader.partitionEntriesLBA = secondHeader.firstUsableLBA - GetTableSizeInSectors(); in RebuildMainHeader()
653 mainHeader.sizeOfPartitionEntries = secondHeader.sizeOfPartitionEntries; in RebuildMainHeader()
654 mainHeader.partitionEntriesCRC = secondHeader.partitionEntriesCRC; in RebuildMainHeader()
655 memcpy(mainHeader.reserved2, secondHeader.reserved2, sizeof(mainHeader.reserved2)); in RebuildMainHeader()
657 SetGPTSize(mainHeader.numParts, 0); in RebuildMainHeader()
663 secondHeader.revision = mainHeader.revision; in RebuildSecondHeader()
664 secondHeader.headerSize = mainHeader.headerSize; in RebuildSecondHeader()
666 secondHeader.reserved = mainHeader.reserved; in RebuildSecondHeader()
667 secondHeader.currentLBA = mainHeader.backupLBA; in RebuildSecondHeader()
668 secondHeader.backupLBA = mainHeader.currentLBA; in RebuildSecondHeader()
669 secondHeader.firstUsableLBA = mainHeader.firstUsableLBA; in RebuildSecondHeader()
670 secondHeader.lastUsableLBA = mainHeader.lastUsableLBA; in RebuildSecondHeader()
671 secondHeader.diskGUID = mainHeader.diskGUID; in RebuildSecondHeader()
673 secondHeader.numParts = mainHeader.numParts; in RebuildSecondHeader()
674 secondHeader.sizeOfPartitionEntries = mainHeader.sizeOfPartitionEntries; in RebuildSecondHeader()
675 secondHeader.partitionEntriesCRC = mainHeader.partitionEntriesCRC; in RebuildSecondHeader()
676 memcpy(secondHeader.reserved2, mainHeader.reserved2, sizeof(secondHeader.reserved2)); in RebuildSecondHeader()
916 allOK = LoadHeader(&mainHeader, myDisk, 1, &mainCrcOk); in ForceLoadGPTData()
918 if (mainCrcOk && (mainHeader.backupLBA < diskSize)) { in ForceLoadGPTData()
919 allOK = LoadHeader(&secondHeader, myDisk, mainHeader.backupLBA, &secondCrcOk) && allOK; in ForceLoadGPTData()
922 if (mainCrcOk && (mainHeader.backupLBA >= diskSize)) in ForceLoadGPTData()
981 mainPartsCrcOk = CheckTable(&mainHeader); in ForceLoadGPTData()
1029 return LoadPartitionTable(mainHeader, myDisk); in LoadMainTable()
1154 if (header == &mainHeader) in CheckTable()
1157 otherHeader = &mainHeader; in CheckTable()
1188 if (mainHeader.backupLBA >= diskSize) { in SaveGPTData()
1202 if (mainHeader.backupLBA < (diskSize - UINT64_C(1))) { in SaveGPTData()
1217 … if ((mainHeader.lastUsableLBA >= diskSize) || (mainHeader.lastUsableLBA > mainHeader.backupLBA)) { in SaveGPTData()
1273 allOK = allOK && SaveHeader(&secondHeader, myDisk, mainHeader.backupLBA); in SaveGPTData()
1276 allOK = allOK && SavePartitionTable(myDisk, mainHeader.partitionEntriesLBA); in SaveGPTData()
1279 allOK = allOK && SaveHeader(&mainHeader, myDisk, 1); in SaveGPTData()
1338 allOK = SaveHeader(&mainHeader, backupFile, 1); in SaveGPTBackup()
1393 if (disk.Write(partitions, mainHeader.sizeOfPartitionEntries * numParts) == -1) in SavePartitionTable()
1415 LoadHeader(&mainHeader, backupFile, 1, &mainCrcOk); in LoadGPTBackup()
1422 (mainHeader.numParts * mainHeader.sizeOfPartitionEntries) + 1024); in LoadGPTBackup()
1439 SetGPTSize(mainHeader.numParts, 0); in LoadGPTBackup()
1448 if (!LoadPartitionTable(mainHeader, backupFile, (uint64_t) (3 - shortBackup))) in LoadGPTBackup()
1484 if (!myDisk.Seek(mainHeader.currentLBA)) in DestroyGPT()
1490 if (!myDisk.Seek(mainHeader.partitionEntriesLBA)) in DestroyGPT()
1492 tableSize = numParts * mainHeader.sizeOfPartitionEntries; in DestroyGPT()
1589 cout << "Disk identifier (GUID): " << mainHeader.diskGUID << "\n"; in DisplayGPTData()
1591 cout << "Main partition table begins at sector " << mainHeader.partitionEntriesLBA in DisplayGPTData()
1592 … << " and ends at sector " << mainHeader.partitionEntriesLBA + GetTableSizeInSectors() - 1 << "\n"; in DisplayGPTData()
1593 cout << "First usable sector is " << mainHeader.firstUsableLBA in DisplayGPTData()
1594 << ", last usable sector is " << mainHeader.lastUsableLBA << "\n"; in DisplayGPTData()
1884 mainHeader.firstUsableLBA = GetTableSizeInSectors() + mainHeader.partitionEntriesLBA; in SetGPTSize()
1885 secondHeader.firstUsableLBA = mainHeader.firstUsableLBA; in SetGPTSize()
1894 mainHeader.numParts = numParts; in SetGPTSize()
1906 mainHeader.partitionEntriesLBA = pteSector; in MoveMainTable()
1907 mainHeader.firstUsableLBA = pteSector + pteSize; in MoveMainTable()
2014 mainHeader.signature = GPT_SIGNATURE; in ClearGPTData()
2015 mainHeader.revision = 0x00010000; in ClearGPTData()
2016 mainHeader.headerSize = HEADER_SIZE; in ClearGPTData()
2017 mainHeader.reserved = 0; in ClearGPTData()
2018 mainHeader.currentLBA = UINT64_C(1); in ClearGPTData()
2019 mainHeader.partitionEntriesLBA = (uint64_t) 2; in ClearGPTData()
2020 mainHeader.sizeOfPartitionEntries = GPT_SIZE; in ClearGPTData()
2021 mainHeader.firstUsableLBA = GetTableSizeInSectors() + mainHeader.partitionEntriesLBA; in ClearGPTData()
2023 mainHeader.reserved2[i] = '\0'; in ClearGPTData()
2031 mainHeader.backupLBA = diskSize - UINT64_C(1); in ClearGPTData()
2032 mainHeader.lastUsableLBA = diskSize - mainHeader.firstUsableLBA; in ClearGPTData()
2035 mainHeader.diskGUID.Randomize(); in ClearGPTData()
2060 mainHeader.backupLBA = secondHeader.currentLBA = diskSize - UINT64_C(1); in MoveSecondHeaderToEnd()
2061 if (mainHeader.lastUsableLBA != diskSize - mainHeader.firstUsableLBA) { in MoveSecondHeaderToEnd()
2069 mainHeader.lastUsableLBA = secondHeader.lastUsableLBA = diskSize - mainHeader.firstUsableLBA; in MoveSecondHeaderToEnd()
2090 mainHeader.diskGUID = newGUID; in SetDiskGUID()
2114 mainHeader.diskGUID.Randomize(); in RandomizeGUIDs()
2115 secondHeader.diskGUID = mainHeader.diskGUID; in RandomizeGUIDs()
2163 if (earlier >= mainHeader.firstUsableLBA) { in Align()
2175 if ((sectorOK != 1) && (later <= mainHeader.lastUsableLBA)) { in Align()
2264 if (start < mainHeader.firstUsableLBA) in FindFirstAvailable()
2265 first = mainHeader.firstUsableLBA; in FindFirstAvailable()
2284 if (first > mainHeader.lastUsableLBA) in FindFirstAvailable()
2332 last = mainHeader.lastUsableLBA; in FindLastAvailable()
2348 if (last < mainHeader.firstUsableLBA) in FindLastAvailable()
2362 nearestEnd = mainHeader.lastUsableLBA; in FindLastInFree()
2424 if ((sector < mainHeader.firstUsableLBA) || in IsFree()
2425 (sector > mainHeader.lastUsableLBA)) { in IsFree()
2568 return mainHeader.diskGUID; in GetDiskGUID()