/* Retrieve the value of a 32-bit UEFI Variable specified by VariableName and a GUID of gEfiCallerIdGuid. */
static VOID GetFmpVariable(IN CHAR16 *VariableName, OUT BOOLEAN *Valid, OUT UINT32 *Value)
/* Retrieve the value of a 32-bit UEFI Variable specified by VariableName and a GUID of gEfiCallerIdGuid. */
static VOID GetFmpVariable(IN CHAR16 *VariableName, OUT BOOLEAN *Valid, OUT UINT32 *Value)
{
  EFI_STATUS  Status;
  UINTN       Size;
  UINT32      *Buffer;
  *Valid = FALSE;
  *Value = 0;
  Size   = 0;
  Buffer = NULL;
  Status = GetVariable2 (
             VariableName,
             &gEfiCallerIdGuid,
             (VOID **)&Buffer,
             &Size
             );
  if (!EFI_ERROR (Status) && (Size == sizeof (*Value)) && (Buffer != NULL)) {
    *Valid = TRUE;
    *Value = *Buffer;
  }
  if (Buffer != NULL) {
    FreePool (Buffer);
  }
}