/* Since Signature and WriteQueueSize have been known, Crc can be calculated out, then the work space header will be fixed. */
VOID InitializeLocalWorkSpaceHeader(IN UINTN WorkSpaceLength)
/* Since Signature and WriteQueueSize have been known, Crc can be calculated out, then the work space header will be fixed. */
VOID InitializeLocalWorkSpaceHeader(IN UINTN WorkSpaceLength)
{
  if (CompareGuid (&gEdkiiWorkingBlockSignatureGuid, &mWorkingBlockHeader.Signature)) {
    return;
  }
  SetMem (
    &mWorkingBlockHeader,
    sizeof (EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER),
    FTW_ERASED_BYTE
    );
  CopyMem (
    &mWorkingBlockHeader.Signature,
    &gEdkiiWorkingBlockSignatureGuid,
    sizeof (EFI_GUID)
    );
  mWorkingBlockHeader.WriteQueueSize = WorkSpaceLength - sizeof (EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER);
  mWorkingBlockHeader.Crc = FtwCalculateCrc32 (
                              &mWorkingBlockHeader,
                              sizeof (EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER)
                              );
  mWorkingBlockHeader.WorkingBlockValid   = FTW_VALID_STATE;
  mWorkingBlockHeader.WorkingBlockInvalid = FTW_INVALID_STATE;
}