+/**\r
+ Interpret the binary form state and save it as persistent platform\r
+ configuration.\r
+\r
+ @param[in] MainFormState Binary form/widget state to verify and save.\r
+\r
+ @retval EFI_SUCCESS Platform configuration saved.\r
+ @return Error codes from underlying functions.\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+EFIAPI\r
+FormStateToPlatformConfig (\r
+ IN CONST MAIN_FORM_STATE *MainFormState\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ PLATFORM_CONFIG PlatformConfig;\r
+ CONST GOP_MODE *GopMode;\r
+\r
+ //\r
+ // There's nothing to do with the textual CurrentPreferredResolution field.\r
+ // We verify and translate the selection in the drop-down list.\r
+ //\r
+ if (MainFormState->NextPreferredResolution >= mNumGopModes) {\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
+ GopMode = mGopModes + MainFormState->NextPreferredResolution;\r
+\r
+ ZeroMem (&PlatformConfig, sizeof PlatformConfig);\r
+ PlatformConfig.HorizontalResolution = GopMode->X;\r
+ PlatformConfig.VerticalResolution = GopMode->Y;\r
+\r
+ Status = PlatformConfigSave (&PlatformConfig);\r
+ return Status;\r
+}\r
+\r
+\r
+/**\r
+ This function is called by the HII machinery when it wants the driver to\r
+ interpret and persist the form state.\r
+\r
+ See the precise documentation in the UEFI spec.\r
+\r
+ @param[in] This The Config Access Protocol instance.\r
+\r
+ @param[in] Configuration A <ConfigResp> format UCS-2 string describing the\r
+ form state.\r
+\r
+ @param[out] Progress A pointer into Configuration on output,\r
+ identifying the element where processing failed.\r
+\r
+ @retval EFI_SUCCESS Configuration verified, state permanent.\r
+\r
+ @return Status codes from underlying functions.\r
+**/\r