77STATIC CONST CHAR16 mExecutableExtensions[] = L
".NSH;.EFI";
78STATIC CONST CHAR16 mStartupScript[] = L
"startup.nsh";
79CONST CHAR16 mNoNestingEnvVarName[] = L
"nonesting";
80CONST CHAR16 mNoNestingTrue[] = L
"True";
81CONST CHAR16 mNoNestingFalse[] = L
"False";
93 ASSERT (String !=
NULL);
94 ASSERT (*String !=
NULL);
98 while (((*String)[0] == L
' ') || ((*String)[0] == L
'\t')) {
99 CopyMem ((*String), (*String)+1,
StrSize ((*String)) -
sizeof ((*String)[0]));
105 while ((
StrLen (*String) > 0) && (((*String)[
StrLen ((*String))-1] == L
' ') || ((*String)[
StrLen ((*String))-1] == L
'\t'))) {
106 (*String)[
StrLen ((*String))-1] = CHAR_NULL;
124 IN CONST BOOLEAN CheckForEscapeCharacter
129 if (SourceString ==
NULL) {
133 Temp =
StrStr (SourceString, FindString);
138 if ((Temp ==
NULL) || !CheckForEscapeCharacter) {
145 if ((Temp > (SourceString)) && (*(Temp-1) == L
'^')) {
170 CONST CHAR16 *Walker;
174 ASSERT (BeginPercent !=
NULL);
175 ASSERT (EndPercent !=
NULL);
176 ASSERT (BeginPercent < EndPercent);
178 if ((BeginPercent + 1) == EndPercent) {
182 for (Walker = BeginPercent + 1; Walker < EndPercent; Walker++) {
184 ((*Walker >= L
'0') && (*Walker <= L
'9')) ||
185 ((*Walker >= L
'A') && (*Walker <= L
'Z')) ||
186 ((*Walker >= L
'a') && (*Walker <= L
'z')) ||
190 if ((Walker == BeginPercent + 1) && ((*Walker >= L
'0') && (*Walker <= L
'9'))) {
216 CONST CHAR16 *TempSpot;
217 CONST CHAR16 *FirstQuote;
218 CONST CHAR16 *SecondQuote;
224 if ((FirstQuote ==
NULL) ||
225 (TempSpot ==
NULL) ||
226 (TempSpot == CHAR_NULL) ||
227 (FirstQuote > TempSpot)
230 return (BOOLEAN)((TempSpot !=
NULL) && (*TempSpot != CHAR_NULL));
233 while ((TempSpot !=
NULL) && (*TempSpot != CHAR_NULL)) {
234 if ((FirstQuote ==
NULL) || (FirstQuote > TempSpot)) {
239 if (SecondQuote ==
NULL) {
243 if (SecondQuote < TempSpot) {
253 return (BOOLEAN)((TempSpot !=
NULL) && (*TempSpot != CHAR_NULL));
272 Status =
gBS->OpenProtocol (
274 &gEfiSimpleTextInputExProtocolGuid,
278 EFI_OPEN_PROTOCOL_GET_PROTOCOL
280 if (EFI_ERROR (Status)) {
292 KeyData.
Key.ScanCode = 0;
294 KeyData.
Key.UnicodeChar = L
's';
296 Status = SimpleEx->RegisterKeyNotify (
304 if (!EFI_ERROR (Status)) {
305 Status = SimpleEx->RegisterKeyNotify (
314 KeyData.
Key.UnicodeChar = 19;
316 if (!EFI_ERROR (Status)) {
317 Status = SimpleEx->RegisterKeyNotify (
326 if (!EFI_ERROR (Status)) {
327 Status = SimpleEx->RegisterKeyNotify (
362 if (
PcdGet8 (PcdShellSupportLevel) > 3) {
363 return (EFI_UNSUPPORTED);
370 if (EFI_ERROR (Status)) {
379 ShellInfoObject.PageBreakEnabled =
PcdGetBool (PcdShellPageBreakDefault);
403 return (EFI_UNSUPPORTED);
409 gBS->SetWatchdogTimer (0, 0, 0,
NULL);
415 if (!EFI_ERROR (Status)) {
433 if (
PcdGetBool (PcdShellSupportFrameworkHii)) {
438 Status = EFI_NOT_STARTED;
448 ASSERT (ShellInfoObject.NewShellParametersProtocol !=
NULL);
455 ASSERT (ShellInfoObject.NewEfiShellProtocol !=
NULL);
472 if (EFI_ERROR (Status)) {
479 if (
PcdGet8 (PcdShellSupportLevel) >= 1) {
488 if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.
NoNest) {
508 SHELL_FREE_NON_NULL (TempString);
521 if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.
NoVersion) {
528 SupportLevel[
PcdGet8 (PcdShellSupportLevel)],
529 gEfiShellProtocol->MajorVersion,
530 gEfiShellProtocol->MinorVersion
558 if ((
PcdGet8 (PcdShellSupportLevel) >= 2) && !ShellInfoObject.ShellInitSettings.BitUnion.Bits.
NoMap) {
579 if (TempString ==
NULL) {
580 ASSERT (TempString !=
NULL);
581 Status = EFI_OUT_OF_RESOURCES;
589 UnicodeSPrint (TempString, Size, L
"%d.%d", ShellInfoObject.NewEfiShellProtocol->MajorVersion, ShellInfoObject.NewEfiShellProtocol->MinorVersion);
599 if (!EFI_ERROR (Status)) {
600 if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.
NoInterrupt) {
607 if (!EFI_ERROR (Status) && !ShellInfoObject.ShellInitSettings.BitUnion.Bits.
NoConsoleIn) {
614 if (!EFI_ERROR (Status) && ShellInfoObject.ShellInitSettings.BitUnion.Bits.
NoConsoleIn) {
626 if (!EFI_ERROR (Status) && (
PcdGet8 (PcdShellSupportLevel) >= 1)) {
633 if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.
Exit && !
ShellCommandGetExit () && ((
PcdGet8 (PcdShellSupportLevel) >= 3) ||
PcdGetBool (PcdShellForceConsole)) && !EFI_ERROR (Status) && !ShellInfoObject.ShellInitSettings.BitUnion.Bits.
NoConsoleIn) {
649 ShellInfoObject.PageBreakEnabled =
PcdGetBool (PcdShellPageBreakDefault);
661 if ((OldConIn !=
NULL) && (ConInHandle !=
NULL)) {
694 if (ShellInfoObject.NewShellParametersProtocol !=
NULL) {
697 ShellInfoObject.NewShellParametersProtocol =
NULL;
701 if (ShellInfoObject.NewEfiShellProtocol !=
NULL) {
702 if (ShellInfoObject.NewEfiShellProtocol->IsRootShell ()) {
708 ShellInfoObject.NewEfiShellProtocol =
NULL;
733 if (ShellInfoObject.ShellInitSettings.
FileName !=
NULL) {
754 if (!
IsListEmpty (&ShellInfoObject.ViewingSettings.CommandHistory.Link)) {
799 ; !
IsNull (&List->Link, &Node->Link)
885 ASSERT (DevPath !=
NULL);
886 ASSERT (FilePath !=
NULL);
888 Status =
gBS->OpenProtocol (
890 &gEfiLoadedImageProtocolGuid,
891 (VOID **)&LoadedImage,
894 EFI_OPEN_PROTOCOL_GET_PROTOCOL
896 if (!EFI_ERROR (Status)) {
897 Status =
gBS->OpenProtocol (
899 &gEfiDevicePathProtocolGuid,
900 (VOID **)&ImageDevicePath,
903 EFI_OPEN_PROTOCOL_GET_PROTOCOL
905 if (!EFI_ERROR (Status)) {
910 &gEfiDevicePathProtocolGuid,
918 &gEfiLoadedImageProtocolGuid,
962 CHAR16 *DelayValueStr;
972 Status =
gBS->LocateProtocol (
973 &gEfiUnicodeCollation2ProtocolGuid,
975 (VOID **)&UnicodeCollation
977 if (EFI_ERROR (Status)) {
978 Status =
gBS->LocateProtocol (
979 &gEfiUnicodeCollationProtocolGuid,
981 (VOID **)&UnicodeCollation
983 if (EFI_ERROR (Status)) {
989 ShellInfoObject.ShellInitSettings.BitUnion.Bits.
Startup =
FALSE;
990 ShellInfoObject.ShellInitSettings.BitUnion.Bits.
NoStartup =
FALSE;
994 ShellInfoObject.ShellInitSettings.BitUnion.Bits.
NoMap =
FALSE;
995 ShellInfoObject.ShellInitSettings.BitUnion.Bits.
NoVersion =
FALSE;
996 ShellInfoObject.ShellInitSettings.BitUnion.Bits.
Delay =
FALSE;
997 ShellInfoObject.ShellInitSettings.BitUnion.Bits.
Exit =
FALSE;
998 ShellInfoObject.ShellInitSettings.BitUnion.Bits.
NoNest =
FALSE;
999 ShellInfoObject.ShellInitSettings.
Delay =
PcdGet32 (PcdShellDefaultDelay);
1007 for (LoopVar = 0; LoopVar < gEfiShellParametersProtocol->
Argc; LoopVar++) {
1008 CurrentArg = gEfiShellParametersProtocol->
Argv[LoopVar];
1009 if (UnicodeCollation->StriColl (
1015 ShellInfoObject.ShellInitSettings.BitUnion.Bits.
Startup =
TRUE;
1016 }
else if (UnicodeCollation->StriColl (
1022 ShellInfoObject.ShellInitSettings.BitUnion.Bits.
NoStartup =
TRUE;
1023 }
else if (UnicodeCollation->StriColl (
1030 }
else if (UnicodeCollation->StriColl (
1037 }
else if (UnicodeCollation->StriColl (
1044 }
else if (UnicodeCollation->StriColl (
1050 ShellInfoObject.ShellInitSettings.BitUnion.Bits.
NoMap =
TRUE;
1051 }
else if (UnicodeCollation->StriColl (
1057 ShellInfoObject.ShellInitSettings.BitUnion.Bits.
NoVersion =
TRUE;
1058 }
else if (UnicodeCollation->StriColl (
1064 ShellInfoObject.ShellInitSettings.BitUnion.Bits.
NoNest =
TRUE;
1065 }
else if (UnicodeCollation->StriColl (
1071 ShellInfoObject.ShellInitSettings.BitUnion.Bits.
Delay =
TRUE;
1073 if ((LoopVar + 1) >= gEfiShellParametersProtocol->
Argc) {
1074 DelayValueStr =
NULL;
1076 DelayValueStr = gEfiShellParametersProtocol->
Argv[LoopVar + 1];
1079 if (DelayValueStr !=
NULL) {
1080 if (*DelayValueStr == L
':') {
1093 ShellInfoObject.ShellInitSettings.
Delay = (
UINTN)DelayValue;
1097 }
else if (UnicodeCollation->StriColl (
1103 ShellInfoObject.ShellInitSettings.BitUnion.Bits.
Exit =
TRUE;
1104 }
else if (
StrnCmp (L
"-", CurrentArg, 1) == 0) {
1114 return EFI_INVALID_PARAMETER;
1130 if (ShellInfoObject.ShellInitSettings.
FileName ==
NULL) {
1131 return (EFI_OUT_OF_RESOURCES);
1136 if (ShellInfoObject.ShellInitSettings.
FileName ==
NULL) {
1137 return (EFI_OUT_OF_RESOURCES);
1145 if (ShellInfoObject.ShellInitSettings.
FileName ==
NULL) {
1146 return (EFI_OUT_OF_RESOURCES);
1153 ShellInfoObject.ShellInitSettings.BitUnion.Bits.
NoStartup = 1;
1157 for (Size = 0; LoopVar < gEfiShellParametersProtocol->
Argc; LoopVar++) {
1165 SHELL_FREE_NON_NULL (ShellInfoObject.ShellInitSettings.
FileName);
1166 return (EFI_OUT_OF_RESOURCES);
1173 if (
StrStr (gEfiShellParametersProtocol->
Argv[LoopVar], L
" ") !=
NULL) {
1181 SHELL_FREE_NON_NULL (ShellInfoObject.ShellInitSettings.
FileName);
1182 return (EFI_OUT_OF_RESOURCES);
1189 gEfiShellParametersProtocol->
Argv[LoopVar],
1193 SHELL_FREE_NON_NULL (ShellInfoObject.ShellInitSettings.
FileName);
1194 return (EFI_OUT_OF_RESOURCES);
1200 if (
StrStr (gEfiShellParametersProtocol->
Argv[LoopVar], L
" ") !=
NULL) {
1208 SHELL_FREE_NON_NULL (ShellInfoObject.ShellInitSettings.
FileName);
1209 return (EFI_OUT_OF_RESOURCES);
1217 if (ShellInfoObject.ShellInitSettings.BitUnion.Bits.
NoInterrupt) {
1218 ShellInfoObject.ShellInitSettings.
Delay = 0;
1241 CHAR16 *StartupScriptPath;
1243 CONST CHAR16 *MapName;
1246 StartupScriptPath =
NULL;
1252 MapName = ShellInfoObject.NewEfiShellProtocol->GetMapFromDevicePath (&ImageDevicePath);
1253 if (MapName !=
NULL) {
1254 StartupScriptPath =
StrnCatGrow (&StartupScriptPath, &Size, MapName, 0);
1255 if (StartupScriptPath ==
NULL) {
1262 TempSpot =
StrStr (StartupScriptPath, L
";");
1263 if (TempSpot !=
NULL) {
1264 *TempSpot = CHAR_NULL;
1271 StartupScriptPath =
StrnCatGrow (&StartupScriptPath, &Size, mStartupScript, 0);
1277 if ((StartupScriptPath ==
NULL) || EFI_ERROR (
ShellIsFile (StartupScriptPath))) {
1278 SHELL_FREE_NON_NULL (StartupScriptPath);
1282 return StartupScriptPath;
1305 CHAR16 *FileStringPath;
1306 CHAR16 *FullFileStringPath;
1310 Key.UnicodeChar = CHAR_NULL;
1313 if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.
Startup && (ShellInfoObject.ShellInitSettings.
FileName !=
NULL)) {
1319 NewSize +=
StrSize (ShellInfoObject.ShellInitSettings.
FileOptions) +
sizeof (CHAR16);
1323 if (FileStringPath ==
NULL) {
1324 return (EFI_OUT_OF_RESOURCES);
1327 StrCpyS (FileStringPath, NewSize/
sizeof (CHAR16), ShellInfoObject.ShellInitSettings.
FileName);
1329 StrnCatS (FileStringPath, NewSize/
sizeof (CHAR16), L
" ", NewSize/
sizeof (CHAR16) -
StrLen (FileStringPath) -1);
1330 StrnCatS (FileStringPath, NewSize/
sizeof (CHAR16), ShellInfoObject.ShellInitSettings.
FileOptions, NewSize/sizeof (CHAR16) -
StrLen (FileStringPath) -1);
1334 if (ShellInfoObject.ShellInitSettings.BitUnion.Bits.
Exit ==
TRUE) {
1346 if ( (
PcdGet8 (PcdShellSupportLevel) < 1)
1347 || (ShellInfoObject.ShellInitSettings.BitUnion.Bits.
NoStartup && !ShellInfoObject.ShellInitSettings.BitUnion.Bits.
Startup)
1357 for ( Status = EFI_UNSUPPORTED, Delay = ShellInfoObject.ShellInitSettings.
Delay
1358 ; Delay != 0 && EFI_ERROR (Status)
1363 gBS->Stall (1000000);
1364 if (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.
NoConsoleIn) {
1375 if ((Status ==
EFI_SUCCESS) && (Key.UnicodeChar == 0) && (Key.ScanCode == SCAN_ESC)) {
1380 if (FileStringPath !=
NULL) {
1382 if (FullFileStringPath ==
NULL) {
1383 Status =
RunScriptFile (FileStringPath,
NULL, FileStringPath, ShellInfoObject.NewShellParametersProtocol);
1385 Status =
RunScriptFile (FullFileStringPath,
NULL, FullFileStringPath, ShellInfoObject.NewShellParametersProtocol);
1416 CONST CHAR16 *CurDir;
1427 BufferSize = Column * Row *
sizeof (CHAR16);
1429 if (CmdLine ==
NULL) {
1430 return EFI_OUT_OF_RESOURCES;
1434 CurDir = ShellInfoObject.NewEfiShellProtocol->GetEnv (L
"cwd");
1441 if ((CurDir !=
NULL) && (
StrLen (CurDir) > 1)) {
1450 Status = ShellInfoObject.NewEfiShellProtocol->ReadFile (ShellInfoObject.NewShellParametersProtocol->
StdIn, &BufferSize, CmdLine);
1455 if (!EFI_ERROR (Status)) {
1459 Status =
gBS->CheckEvent (ShellInfoObject.NewEfiShellProtocol->ExecutionBreak);
1461 CmdLine[BufferSize /
sizeof (CHAR16)] = CHAR_NULL;
1486 if (Buffer ==
NULL) {
1491 if (BufferListEntry ==
NULL) {
1495 BufferListEntry->Buffer = Buffer;
1540 UINT16 MaxHistoryCmdCount;
1544 MaxHistoryCmdCount =
PcdGet16 (PcdShellMaxHistoryCommandCount);
1546 if (MaxHistoryCmdCount == 0) {
1556 if (Node->Buffer ==
NULL) {
1562 ; !
IsNull (&ShellInfoObject.ViewingSettings.CommandHistory.Link, &Walker->Link)
1563 ; Walker = (
BUFFER_LIST *)
GetNextNode (&ShellInfoObject.ViewingSettings.CommandHistory.Link, &Walker->Link)
1569 if (Count < MaxHistoryCmdCount) {
1570 InsertTailList (&ShellInfoObject.ViewingSettings.CommandHistory.Link, &Node->Link);
1574 if (Walker->Buffer !=
NULL) {
1579 InsertTailList (&ShellInfoObject.ViewingSettings.CommandHistory.Link, &Node->Link);
1598 IN OUT CHAR16 **CommandString
1603 NewString = ShellInfoObject.NewEfiShellProtocol->GetAlias (*CommandString,
NULL);
1610 if (*CommandString ==
NULL) {
1611 return (EFI_OUT_OF_RESOURCES);
1624 IN OUT CHAR16 *CmdLine
1627 CHAR16 *FirstPercent;
1629 CHAR16 *SecondPercent;
1630 CHAR16 *SecondQuote;
1631 CHAR16 *CurrentLocator;
1633 for (CurrentLocator = CmdLine; CurrentLocator !=
NULL; ) {
1637 if ((FirstPercent ==
NULL) || (SecondPercent ==
NULL)) {
1644 if ((FirstQuote !=
NULL) && (FirstQuote < FirstPercent)) {
1650 if (SecondQuote < FirstPercent) {
1654 CurrentLocator = SecondQuote + 1;
1660 CurrentLocator = FirstPercent;
1666 if ((FirstQuote ==
NULL) || (SecondPercent < FirstQuote)) {
1671 CopyMem (FirstPercent, SecondPercent + 1,
StrSize (SecondPercent + 1));
1676 CurrentLocator = SecondPercent + 1;
1682 CurrentLocator = FirstQuote;
1701 IN CONST CHAR16 *OriginalCommandLine
1704 CONST CHAR16 *MasterEnvList;
1706 CHAR16 *NewCommandLine1;
1707 CHAR16 *NewCommandLine2;
1714 ASSERT (OriginalCommandLine !=
NULL);
1717 NewSize =
StrSize (OriginalCommandLine);
1726 if (CurrentScriptFile !=
NULL) {
1732 for (Temp =
StrStr (OriginalCommandLine, AliasListNode->Alias)
1734 ; Temp =
StrStr (Temp+1, AliasListNode->Alias)
1740 if ((((Temp-OriginalCommandLine) > 2) && (*(Temp-2) != L
'^')) || ((Temp-OriginalCommandLine) <= 2)) {
1741 NewSize +=
StrSize (AliasListNode->CommandString);
1748 ; MasterEnvList !=
NULL && *MasterEnvList != CHAR_NULL
1749 ; MasterEnvList +=
StrLen (MasterEnvList) + 1
1752 if (
StrSize (MasterEnvList) > ItemSize) {
1753 ItemSize =
StrSize (MasterEnvList);
1756 for (Temp =
StrStr (OriginalCommandLine, MasterEnvList)
1758 ; Temp =
StrStr (Temp+1, MasterEnvList)
1764 if ((*(Temp-1) == L
'%') && (*(Temp+
StrLen (MasterEnvList)) == L
'%') &&
1765 ((((Temp-OriginalCommandLine) > 2) && (*(Temp-2) != L
'^')) || ((Temp-OriginalCommandLine) <= 2)))
1778 if ((NewCommandLine1 ==
NULL) || (NewCommandLine2 ==
NULL) || (ItemTemp ==
NULL)) {
1779 SHELL_FREE_NON_NULL (NewCommandLine1);
1780 SHELL_FREE_NON_NULL (NewCommandLine2);
1781 SHELL_FREE_NON_NULL (ItemTemp);
1785 CopyMem (NewCommandLine1, OriginalCommandLine,
StrSize (OriginalCommandLine));
1788 ; MasterEnvList !=
NULL && *MasterEnvList != CHAR_NULL
1789 ; MasterEnvList +=
StrLen (MasterEnvList) + 1
1794 ((ItemSize+(2*
sizeof (CHAR16)))/
sizeof (CHAR16)),
1799 ((ItemSize+(2*
sizeof (CHAR16)))/
sizeof (CHAR16)),
1804 ((ItemSize+(2*
sizeof (CHAR16)))/
sizeof (CHAR16)),
1808 StrCpyS (NewCommandLine1, NewSize/
sizeof (CHAR16), NewCommandLine2);
1811 if (CurrentScriptFile !=
NULL) {
1818 StrCpyS (NewCommandLine1, NewSize/
sizeof (CHAR16), NewCommandLine2);
1831 StrCpyS (NewCommandLine1, NewSize/
sizeof (CHAR16), NewCommandLine2);
1836 return (NewCommandLine1);
1852 IN SHELL_FILE_HANDLE StdIn,
1853 IN SHELL_FILE_HANDLE StdOut
1857 CHAR16 *NextCommandLine;
1858 CHAR16 *OurCommandLine;
1862 SHELL_FILE_HANDLE TempFileHandle;
1865 ASSERT (StdOut ==
NULL);
1870 NextCommandLine =
NULL;
1871 OurCommandLine =
NULL;
1875 NextCommandLine =
StrnCatGrow (&NextCommandLine, &Size1,
StrStr (CmdLine, L
"|")+1, 0);
1876 OurCommandLine =
StrnCatGrow (&OurCommandLine, &Size2, CmdLine,
StrStr (CmdLine, L
"|") - CmdLine);
1878 if ((NextCommandLine ==
NULL) || (OurCommandLine ==
NULL)) {
1879 SHELL_FREE_NON_NULL (OurCommandLine);
1880 SHELL_FREE_NON_NULL (NextCommandLine);
1881 return (EFI_OUT_OF_RESOURCES);
1882 }
else if ((
StrStr (OurCommandLine, L
"|") !=
NULL) || (Size1 == 0) || (Size2 == 0)) {
1883 SHELL_FREE_NON_NULL (OurCommandLine);
1884 SHELL_FREE_NON_NULL (NextCommandLine);
1885 return (EFI_INVALID_PARAMETER);
1886 }
else if ((NextCommandLine[0] == L
'a') &&
1887 ((NextCommandLine[1] == L
' ') || (NextCommandLine[1] == CHAR_NULL))
1890 CopyMem (NextCommandLine, NextCommandLine+1,
StrSize (NextCommandLine) -
sizeof (NextCommandLine[0]));
1891 while (NextCommandLine[0] == L
' ') {
1892 CopyMem (NextCommandLine, NextCommandLine+1,
StrSize (NextCommandLine) -
sizeof (NextCommandLine[0]));
1895 if (NextCommandLine[0] == CHAR_NULL) {
1896 SHELL_FREE_NON_NULL (OurCommandLine);
1897 SHELL_FREE_NON_NULL (NextCommandLine);
1898 return (EFI_INVALID_PARAMETER);
1911 return EFI_OUT_OF_RESOURCES;
1914 Split->SplitStdIn = StdIn;
1924 TempFileHandle =
Split->SplitStdOut;
1925 if (
Split->SplitStdIn == StdIn) {
1931 Split->SplitStdIn = TempFileHandle;
1932 ShellInfoObject.NewEfiShellProtocol->SetFilePosition (
Split->SplitStdIn, 0);
1934 if (!EFI_ERROR (Status)) {
1948 ShellInfoObject.NewEfiShellProtocol->CloseFile (
Split->SplitStdOut);
1952 ShellInfoObject.NewEfiShellProtocol->CloseFile (
Split->SplitStdIn);
1979 SHELL_FREE_NON_NULL (*CmdLine);
1980 if (NewCmdLine ==
NULL) {
1981 return (EFI_OUT_OF_RESOURCES);
1984 *CmdLine = NewCmdLine;
2003 CHAR16 *CommandName;
2005 UINTN PostAliasSize;
2007 ASSERT (CmdLine !=
NULL);
2008 ASSERT (*CmdLine !=
NULL);
2026 if (EFI_ERROR (Status)) {
2031 NewCmdLine =
StrnCatGrow (&NewCmdLine, &PostAliasSize, CommandName, 0);
2032 if (NewCmdLine ==
NULL) {
2033 SHELL_FREE_NON_NULL (CommandName);
2034 SHELL_FREE_NON_NULL (*CmdLine);
2035 return (EFI_OUT_OF_RESOURCES);
2038 NewCmdLine =
StrnCatGrow (&NewCmdLine, &PostAliasSize,
StrStr ((*CmdLine), L
" "), 0);
2039 if (NewCmdLine ==
NULL) {
2040 SHELL_FREE_NON_NULL (CommandName);
2041 SHELL_FREE_NON_NULL (*CmdLine);
2042 return (EFI_OUT_OF_RESOURCES);
2048 SHELL_FREE_NON_NULL (*CmdLine);
2049 SHELL_FREE_NON_NULL (CommandName);
2054 *CmdLine = NewCmdLine;
2070SHELL_OPERATION_TYPES
2075 CHAR16 *FileWithPath;
2076 CONST CHAR16 *TempLocation;
2077 CONST CHAR16 *TempLocation2;
2079 FileWithPath =
NULL;
2084 return (Internal_Command);
2090 if (CmdName[(
StrLen (CmdName)-1)] == L
':') {
2095 return (Unknown_Invalid);
2098 return (File_Sys_Change);
2108 if (
StrLen (FileWithPath) > 4) {
2109 TempLocation = FileWithPath+
StrLen (FileWithPath)-4;
2110 TempLocation2 = mScriptExtension;
2112 SHELL_FREE_NON_NULL (FileWithPath);
2113 return (Script_File_Name);
2120 SHELL_FREE_NON_NULL (FileWithPath);
2121 return (Efi_Application);
2124 SHELL_FREE_NON_NULL (FileWithPath);
2128 return (Unknown_Invalid);
2146 CHAR16 *FirstParameter;
2154 return (EFI_OUT_OF_RESOURCES);
2157 FirstParameter =
StrStr (Temp, L
"|");
2158 if (FirstParameter !=
NULL) {
2159 *FirstParameter = CHAR_NULL;
2162 FirstParameter =
NULL;
2169 if (!EFI_ERROR (Status)) {
2171 if (FirstParameter ==
NULL) {
2172 SHELL_FREE_NON_NULL (Temp);
2173 return (EFI_OUT_OF_RESOURCES);
2176 TempWalker = (CHAR16 *)Temp;
2181 Status = EFI_NOT_FOUND;
2186 SHELL_FREE_NON_NULL (Temp);
2187 SHELL_FREE_NON_NULL (FirstParameter);
2204 CONST CHAR16 *TempSpot;
2218 if (EFI_ERROR (Status)) {
2226 if ((*TempSpot == L
'a') &&
2227 ((*(TempSpot + 1) == L
' ') || (*(TempSpot + 1) == CHAR_NULL))
2254 if (EFI_ERROR (Status)) {
2273 if (EFI_ERROR (Status)) {
2299 ASSERT (CmdLine[(
StrLen (CmdLine)-1)] == L
':' &&
StrStr (CmdLine, L
" ") ==
NULL);
2304 Status = ShellInfoObject.NewEfiShellProtocol->SetCurDir (
NULL, CmdLine);
2309 if (EFI_ERROR (Status)) {
2325 IN OUT CHAR16 **CmdLine
2328 CHAR16 *CurrentParameter;
2330 CHAR16 *NewCommandLine;
2332 UINTN NewCmdLineSize;
2337 if (CurrentParameter ==
NULL) {
2338 return (EFI_OUT_OF_RESOURCES);
2342 while (Walker !=
NULL && *Walker != CHAR_NULL) {
2344 if (
StrStr (CurrentParameter, L
"-?") == CurrentParameter) {
2345 CurrentParameter[0] = L
' ';
2346 CurrentParameter[1] = L
' ';
2349 if (NewCommandLine ==
NULL) {
2350 Status = EFI_OUT_OF_RESOURCES;
2357 StrnCpyS (NewCommandLine, NewCmdLineSize/
sizeof (CHAR16), L
"help ", 5);
2358 StrnCatS (NewCommandLine, NewCmdLineSize/
sizeof (CHAR16), *CmdLine,
StrLen (*CmdLine));
2359 SHELL_FREE_NON_NULL (*CmdLine);
2360 *CmdLine = NewCommandLine;
2366 SHELL_FREE_NON_NULL (CurrentParameter);
2381 CHAR16 LeString[19];
2383 if (
sizeof (
EFI_STATUS) ==
sizeof (UINT64)) {
2384 UnicodeSPrint (LeString,
sizeof (LeString), L
"0x%Lx", ErrorCode);
2386 UnicodeSPrint (LeString,
sizeof (LeString), L
"0x%x", ErrorCode);
2408 IN OUT CHAR16 **CmdLine
2416 if (EFI_ERROR (Status)) {
2423 if (EFI_ERROR (Status)) {
2427 ASSERT (*CmdLine !=
NULL);
2463 IN CHAR16 *FirstParameter,
2477 if (NewCmdLine ==
NULL) {
2478 return EFI_OUT_OF_RESOURCES;
2481 for (Walker = NewCmdLine; Walker !=
NULL && *Walker != CHAR_NULL; Walker++) {
2482 if ((*Walker == L
'^') && (*(Walker+1) == L
'#')) {
2483 CopyMem (Walker, Walker+1,
StrSize (Walker) -
sizeof (Walker[0]));
2490 Status =
UpdateArgcArgv (ParamProtocol, NewCmdLine, Internal_Command, &Argv, &Argc);
2491 if (!EFI_ERROR (Status)) {
2497 if (!EFI_ERROR (Status)) {
2498 if (CommandStatus !=
NULL) {
2521 Status = CommandReturnedStatus;
2526 Status = EFI_ABORTED;
2531 Status = EFI_ABORTED;
2551 && (Status != EFI_ABORTED)
2575 IN SHELL_OPERATION_TYPES Type,
2577 IN CHAR16 *FirstParameter,
2584 CHAR16 *CommandWithPath;
2585 CHAR16 *FullCommandWithPath;
2590 CommandWithPath =
NULL;
2595 case Internal_Command:
2598 case Script_File_Name:
2599 case Efi_Application:
2604 ASSERT (CommandWithPath ==
NULL);
2606 CommandWithPath =
StrnCatGrow (&CommandWithPath,
NULL, FirstParameter, 0);
2613 if (CommandWithPath ==
NULL) {
2617 if (CommandWithPath ==
NULL) {
2621 ASSERT (CommandWithPath !=
NULL);
2624 return EFI_NOT_FOUND;
2636 case Script_File_Name:
2638 if (FullCommandWithPath ==
NULL) {
2646 case Efi_Application:
2650 DevPath = ShellInfoObject.NewEfiShellProtocol->GetDevicePathFromFilePath (CommandWithPath);
2651 if (DevPath ==
NULL) {
2652 Status = EFI_OUT_OF_RESOURCES;
2667 SHELL_FREE_NON_NULL (DevPath);
2669 if (EFI_ERROR (Status)) {
2675 if (CommandStatus !=
NULL) {
2676 *CommandStatus = CalleeExitStatus;
2700 SHELL_FREE_NON_NULL (CommandWithPath);
2719 IN SHELL_OPERATION_TYPES Type,
2721 IN CHAR16 *FirstParameter,
2727 SHELL_FILE_HANDLE OriginalStdIn;
2728 SHELL_FILE_HANDLE OriginalStdOut;
2729 SHELL_FILE_HANDLE OriginalStdErr;
2736 Status =
UpdateStdInStdOutStdErr (ParamProtocol, CmdLine, &OriginalStdIn, &OriginalStdOut, &OriginalStdErr, &OriginalSystemTableInfo);
2742 if (!EFI_ERROR (Status)) {
2744 Status =
RunCommandOrFile (Type, CmdLine, FirstParameter, ParamProtocol, CommandStatus);
2750 if (EFI_ERROR (Status)) {
2752 if ((ConstScriptFile ==
NULL) || (ConstScriptFile->CurrentCommand ==
NULL)) {
2762 RestoreStdInStdOutStdErr (ParamProtocol, &OriginalStdIn, &OriginalStdOut, &OriginalStdErr, &OriginalSystemTableInfo);
2786 CHAR16 *CleanOriginal;
2787 CHAR16 *FirstParameter;
2789 SHELL_OPERATION_TYPES Type;
2790 CONST CHAR16 *CurDir;
2792 ASSERT (CmdLine !=
NULL);
2793 if (
StrLen (CmdLine) == 0) {
2798 CleanOriginal =
NULL;
2801 if (CleanOriginal ==
NULL) {
2802 return (EFI_OUT_OF_RESOURCES);
2813 for (TempWalker = CleanOriginal; TempWalker !=
NULL && *TempWalker != CHAR_NULL; TempWalker++) {
2814 if (*TempWalker == L
'^') {
2815 if (*(TempWalker + 1) == L
'#') {
2818 }
else if (*TempWalker == L
'#') {
2819 *TempWalker = CHAR_NULL;
2828 if (
StrLen (CleanOriginal) == 0) {
2829 SHELL_FREE_NON_NULL (CleanOriginal);
2834 if (EFI_ERROR (Status)) {
2835 SHELL_FREE_NON_NULL (CleanOriginal);
2844 SHELL_FREE_NON_NULL (CleanOriginal);
2852 if (FirstParameter ==
NULL) {
2853 SHELL_FREE_NON_NULL (CleanOriginal);
2854 return (EFI_OUT_OF_RESOURCES);
2857 TempWalker = CleanOriginal;
2863 case File_Sys_Change:
2866 case Internal_Command:
2867 case Script_File_Name:
2868 case Efi_Application:
2869 Status =
SetupAndRunCommandOrFile (Type, CleanOriginal, FirstParameter, ShellInfoObject.NewShellParametersProtocol, CommandStatus);
2888 if (CurDir !=
NULL) {
2900 SHELL_FREE_NON_NULL (CleanOriginal);
2901 SHELL_FREE_NON_NULL (FirstParameter);
2935 IN SHELL_FILE_HANDLE Handle,
2942 UINTN PrintBuffSize;
2943 CHAR16 *CommandLine;
2944 CHAR16 *CommandLine2;
2945 CHAR16 *CommandLine3;
2948 BOOLEAN PreScriptEchoState;
2949 BOOLEAN PreCommandEchoState;
2950 CONST CHAR16 *CurDir;
2952 CHAR16 LeString[50];
2958 PrintBuffSize =
PcdGet32 (PcdShellPrintBufferSize);
2961 if (NewScriptFile ==
NULL) {
2962 return (EFI_OUT_OF_RESOURCES);
2972 return (EFI_OUT_OF_RESOURCES);
2978 NewScriptFile->
Argc = ShellInfoObject.NewShellParametersProtocol->
Argc;
2979 if (NewScriptFile->
Argc != 0) {
2983 return (EFI_OUT_OF_RESOURCES);
2991 for (LoopVar = 1; LoopVar < 10 && LoopVar < NewScriptFile->
Argc; LoopVar++) {
2992 ASSERT (NewScriptFile->
Argv[LoopVar] ==
NULL);
2993 NewScriptFile->
Argv[LoopVar] =
StrnCatGrow (&NewScriptFile->
Argv[LoopVar],
NULL, ShellInfoObject.NewShellParametersProtocol->
Argv[LoopVar], 0);
2994 if (NewScriptFile->
Argv[LoopVar] ==
NULL) {
2996 return (EFI_OUT_OF_RESOURCES);
3013 if ((CommandLine ==
NULL) || (
StrLen (CommandLine) == 0) || (CommandLine[0] ==
'#')) {
3014 SHELL_FREE_NON_NULL (CommandLine);
3020 SHELL_FREE_NON_NULL (CommandLine);
3022 return (EFI_OUT_OF_RESOURCES);
3041 if (CommandLine ==
NULL) {
3043 return (EFI_OUT_OF_RESOURCES);
3047 if (CommandLine2 ==
NULL) {
3050 return (EFI_OUT_OF_RESOURCES);
3058 ASSERT (CommandLine2 !=
NULL);
3061 PrintBuffSize/
sizeof (CHAR16),
3063 PrintBuffSize/sizeof (CHAR16) - 1
3071 for (CommandLine3 = CommandLine2; CommandLine3 !=
NULL && *CommandLine3 != CHAR_NULL; CommandLine3++) {
3072 if (*CommandLine3 == L
'^') {
3073 if ( *(CommandLine3+1) == L
':') {
3074 CopyMem (CommandLine3, CommandLine3+1,
StrSize (CommandLine3) -
sizeof (CommandLine3[0]));
3075 }
else if (*(CommandLine3+1) == L
'#') {
3078 }
else if (*CommandLine3 == L
'#') {
3079 *CommandLine3 = CHAR_NULL;
3083 if ((CommandLine2 !=
NULL) && (
StrLen (CommandLine2) >= 1)) {
3089 PrintBuffSize/
sizeof (CHAR16),
3091 PrintBuffSize/
sizeof (CHAR16) - 1
3098 switch (NewScriptFile->
Argc) {
3147 PrintBuffSize/
sizeof (CHAR16),
3149 PrintBuffSize/
sizeof (CHAR16) - 1
3154 for (CommandLine3 = CommandLine2; CommandLine3[0] == L
' '; CommandLine3++) {
3157 if ((CommandLine3 !=
NULL) && (CommandLine3[0] == L
':')) {
3162 if ((CommandLine3 !=
NULL) && (
StrLen (CommandLine3) > 0)) {
3163 if (CommandLine3[0] == L
'@') {
3175 if ((
StrCmp (L
"@echo -off", CommandLine3) != 0) &&
3176 (
StrCmp (L
"@echo -on", CommandLine3) != 0))
3185 CurDir = ShellInfoObject.NewEfiShellProtocol->GetEnv (L
"cwd");
3186 if ((CurDir !=
NULL) && (
StrLen (CurDir) > 1)) {
3220 if (EFI_ERROR (Status)) {
3277 IN SHELL_FILE_HANDLE Handle OPTIONAL,
3283 SHELL_FILE_HANDLE FileHandle;
3288 return (EFI_INVALID_PARAMETER);
3294 Status =
UpdateArgcArgv (ParamProtocol, CmdLine, Script_File_Name, &Argv, &Argc);
3295 if (!EFI_ERROR (Status)) {
3296 if (Handle ==
NULL) {
3301 if (!EFI_ERROR (Status)) {
3339 IN CONST CHAR16 *CharacterList,
3340 IN CONST CHAR16 EscapeCharacter
3346 for (WalkStr = 0; WalkStr <
StrLen (String); WalkStr++) {
3347 if (String[WalkStr] == EscapeCharacter) {
3352 for (WalkChar = 0; WalkChar <
StrLen (CharacterList); WalkChar++) {
3353 if (String[WalkStr] == CharacterList[WalkChar]) {
3354 return (&String[WalkStr]);
3359 return (String +
StrLen (String));
BOOLEAN EFIAPI IsNull(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
RETURN_STATUS EFIAPI StrCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
LIST_ENTRY *EFIAPI GetNextNode(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
INTN EFIAPI StrCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString)
LIST_ENTRY *EFIAPI InsertHeadList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
RETURN_STATUS EFIAPI StrCatS(IN OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
INTN EFIAPI StrnCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString, IN UINTN Length)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
BOOLEAN EFIAPI PathRemoveLastItem(IN OUT CHAR16 *Path)
LIST_ENTRY *EFIAPI InitializeListHead(IN OUT LIST_ENTRY *ListHead)
RETURN_STATUS EFIAPI StrnCatS(IN OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source, IN UINTN Length)
RETURN_STATUS EFIAPI StrnCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source, IN UINTN Length)
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
CHAR16 *EFIAPI StrStr(IN CONST CHAR16 *String, IN CONST CHAR16 *SearchString)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
EFI_STATUS ConsoleLoggerInstall(IN CONST UINTN ScreensToSave, OUT CONSOLE_LOGGER_PRIVATE_DATA **ConsoleInfo)
EFI_STATUS ConsoleLoggerUninstall(IN CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo)
EFI_STATUS CloseSimpleTextInOnFile(IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *SimpleTextIn)
EFI_SIMPLE_TEXT_INPUT_PROTOCOL * CreateSimpleTextInOnFile(IN SHELL_FILE_HANDLE FileHandleToUse, IN EFI_HANDLE *HandleLocation)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI FileDevicePath(IN EFI_HANDLE Device OPTIONAL, IN CONST CHAR16 *FileName)
EFI_DEVICE_PATH_PROTOCOL *EFIAPI DuplicateDevicePath(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath)
EFI_STATUS EFIAPI NotificationFunction(IN EFI_KEY_DATA *KeyData)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
EFI_FILE_PROTOCOL * CreateFileInterfaceMem(IN CONST BOOLEAN Unicode)
EFI_FILE_PROTOCOL FileInterfaceNulFile
EFI_HII_HANDLE EFIAPI HiiAddPackages(IN CONST EFI_GUID *PackageListGuid, IN EFI_HANDLE DeviceHandle OPTIONAL,...)
VOID EFIAPI HiiRemovePackages(IN EFI_HII_HANDLE HiiHandle)
UINTN EFIAPI UnicodeSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG_CODE(Expression)
@ SHELL_INVALID_PARAMETER
#define PcdGet16(TokenName)
#define PcdGet8(TokenName)
#define PcdGet32(TokenName)
#define PcdGetBool(TokenName)
#define PcdGetPtr(TokenName)
#define FeaturePcdGet(TokenName)
EFI_STRING_ID NewString(IN CHAR16 *String, IN EFI_HII_HANDLE HiiHandle)
BOOLEAN IsValidEnvironmentVariableName(IN CONST CHAR16 *BeginPercent, IN CONST CHAR16 *EndPercent)
CHAR16 * ShellConvertVariables(IN CONST CHAR16 *OriginalCommandLine)
EFI_STATUS TrimSpaces(IN CHAR16 **String)
EFI_STATUS SetupAndRunCommandOrFile(IN SHELL_OPERATION_TYPES Type, IN CHAR16 *CmdLine, IN CHAR16 *FirstParameter, IN EFI_SHELL_PARAMETERS_PROTOCOL *ParamProtocol, OUT EFI_STATUS *CommandStatus)
EFI_STATUS RunInternalCommand(IN CONST CHAR16 *CmdLine, IN CHAR16 *FirstParameter, IN EFI_SHELL_PARAMETERS_PROTOCOL *ParamProtocol, OUT EFI_STATUS *CommandStatus)
BOOLEAN IsScriptOnlyCommand(IN CONST CHAR16 *CommandName)
EFI_STATUS SetBuiltInAlias(VOID)
EFI_STATUS DoShellPrompt(VOID)
EFI_STATUS RunScriptFile(IN CONST CHAR16 *ScriptPath, IN SHELL_FILE_HANDLE Handle OPTIONAL, IN CONST CHAR16 *CmdLine, IN EFI_SHELL_PARAMETERS_PROTOCOL *ParamProtocol)
BOOLEAN ContainsSplit(IN CONST CHAR16 *CmdLine)
EFI_STATUS RunShellCommand(IN CONST CHAR16 *CmdLine, OUT EFI_STATUS *CommandStatus)
EFI_STATUS EFIAPI UefiMain(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
BOOLEAN IsCommand(IN CONST CHAR16 *Command1, IN CONST CHAR16 *Command2)
VOID RestoreBufferList(IN OUT LIST_ENTRY *OldBufferList)
EFI_STATUS GetDevicePathsForImageAndFile(IN OUT EFI_DEVICE_PATH_PROTOCOL **DevPath, IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath)
EFI_STATUS RunSplitCommand(IN CONST CHAR16 *CmdLine, IN SHELL_FILE_HANDLE StdIn, IN SHELL_FILE_HANDLE StdOut)
VOID AddLineToCommandHistory(IN CONST CHAR16 *Buffer)
EFI_STATUS SetLastError(IN CONST SHELL_STATUS ErrorCode)
EFI_STATUS RunCommand(IN CONST CHAR16 *CmdLine)
CHAR16 * LocateStartupScript(IN EFI_DEVICE_PATH_PROTOCOL *ImageDevicePath, IN EFI_DEVICE_PATH_PROTOCOL *FileDevicePath)
EFI_STATUS VerifySplit(IN CONST CHAR16 *CmdLine)
CHAR16 * FindNextInstance(IN CONST CHAR16 *SourceString, IN CONST CHAR16 *FindString, IN CONST BOOLEAN CheckForEscapeCharacter)
EFI_STATUS ProcessNewSplitCommandLine(IN CONST CHAR16 *CmdLine)
VOID * AddBufferToFreeList(VOID *Buffer)
EFI_STATUS ShellConvertAlias(IN OUT CHAR16 **CommandString)
EFI_STATUS InternalEfiShellStartCtrlSMonitor(VOID)
EFI_STATUS ShellSubstituteVariables(IN CHAR16 **CmdLine)
EFI_STATUS DoHelpUpdate(IN OUT CHAR16 **CmdLine)
EFI_STATUS ShellSubstituteAliases(IN CHAR16 **CmdLine)
EFI_STATUS ProcessCommandLine(VOID)
EFI_STATUS RunScriptFileHandle(IN SHELL_FILE_HANDLE Handle, IN CONST CHAR16 *Name)
EFI_STATUS DoStartupScript(IN EFI_DEVICE_PATH_PROTOCOL *ImagePath, IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
EFI_STATUS RunCommandOrFile(IN SHELL_OPERATION_TYPES Type, IN CONST CHAR16 *CmdLine, IN CHAR16 *FirstParameter, IN EFI_SHELL_PARAMETERS_PROTOCOL *ParamProtocol, OUT EFI_STATUS *CommandStatus)
VOID SaveBufferList(OUT LIST_ENTRY *OldBufferList)
EFI_STATUS ChangeMappedDrive(IN CONST CHAR16 *CmdLine)
CONST CHAR16 * FindFirstCharacter(IN CONST CHAR16 *String, IN CONST CHAR16 *CharacterList, IN CONST CHAR16 EscapeCharacter)
EFI_STATUS ProcessCommandLineToFinal(IN OUT CHAR16 **CmdLine)
EFI_STATUS StripUnreplacedEnvironmentVariables(IN OUT CHAR16 *CmdLine)
EFI_STATUS IsValidSplit(IN CONST CHAR16 *CmdLine)
SHELL_OPERATION_TYPES GetOperationType(IN CONST CHAR16 *CmdName)
BOOLEAN EFIAPI ShellCommandGetScriptExit(VOID)
CONST ALIAS_LIST *EFIAPI ShellCommandGetInitAliasList(VOID)
EFI_STATUS EFIAPI CommandInit(VOID)
SHELL_FILE_HANDLE EFIAPI ConvertEfiFileProtocolToShellHandle(IN CONST EFI_FILE_PROTOCOL *Handle, IN CONST CHAR16 *Path)
VOID EFIAPI FreeBufferList(IN BUFFER_LIST *List)
BOOLEAN EFIAPI ShellFileHandleEof(IN SHELL_FILE_HANDLE Handle)
BOOLEAN EFIAPI ShellCommandIsCommandOnList(IN CONST CHAR16 *CommandString)
SHELL_MAP_LIST * gShellCurMapping
Pointer to node of current directory in the mMapList.
VOID EFIAPI ShellCommandRegisterExit(IN BOOLEAN ScriptOnly, IN CONST UINT64 ErrorCode)
RETURN_STATUS EFIAPI ShellCommandRunCommandHandler(IN CONST CHAR16 *CommandString, IN OUT SHELL_STATUS *RetVal, IN OUT BOOLEAN *CanAffectLE OPTIONAL)
UINT64 EFIAPI ShellCommandGetExitCode(VOID)
VOID EFIAPI DeleteScriptFileStruct(IN SCRIPT_FILE *Script)
SCRIPT_FILE *EFIAPI ShellCommandSetNewScript(IN SCRIPT_FILE *Script OPTIONAL)
BOOLEAN EFIAPI ShellCommandGetEchoState(VOID)
EFI_STATUS EFIAPI ShellCommandCreateInitialMappingsAndPaths(VOID)
VOID EFIAPI ShellCommandSetEchoState(IN BOOLEAN State)
BOOLEAN EFIAPI ShellCommandGetExit(VOID)
CONST CHAR16 *EFIAPI ShellCommandGetProfileList(VOID)
SCRIPT_FILE *EFIAPI ShellCommandGetCurrentScriptFile(VOID)
EFI_STATUS ShellInitEnvVarList(VOID)
VOID ShellFreeEnvVarList(VOID)
CHAR16 *EFIAPI ShellFileHandleReturnLine(IN SHELL_FILE_HANDLE Handle, IN OUT BOOLEAN *Ascii)
CHAR16 *EFIAPI FullyQualifyPath(IN CONST CHAR16 *Path)
EFI_STATUS EFIAPI ShellCopySearchAndReplace(IN CHAR16 CONST *SourceString, IN OUT CHAR16 *NewString, IN UINTN NewSize, IN CONST CHAR16 *FindTarget, IN CONST CHAR16 *ReplaceWith, IN CONST BOOLEAN SkipPreCarrot, IN CONST BOOLEAN ParameterReplacing)
BOOLEAN EFIAPI ShellGetExecutionBreakFlag(VOID)
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 ShellOpenFileByName(IN CONST CHAR16 *FileName, OUT SHELL_FILE_HANDLE *FileHandle, IN UINT64 OpenMode, IN UINT64 Attributes)
CHAR16 *EFIAPI StrnCatGrow(IN OUT CHAR16 **Destination, IN OUT UINTN *CurrentSize, IN CONST CHAR16 *Source, IN UINTN Count)
CHAR16 *EFIAPI ShellFindFilePathEx(IN CONST CHAR16 *FileName, IN CONST CHAR16 *FileExtension)
EFI_STATUS EFIAPI ShellFileExists(IN CONST CHAR16 *Name)
EFI_STATUS EFIAPI ShellInitialize(VOID)
EFI_STATUS EFIAPI ShellIsFile(IN CONST CHAR16 *Name)
EFI_STATUS EFIAPI ShellIsDirectory(IN CONST CHAR16 *DirName)
CHAR16 *EFIAPI ShellFindFilePath(IN CONST CHAR16 *FileName)
EFI_STATUS EFIAPI ShellPrintEx(IN INT32 Col OPTIONAL, IN INT32 Row OPTIONAL, IN CONST CHAR16 *Format,...)
EFI_STATUS EFIAPI ShellConvertStringToUint64(IN CONST CHAR16 *String, OUT UINT64 *Value, IN CONST BOOLEAN ForceHex, IN CONST BOOLEAN StopAtSpace)
EFI_STATUS EFIAPI ShellCloseFile(IN SHELL_FILE_HANDLE *FileHandle)
EFI_STATUS CreatePopulateInstallShellParametersProtocol(IN OUT EFI_SHELL_PARAMETERS_PROTOCOL **NewShellParameters, IN OUT BOOLEAN *RootShellInstance)
EFI_STATUS RestoreStdInStdOutStdErr(IN OUT EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters, IN SHELL_FILE_HANDLE *OldStdIn, IN SHELL_FILE_HANDLE *OldStdOut, IN SHELL_FILE_HANDLE *OldStdErr, IN SYSTEM_TABLE_INFO *SystemTableInfo)
VOID RestoreArgcArgv(IN OUT EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters, IN CHAR16 ***OldArgv, IN UINTN *OldArgc)
EFI_STATUS CleanUpShellParametersProtocol(IN OUT EFI_SHELL_PARAMETERS_PROTOCOL *NewShellParameters)
EFI_STATUS UpdateArgcArgv(IN OUT EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters, IN CONST CHAR16 *NewCommandLine, IN SHELL_OPERATION_TYPES Type, OUT CHAR16 ***OldArgv OPTIONAL, OUT UINTN *OldArgc OPTIONAL)
EFI_STATUS GetNextParameter(IN OUT CHAR16 **Walker, IN OUT CHAR16 **TempParameter, IN CONST UINTN Length, IN BOOLEAN StripQuotation)
EFI_STATUS UpdateStdInStdOutStdErr(IN OUT EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters, IN CHAR16 *NewCommandLine, OUT SHELL_FILE_HANDLE *OldStdIn, OUT SHELL_FILE_HANDLE *OldStdOut, OUT SHELL_FILE_HANDLE *OldStdErr, OUT SYSTEM_TABLE_INFO *SystemTableInfo)
CONST CHAR16 *EFIAPI EfiShellGetEnv(IN CONST CHAR16 *Name)
CONST CHAR16 *EFIAPI EfiShellGetCurDir(IN CONST CHAR16 *FileSystemMapping OPTIONAL)
EFI_STATUS InternalShellExecuteDevicePath(IN CONST EFI_HANDLE *ParentImageHandle, IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN CONST CHAR16 *CommandLine OPTIONAL, IN CONST CHAR16 **Environment OPTIONAL, OUT EFI_STATUS *StartImageStatus OPTIONAL)
EFI_STATUS InternalEfiShellSetEnv(IN CONST CHAR16 *Name, IN CONST CHAR16 *Value, IN BOOLEAN Volatile)
EFI_STATUS InternalSetAlias(IN CONST CHAR16 *Command, IN CONST CHAR16 *Alias, IN BOOLEAN Volatile)
EFI_STATUS CreatePopulateInstallShellProtocol(IN OUT EFI_SHELL_PROTOCOL **NewShell)
EFI_STATUS InernalEfiShellStartMonitor(VOID)
EFI_STATUS CleanUpShellEnvironment(IN OUT EFI_SHELL_PROTOCOL *NewShell)
INTN EFIAPI StringNoCaseCompare(IN CONST VOID *Buffer1, IN CONST VOID *Buffer2)
STATIC CONST CHAR8 ** Split(IN CHAR8 *Strings, IN UINTN Len, OUT UINT32 *NumPtr)
BOOLEAN Enabled
Set to FALSE when a break is requested.
UINTN RowCounter
Initial row of each print job.
EFI_KEY_TOGGLE_STATE KeyToggleState
EFI_SIMPLE_TEXT_OUTPUT_MODE * Mode
EFI_DEVICE_PATH_PROTOCOL * FilePath
EFI_HANDLE DeviceHandle
The device handle that the EFI Image was loaded from.
EFI_HANDLE ConsoleInHandle
EFI_SIMPLE_TEXT_INPUT_PROTOCOL * ConIn
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * ConOut
LIST_ENTRY Link
List enumerator items.
VOID * Data
The data structure format dependant upon Command. (not always used)
UINTN Line
What line of the script file this was on.
BOOLEAN Reset
Reset the command (it must be treated like a initial run (but it may have data already))
CHAR16 * Cl
The original command line.
CHAR16 * ScriptName
The filename of this script.
UINTN Argc
The count of parameters.
LIST_ENTRY CommandList
The script converted to a list of commands (SCRIPT_COMMAND_LIST objects).
SCRIPT_COMMAND_LIST * CurrentCommand
The command currently being operated. If !=NULL must be a member of CommandList.
CHAR16 ** Argv
The parmameters to the script file.
LIST_ENTRY SubstList
A list of current script loop alias' (ALIAS_LIST objects) (Used for the for %-based replacement).
UINT32 NoInterrupt
Was "-nointerrupt" found on command line.
UINT32 NoMap
Was "-nomap" found on command line.
UINT32 NoConsoleOut
Was "-noconsoleout" found on command line.
UINT32 NoConsoleIn
Was "-noconsolein" found on command line.
UINT32 Exit
Was "-_exit" found on command line.
UINT32 NoNest
Was "-nonest" found on command line.
UINT32 Delay
Was "-delay[:n] found on command line.
UINT32 Startup
Was "-startup" found on command line.
UINT32 NoStartup
Was "-nostartup" found on command line.
UINT32 NoVersion
Was "-noversion" found on command line.
UINTN LogScreenCount
How many screens of log information to save.
SPLIT_LIST SplitList
List of Splits in FILO stack.
EFI_DEVICE_PATH_PROTOCOL * FileDevPath
DevicePath for ourselves.
BUFFER_LIST BufferToFreeList
List of buffers that were returned to the user to free.
EFI_DEVICE_PATH_PROTOCOL * ImageDevPath
DevicePath for ourselves.
EFI_HII_HANDLE HiiHandle
Handle from HiiLib.
VOID * CtrlSNotifyHandle4
The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
VOID * CtrlSNotifyHandle2
The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
EFI_EVENT UserBreakTimer
Timer event for polling for CTRL-C.
VOID * CtrlSNotifyHandle3
The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
VOID * CtrlSNotifyHandle1
The NotifyHandle returned from SimpleTextInputEx.RegisterKeyNotify.
CONSOLE_LOGGER_PRIVATE_DATA * ConsoleInfo
Pointer for ConsoleInformation.
CHAR16 * FileOptions
Options to pass to FileName.
UINTN Delay
Seconds of delay default:5.
CHAR16 * FileName
Filename to run upon successful initialization.
BOOLEAN InsertMode
Is the current typing mode insert (FALSE = overwrite).
LIST_ENTRY Link
Standard linked list handler.