/* This function get the variable statistics data from SMM variable driver. */
EFI_STATUS EFIAPI GetVariableStatisticsData(IN OUT EFI_MM_COMMUNICATE_HEADER *SmmCommunicateHeader, IN OUT UINTN *SmmCommunicateSize)
/* This function get the variable statistics data from SMM variable driver. */
EFI_STATUS EFIAPI GetVariableStatisticsData(IN OUT EFI_MM_COMMUNICATE_HEADER *SmmCommunicateHeader, IN OUT UINTN *SmmCommunicateSize)
{
  EFI_STATUS                       Status;
  SMM_VARIABLE_COMMUNICATE_HEADER  *SmmVariableFunctionHeader;
  CopyGuid (&SmmCommunicateHeader->HeaderGuid, &gEfiSmmVariableProtocolGuid);
  SmmCommunicateHeader->MessageLength = *SmmCommunicateSize - OFFSET_OF (EFI_MM_COMMUNICATE_HEADER, Data);
  SmmVariableFunctionHeader           = (SMM_VARIABLE_COMMUNICATE_HEADER *)&SmmCommunicateHeader->Data[0];
  SmmVariableFunctionHeader->Function = SMM_VARIABLE_FUNCTION_GET_STATISTICS;
  Status = mMmCommunication2->Communicate (
                                mMmCommunication2,
                                SmmCommunicateHeader,
                                SmmCommunicateHeader,
                                SmmCommunicateSize
                                );
  ASSERT_EFI_ERROR (Status);
  Status = SmmVariableFunctionHeader->ReturnStatus;
  return Status;
}