44 SHELL_FREE_NON_NULL (mPrompt);
45 SHELL_FREE_NON_NULL (mReturnString);
69 mPromptLen =
StrLen (mPrompt);
70 Limit = LastColumn - mPromptLen - 1;
71 Size =
StrLen (mReturnString);
78 Buffer = mReturnString;
80 Buffer = mReturnString + Size - Limit;
85 ShellPrintEx (((INT32)mPromptLen), ((INT32)LastRow) - 1, L
"%s", Buffer);
91 for (Index = Size; Index < Limit; Index++) {
92 ShellPrintEx ((INT32)(mPromptLen + Size), ((INT32)LastRow) - 1, L
" ");
100 UINT32 Foreground : 4;
101 UINT32 Background : 3;
146 New.Colors.Foreground = Orig.Colors.Background & 0xF;
147 New.Colors.Background = Orig.Colors.Foreground & 0x7;
163 if (
StrStr (mPrompt, L
"Yes/No")) {
176 if (EFI_ERROR (Status) || (EventIndex != 0)) {
180 Status = mTextInEx->ReadKeyStrokeEx (mTextInEx, &KeyData);
181 if (EFI_ERROR (Status)) {
197 if (KeyData.
Key.ScanCode == SCAN_ESC) {
199 Status = EFI_NOT_READY;
206 if ((KeyData.
Key.UnicodeChar == CHAR_LINEFEED) || (KeyData.
Key.UnicodeChar == CHAR_CARRIAGE_RETURN)) {
208 }
else if (KeyData.
Key.UnicodeChar == CHAR_BACKSPACE) {
214 mReturnString[Size] = CHAR_NULL;
219 }
else if ((KeyData.
Key.UnicodeChar <= 127) && (KeyData.
Key.UnicodeChar >= 32)) {
223 mReturnString[Size] = KeyData.
Key.UnicodeChar;
228 if (Size >= StringSize) {
234 mReturnString[Size] = CHAR_NULL;
247 mReturnString[Size] = CHAR_NULL;
274 SHELL_FREE_NON_NULL (mPrompt);
277 if (mPrompt ==
NULL) {
278 return EFI_OUT_OF_RESOURCES;
300 SHELL_FREE_NON_NULL (mReturnString);
303 mReturnString =
AllocateZeroPool ((StringSize + 1) *
sizeof (mReturnString[0]));
304 if (mReturnString ==
NULL) {
305 return EFI_OUT_OF_RESOURCES;
322 return (mReturnString);
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
CHAR16 *EFIAPI StrStr(IN CONST CHAR16 *String, IN CONST CHAR16 *SearchString)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
EFI_STATUS EFIAPI ShellPrintHiiEx(IN INT32 Col OPTIONAL, IN INT32 Row OPTIONAL, IN CONST CHAR8 *Language OPTIONAL, IN CONST EFI_STRING_ID HiiFormatStringId, IN CONST EFI_HII_HANDLE HiiFormatHandle,...)
EFI_STATUS EFIAPI ShellPrintEx(IN INT32 Col OPTIONAL, IN INT32 Row OPTIONAL, IN CONST CHAR16 *Format,...)
CHAR16 *EFIAPI CatSPrint(IN CHAR16 *String OPTIONAL, IN CONST CHAR16 *FormatString,...)
VOID EditorClearLine(IN UINTN Row, IN UINTN LastCol, IN UINTN LastRow)
EFI_SIMPLE_TEXT_OUTPUT_MODE * Mode
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * ConOut