/* This routine services a user request to discover the SMRAM capabilities of this platform. This will report the possible ranges that are possible for SMRAM access, based upon the memory controller capabilities. */
EFI_STATUS EFIAPI GetCapabilities(IN CONST EFI_SMM_ACCESS2_PROTOCOL *This, IN OUT UINTN *SmramMapSize, IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap)
/* This routine services a user request to discover the SMRAM capabilities of this platform. This will report the possible ranges that are possible for SMRAM access, based upon the memory controller capabilities. */
EFI_STATUS EFIAPI GetCapabilities(IN CONST EFI_SMM_ACCESS2_PROTOCOL *This, IN OUT UINTN *SmramMapSize, IN OUT EFI_SMRAM_DESCRIPTOR *SmramMap)
{
  EFI_STATUS  Status;
  UINTN       NecessaryBufferSize;
  NecessaryBufferSize = mSmmAccess.NumberRegions * sizeof (EFI_SMRAM_DESCRIPTOR);
  if (*SmramMapSize < NecessaryBufferSize) {
    Status = EFI_BUFFER_TOO_SMALL;
  } else {
    CopyMem (SmramMap, mSmmAccess.SmramDesc, NecessaryBufferSize);
    Status = EFI_SUCCESS;
  }
  *SmramMapSize = NecessaryBufferSize;
  return Status;
}