Lines Matching refs:secondHeader
128 secondHeader = orig.secondHeader; in operator =()
214 if (secondHeader.currentLBA != (diskSize - UINT64_C(1))) { in Verify()
223 if (mainHeader.currentLBA != secondHeader.backupLBA) { in Verify()
227 << secondHeader.backupLBA << ").\n"; in Verify()
229 if (mainHeader.backupLBA != secondHeader.currentLBA) { in Verify()
233 << secondHeader.currentLBA << ").\n" in Verify()
236 if (mainHeader.firstUsableLBA != secondHeader.firstUsableLBA) { in Verify()
240 << secondHeader.firstUsableLBA << ")\n"; in Verify()
242 if (mainHeader.lastUsableLBA != secondHeader.lastUsableLBA) { in Verify()
246 << secondHeader.lastUsableLBA << ")\n" in Verify()
249 if ((mainHeader.diskGUID != secondHeader.diskGUID)) { in Verify()
253 << secondHeader.diskGUID << ")\n" in Verify()
257 if (mainHeader.numParts != secondHeader.numParts) { in Verify()
261 << secondHeader.numParts << ")\n" in Verify()
264 if (mainHeader.sizeOfPartitionEntries != secondHeader.sizeOfPartitionEntries) { in Verify()
269 << secondHeader.sizeOfPartitionEntries << ")\n" in Verify()
428 if ((secondHeader.signature != GPT_SIGNATURE) || (!CheckHeaderCRC(&secondHeader))) { in CheckHeaderValidity()
430 } else if ((secondHeader.revision != 0x00010000) && valid) { in CheckHeaderValidity()
434 cout << hex << secondHeader.revision << ", should be\n0x"; in CheckHeaderValidity()
508 hSize = secondHeader.headerSize = mainHeader.headerSize = HEADER_SIZE; in RecomputeCRCs()
510 hSize = secondHeader.headerSize = mainHeader.headerSize; in RecomputeCRCs()
515 ReverseHeaderBytes(&secondHeader); in RecomputeCRCs()
521 secondHeader.partitionEntriesCRC = crc; in RecomputeCRCs()
524 ReverseBytes(&secondHeader.partitionEntriesCRC, 4); in RecomputeCRCs()
529 secondHeader.headerCRC = 0; in RecomputeCRCs()
535 crc = chksum_crc32((unsigned char*) &secondHeader, hSize); in RecomputeCRCs()
538 secondHeader.headerCRC = crc; in RecomputeCRCs()
542 ReverseHeaderBytes(&secondHeader); in RecomputeCRCs()
551 mainHeader.revision = secondHeader.revision; in RebuildMainHeader()
552 mainHeader.headerSize = secondHeader.headerSize; in RebuildMainHeader()
554 mainHeader.reserved = secondHeader.reserved; in RebuildMainHeader()
555 mainHeader.currentLBA = secondHeader.backupLBA; in RebuildMainHeader()
556 mainHeader.backupLBA = secondHeader.currentLBA; in RebuildMainHeader()
557 mainHeader.firstUsableLBA = secondHeader.firstUsableLBA; in RebuildMainHeader()
558 mainHeader.lastUsableLBA = secondHeader.lastUsableLBA; in RebuildMainHeader()
559 mainHeader.diskGUID = secondHeader.diskGUID; in RebuildMainHeader()
561 mainHeader.numParts = secondHeader.numParts; in RebuildMainHeader()
562 mainHeader.sizeOfPartitionEntries = secondHeader.sizeOfPartitionEntries; in RebuildMainHeader()
563 mainHeader.partitionEntriesCRC = secondHeader.partitionEntriesCRC; in RebuildMainHeader()
564 memcpy(mainHeader.reserved2, secondHeader.reserved2, sizeof(mainHeader.reserved2)); in RebuildMainHeader()
571 secondHeader.signature = GPT_SIGNATURE; in RebuildSecondHeader()
572 secondHeader.revision = mainHeader.revision; in RebuildSecondHeader()
573 secondHeader.headerSize = mainHeader.headerSize; in RebuildSecondHeader()
574 secondHeader.headerCRC = UINT32_C(0); in RebuildSecondHeader()
575 secondHeader.reserved = mainHeader.reserved; in RebuildSecondHeader()
576 secondHeader.currentLBA = mainHeader.backupLBA; in RebuildSecondHeader()
577 secondHeader.backupLBA = mainHeader.currentLBA; in RebuildSecondHeader()
578 secondHeader.firstUsableLBA = mainHeader.firstUsableLBA; in RebuildSecondHeader()
579 secondHeader.lastUsableLBA = mainHeader.lastUsableLBA; in RebuildSecondHeader()
580 secondHeader.diskGUID = mainHeader.diskGUID; in RebuildSecondHeader()
581 secondHeader.partitionEntriesLBA = secondHeader.lastUsableLBA + UINT64_C(1); in RebuildSecondHeader()
582 secondHeader.numParts = mainHeader.numParts; in RebuildSecondHeader()
583 secondHeader.sizeOfPartitionEntries = mainHeader.sizeOfPartitionEntries; in RebuildSecondHeader()
584 secondHeader.partitionEntriesCRC = mainHeader.partitionEntriesCRC; in RebuildSecondHeader()
585 memcpy(secondHeader.reserved2, mainHeader.reserved2, sizeof(secondHeader.reserved2)); in RebuildSecondHeader()
587 SetGPTSize(secondHeader.numParts, 0); in RebuildSecondHeader()
813 allOK = LoadHeader(&secondHeader, myDisk, mainHeader.backupLBA, &secondCrcOk) && allOK; in ForceLoadGPTData()
815 allOK = LoadHeader(&secondHeader, myDisk, diskSize - UINT64_C(1), &secondCrcOk) && allOK; in ForceLoadGPTData()
874 secondPartsCrcOk = CheckTable(&secondHeader); in ForceLoadGPTData()
914 return LoadPartitionTable(secondHeader, myDisk); in LoadSecondTableAsMain()
1016 otherHeader = &secondHeader; in CheckTable()
1126 allOK = SavePartitionTable(myDisk, secondHeader.partitionEntriesLBA); in SaveGPTData()
1134 allOK = allOK && SaveHeader(&secondHeader, myDisk, mainHeader.backupLBA); in SaveGPTData()
1203 allOK = SaveHeader(&secondHeader, backupFile, 2); in SaveGPTBackup()
1288 LoadHeader(&secondHeader, backupFile, 2, &secondCrcOk); in LoadGPTBackup()
1298 SetGPTSize(secondHeader.numParts, 0); in LoadGPTBackup()
1303 if (secondHeader.currentLBA != diskSize - UINT64_C(1)) { in LoadGPTBackup()
1367 if (!myDisk.Seek(secondHeader.partitionEntriesLBA)) in DestroyGPT()
1377 if (!myDisk.Seek(secondHeader.currentLBA)) in DestroyGPT()
1741 secondHeader.firstUsableLBA = mainHeader.firstUsableLBA; in SetGPTSize()
1751 secondHeader.numParts = numParts; in SetGPTSize()
1898 mainHeader.backupLBA = secondHeader.currentLBA = diskSize - UINT64_C(1); in MoveSecondHeaderToEnd()
1907 mainHeader.lastUsableLBA = secondHeader.lastUsableLBA = diskSize - mainHeader.firstUsableLBA; in MoveSecondHeaderToEnd()
1908 secondHeader.partitionEntriesLBA = secondHeader.lastUsableLBA + UINT64_C(1); in MoveSecondHeaderToEnd()
1929 secondHeader.diskGUID = newGUID; in SetDiskGUID()
1953 secondHeader.diskGUID = mainHeader.diskGUID; in RandomizeGUIDs()