/* Interpret the binary form state and save it as persistent platform configuration. */
STATIC EFI_STATUS EFIAPI FormStateToPlatformConfig(IN CONST MAIN_FORM_STATE *MainFormState)
/* Interpret the binary form state and save it as persistent platform configuration. */
STATIC EFI_STATUS EFIAPI FormStateToPlatformConfig(IN CONST MAIN_FORM_STATE *MainFormState)
{
  EFI_STATUS       Status;
  PLATFORM_CONFIG  PlatformConfig;
  CONST GOP_MODE   *GopMode;
  if (MainFormState->NextPreferredResolution >= mNumGopModes) {
    return EFI_INVALID_PARAMETER;
  }
  GopMode = mGopModes + MainFormState->NextPreferredResolution;
  ZeroMem (&PlatformConfig, sizeof PlatformConfig);
  PlatformConfig.HorizontalResolution = GopMode->X;
  PlatformConfig.VerticalResolution   = GopMode->Y;
  Status = PlatformConfigSave (&PlatformConfig);
  return Status;
}