+/**\r
+ Confirm whether user truly want to do the revert action.\r
+\r
+ @param OpalDisk The device which need to do the revert action.\r
+\r
+ @retval EFI_SUCCESS Confirmed user want to do the revert action.\r
+**/\r
+EFI_STATUS\r
+HiiConfirmRevertAction (\r
+ IN OPAL_DISK *OpalDisk\r
+\r
+ )\r
+{\r
+ CHAR16 Unicode[512];\r
+ EFI_INPUT_KEY Key;\r
+ CHAR16 ApproveResponse;\r
+ CHAR16 RejectResponse;\r
+\r
+ //\r
+ // When the estimate cost time bigger than MAX_ACCEPTABLE_REVERTING_TIME, pop up dialog to let user confirm\r
+ // the revert action.\r
+ //\r
+ if (OpalDisk->EstimateTimeCost < MAX_ACCEPTABLE_REVERTING_TIME) {\r
+ return EFI_SUCCESS;\r
+ }\r
+\r
+ ApproveResponse = L'Y';\r
+ RejectResponse = L'N';\r
+\r
+ UnicodeSPrint(Unicode, StrSize(L"WARNING: Revert device needs about ####### seconds"), L"WARNING: Revert device needs about %d seconds", OpalDisk->EstimateTimeCost);\r
+\r
+ do {\r
+ CreatePopUp(\r
+ EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,\r
+ &Key,\r
+ Unicode,\r
+ L" System should not be powered off until revert completion ",\r
+ L" ",\r
+ L" Press 'Y/y' to continue, press 'N/n' to cancal ",\r
+ NULL\r
+ );\r
+ } while (\r
+ ((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) != (ApproveResponse | UPPER_LOWER_CASE_OFFSET)) &&\r
+ ((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) != (RejectResponse | UPPER_LOWER_CASE_OFFSET))\r
+ );\r
+\r
+ if ((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) == (RejectResponse | UPPER_LOWER_CASE_OFFSET)) {\r
+ return EFI_ABORTED;\r
+ }\r
+\r
+ return EFI_SUCCESS;\r
+}\r
+\r