Lines Matching refs:secondHeader
124 secondHeader = orig.secondHeader; in operator =()
209 if (secondHeader.currentLBA != (diskSize - UINT64_C(1))) { in Verify()
218 if (mainHeader.currentLBA != secondHeader.backupLBA) { in Verify()
222 << secondHeader.backupLBA << ").\n"; in Verify()
224 if (mainHeader.backupLBA != secondHeader.currentLBA) { in Verify()
228 << secondHeader.currentLBA << ").\n" in Verify()
231 if (mainHeader.firstUsableLBA != secondHeader.firstUsableLBA) { in Verify()
235 << secondHeader.firstUsableLBA << ")\n"; in Verify()
237 if (mainHeader.lastUsableLBA != secondHeader.lastUsableLBA) { in Verify()
241 << secondHeader.lastUsableLBA << ")\n" in Verify()
244 if ((mainHeader.diskGUID != secondHeader.diskGUID)) { in Verify()
248 << secondHeader.diskGUID << ")\n" in Verify()
252 if (mainHeader.numParts != secondHeader.numParts) { in Verify()
256 << secondHeader.numParts << ")\n" in Verify()
259 if (mainHeader.sizeOfPartitionEntries != secondHeader.sizeOfPartitionEntries) { in Verify()
264 << secondHeader.sizeOfPartitionEntries << ")\n" in Verify()
423 if ((secondHeader.signature != GPT_SIGNATURE) || (!CheckHeaderCRC(&secondHeader))) { in CheckHeaderValidity()
425 } else if ((secondHeader.revision != 0x00010000) && valid) { in CheckHeaderValidity()
429 cout << hex << secondHeader.revision << ", should be\n0x"; in CheckHeaderValidity()
503 hSize = secondHeader.headerSize = mainHeader.headerSize = HEADER_SIZE; in RecomputeCRCs()
505 hSize = secondHeader.headerSize = mainHeader.headerSize; in RecomputeCRCs()
510 ReverseHeaderBytes(&secondHeader); in RecomputeCRCs()
516 secondHeader.partitionEntriesCRC = crc; in RecomputeCRCs()
519 ReverseBytes(&secondHeader.partitionEntriesCRC, 4); in RecomputeCRCs()
524 secondHeader.headerCRC = 0; in RecomputeCRCs()
530 crc = chksum_crc32((unsigned char*) &secondHeader, hSize); in RecomputeCRCs()
533 secondHeader.headerCRC = crc; in RecomputeCRCs()
537 ReverseHeaderBytes(&secondHeader); in RecomputeCRCs()
546 mainHeader.revision = secondHeader.revision; in RebuildMainHeader()
547 mainHeader.headerSize = secondHeader.headerSize; in RebuildMainHeader()
549 mainHeader.reserved = secondHeader.reserved; in RebuildMainHeader()
550 mainHeader.currentLBA = secondHeader.backupLBA; in RebuildMainHeader()
551 mainHeader.backupLBA = secondHeader.currentLBA; in RebuildMainHeader()
552 mainHeader.firstUsableLBA = secondHeader.firstUsableLBA; in RebuildMainHeader()
553 mainHeader.lastUsableLBA = secondHeader.lastUsableLBA; in RebuildMainHeader()
554 mainHeader.diskGUID = secondHeader.diskGUID; in RebuildMainHeader()
556 mainHeader.numParts = secondHeader.numParts; in RebuildMainHeader()
557 mainHeader.sizeOfPartitionEntries = secondHeader.sizeOfPartitionEntries; in RebuildMainHeader()
558 mainHeader.partitionEntriesCRC = secondHeader.partitionEntriesCRC; in RebuildMainHeader()
559 memcpy(mainHeader.reserved2, secondHeader.reserved2, sizeof(mainHeader.reserved2)); in RebuildMainHeader()
566 secondHeader.signature = GPT_SIGNATURE; in RebuildSecondHeader()
567 secondHeader.revision = mainHeader.revision; in RebuildSecondHeader()
568 secondHeader.headerSize = mainHeader.headerSize; in RebuildSecondHeader()
569 secondHeader.headerCRC = UINT32_C(0); in RebuildSecondHeader()
570 secondHeader.reserved = mainHeader.reserved; in RebuildSecondHeader()
571 secondHeader.currentLBA = mainHeader.backupLBA; in RebuildSecondHeader()
572 secondHeader.backupLBA = mainHeader.currentLBA; in RebuildSecondHeader()
573 secondHeader.firstUsableLBA = mainHeader.firstUsableLBA; in RebuildSecondHeader()
574 secondHeader.lastUsableLBA = mainHeader.lastUsableLBA; in RebuildSecondHeader()
575 secondHeader.diskGUID = mainHeader.diskGUID; in RebuildSecondHeader()
576 secondHeader.partitionEntriesLBA = secondHeader.lastUsableLBA + UINT64_C(1); in RebuildSecondHeader()
577 secondHeader.numParts = mainHeader.numParts; in RebuildSecondHeader()
578 secondHeader.sizeOfPartitionEntries = mainHeader.sizeOfPartitionEntries; in RebuildSecondHeader()
579 secondHeader.partitionEntriesCRC = mainHeader.partitionEntriesCRC; in RebuildSecondHeader()
580 memcpy(secondHeader.reserved2, mainHeader.reserved2, sizeof(secondHeader.reserved2)); in RebuildSecondHeader()
582 SetGPTSize(secondHeader.numParts, 0); in RebuildSecondHeader()
808 allOK = LoadHeader(&secondHeader, myDisk, mainHeader.backupLBA, &secondCrcOk) && allOK; in ForceLoadGPTData()
810 allOK = LoadHeader(&secondHeader, myDisk, diskSize - UINT64_C(1), &secondCrcOk) && allOK; in ForceLoadGPTData()
869 secondPartsCrcOk = CheckTable(&secondHeader); in ForceLoadGPTData()
909 return LoadPartitionTable(secondHeader, myDisk); in LoadSecondTableAsMain()
1008 otherHeader = &secondHeader; in CheckTable()
1118 allOK = SavePartitionTable(myDisk, secondHeader.partitionEntriesLBA); in SaveGPTData()
1126 allOK = allOK && SaveHeader(&secondHeader, myDisk, mainHeader.backupLBA); in SaveGPTData()
1195 allOK = SaveHeader(&secondHeader, backupFile, 2); in SaveGPTBackup()
1280 LoadHeader(&secondHeader, backupFile, 2, &secondCrcOk); in LoadGPTBackup()
1290 SetGPTSize(secondHeader.numParts, 0); in LoadGPTBackup()
1295 if (secondHeader.currentLBA != diskSize - UINT64_C(1)) { in LoadGPTBackup()
1359 if (!myDisk.Seek(secondHeader.partitionEntriesLBA)) in DestroyGPT()
1369 if (!myDisk.Seek(secondHeader.currentLBA)) in DestroyGPT()
1731 secondHeader.firstUsableLBA = mainHeader.firstUsableLBA; in SetGPTSize()
1741 secondHeader.numParts = numParts; in SetGPTSize()
1888 mainHeader.backupLBA = secondHeader.currentLBA = diskSize - UINT64_C(1); in MoveSecondHeaderToEnd()
1897 mainHeader.lastUsableLBA = secondHeader.lastUsableLBA = diskSize - mainHeader.firstUsableLBA; in MoveSecondHeaderToEnd()
1898 secondHeader.partitionEntriesLBA = secondHeader.lastUsableLBA + UINT64_C(1); in MoveSecondHeaderToEnd()
1919 secondHeader.diskGUID = newGUID; in SetDiskGUID()
1943 secondHeader.diskGUID = mainHeader.diskGUID; in RandomizeGUIDs()