/* Determine if capsule comes from memory by checking Capsule PPI. */
static BOOLEAN CheckCapsuleFromRam(IN CONST EFI_PEI_SERVICES **PeiServices)
/* Determine if capsule comes from memory by checking Capsule PPI. */
static BOOLEAN CheckCapsuleFromRam(IN CONST EFI_PEI_SERVICES **PeiServices)
{
  EFI_STATUS       Status;
  PEI_CAPSULE_PPI  *Capsule;
  Status = PeiServicesLocatePpi (
             &gEfiPeiCapsulePpiGuid,
             0,
             NULL,
             (VOID **)&Capsule
             );
  if (!EFI_ERROR (Status)) {
    Status = Capsule->CheckCapsuleUpdate ((EFI_PEI_SERVICES **)PeiServices);
    if (!EFI_ERROR (Status)) {
      return TRUE;
    }
  }
  return FALSE;
}