/* Determine whether the platform is operating in Custom Secure Boot mode. */
BOOLEAN InCustomMode(VOID)
/* Determine whether the platform is operating in Custom Secure Boot mode. */
BOOLEAN InCustomMode(VOID)
{
  EFI_STATUS  Status;
  VOID        *Data;
  UINTN       DataSize;
  Status = AuthServiceInternalFindVariable (EFI_CUSTOM_MODE_NAME, &gEfiCustomModeEnableGuid, &Data, &DataSize);
  if (!EFI_ERROR (Status) && (*(UINT8 *)Data == CUSTOM_SECURE_BOOT_MODE)) {
    return TRUE;
  }
  return FALSE;
}