68 CONST CHAR16 *WorkingPath;
69 CONST CHAR16 *InputPath;
71 CHAR16 *InputFileSystem;
72 UINTN FileSystemCharCount;
73 CHAR16 *FullyQualifiedPath;
76 FullyQualifiedPath =
NULL;
78 ASSERT (Path !=
NULL);
93 InputPath =
StrStr (Path, L
":");
94 if (InputPath !=
NULL) {
96 FileSystemCharCount = ((
UINTN)InputPath - (
UINTN)Path +
sizeof (CHAR16)) /
sizeof (CHAR16);
97 InputFileSystem =
AllocateCopyPool (FileSystemCharCount *
sizeof (CHAR16), Path);
98 if (InputFileSystem !=
NULL) {
99 InputFileSystem[FileSystemCharCount - 1] = CHAR_NULL;
103 SHELL_FREE_NON_NULL (InputFileSystem);
109 if (WorkingPath ==
NULL) {
120 if (FullyQualifiedPath ==
NULL) {
126 if ((*InputPath == L
'\\') || (*InputPath == L
'/')) {
131 StrCpyS (FullyQualifiedPath, Size/
sizeof (CHAR16), WorkingPath);
132 CharPtr =
StrStr (FullyQualifiedPath, L
":");
133 if (CharPtr !=
NULL) {
134 *(CharPtr + 1) = CHAR_NULL;
140 StrCpyS (FullyQualifiedPath, Size/
sizeof (CHAR16), WorkingPath);
141 StrCatS (FullyQualifiedPath, Size/
sizeof (CHAR16), L
"\\");
147 StrCatS (FullyQualifiedPath, Size/
sizeof (CHAR16), InputPath);
153 return FullyQualifiedPath;
175 return (BOOLEAN)((Char >= L
'0' && Char <= L
'9') || (Char >= L
'A' && Char <= L
'F') || (Char >= L
'a' && Char <= L
'f'));
198 return (BOOLEAN)(Char >= L
'0' && Char <= L
'9');
220 Status =
gBS->OpenProtocol (
222 &gEfiShellEnvironment2Guid,
223 (VOID **)&mEfiShellEnvironment2,
226 EFI_OPEN_PROTOCOL_GET_PROTOCOL
231 if (EFI_ERROR (Status) || !(
CompareGuid (&mEfiShellEnvironment2->SESGuid, &gEfiShellEnvironment2ExtGuid))) {
235 Status =
gBS->LocateHandle (
237 &gEfiShellEnvironment2Guid,
245 if (Status == EFI_BUFFER_TOO_SMALL) {
247 if (Buffer ==
NULL) {
248 return (EFI_OUT_OF_RESOURCES);
251 Status =
gBS->LocateHandle (
253 &gEfiShellEnvironment2Guid,
260 if (!EFI_ERROR (Status) && (Buffer !=
NULL)) {
264 Status = EFI_NOT_FOUND;
265 for (HandleIndex = 0; HandleIndex < (BufferSize/
sizeof (Buffer[0])); HandleIndex++) {
266 Status =
gBS->OpenProtocol (
268 &gEfiShellEnvironment2Guid,
269 (VOID **)&mEfiShellEnvironment2,
272 EFI_OPEN_PROTOCOL_GET_PROTOCOL
274 if (
CompareGuid (&mEfiShellEnvironment2->SESGuid, &gEfiShellEnvironment2ExtGuid)) {
275 mEfiShellEnvironment2Handle = Buffer[HandleIndex];
283 if (Buffer !=
NULL) {
307 if (gEfiShellProtocol ==
NULL) {
311 Status =
gBS->OpenProtocol (
313 &gEfiShellProtocolGuid,
314 (VOID **)&gEfiShellProtocol,
317 EFI_OPEN_PROTOCOL_GET_PROTOCOL
319 if (EFI_ERROR (Status)) {
323 Status =
gBS->LocateProtocol (
324 &gEfiShellProtocolGuid,
326 (VOID **)&gEfiShellProtocol
328 if (EFI_ERROR (Status)) {
329 gEfiShellProtocol =
NULL;
334 if (gEfiShellParametersProtocol ==
NULL) {
335 Status =
gBS->OpenProtocol (
337 &gEfiShellParametersProtocolGuid,
338 (VOID **)&gEfiShellParametersProtocol,
341 EFI_OPEN_PROTOCOL_GET_PROTOCOL
343 if (EFI_ERROR (Status)) {
344 gEfiShellParametersProtocol =
NULL;
348 if (gEfiShellProtocol ==
NULL) {
354 if (EFI_ERROR (Status)) {
355 DEBUG ((DEBUG_ERROR,
"Status: 0x%08x\r\n", Status));
356 mEfiShellEnvironment2 =
NULL;
359 Status =
gBS->OpenProtocol (
361 &gEfiShellInterfaceGuid,
362 (VOID **)&mEfiShellInterface,
365 EFI_OPEN_PROTOCOL_GET_PROTOCOL
367 if (EFI_ERROR (Status)) {
368 mEfiShellInterface =
NULL;
378 if (((mEfiShellEnvironment2 !=
NULL) && (mEfiShellInterface !=
NULL)) ||
379 (gEfiShellProtocol !=
NULL)
382 if (gEfiShellProtocol !=
NULL) {
383 FileFunctionMap.GetFileInfo = gEfiShellProtocol->GetFileInfo;
384 FileFunctionMap.SetFileInfo = gEfiShellProtocol->SetFileInfo;
385 FileFunctionMap.ReadFile = gEfiShellProtocol->ReadFile;
386 FileFunctionMap.WriteFile = gEfiShellProtocol->WriteFile;
387 FileFunctionMap.CloseFile = gEfiShellProtocol->CloseFile;
388 FileFunctionMap.DeleteFile = gEfiShellProtocol->DeleteFile;
389 FileFunctionMap.GetFilePosition = gEfiShellProtocol->GetFilePosition;
390 FileFunctionMap.SetFilePosition = gEfiShellProtocol->SetFilePosition;
391 FileFunctionMap.FlushFile = gEfiShellProtocol->FlushFile;
392 FileFunctionMap.GetFileSize = gEfiShellProtocol->GetFileSize;
409 return (EFI_NOT_FOUND);
430 mEfiShellEnvironment2 =
NULL;
431 gEfiShellProtocol =
NULL;
432 gEfiShellParametersProtocol =
NULL;
433 mEfiShellInterface =
NULL;
434 mEfiShellEnvironment2Handle =
NULL;
435 mUnicodeCollationProtocol =
NULL;
440 if (
PcdGetBool (PcdShellLibAutoInitialize) == 0) {
465 if (mEfiShellEnvironment2 !=
NULL) {
466 Status =
gBS->CloseProtocol (
467 mEfiShellEnvironment2Handle ==
NULL ? ImageHandle : mEfiShellEnvironment2Handle,
468 &gEfiShellEnvironment2Guid,
472 if (!EFI_ERROR (Status)) {
473 mEfiShellEnvironment2 =
NULL;
474 mEfiShellEnvironment2Handle =
NULL;
478 if (mEfiShellInterface !=
NULL) {
479 Status =
gBS->CloseProtocol (
481 &gEfiShellInterfaceGuid,
485 if (!EFI_ERROR (Status)) {
486 mEfiShellInterface =
NULL;
490 if (gEfiShellProtocol !=
NULL) {
491 Status =
gBS->CloseProtocol (
493 &gEfiShellProtocolGuid,
497 if (!EFI_ERROR (Status)) {
498 gEfiShellProtocol =
NULL;
502 if (gEfiShellParametersProtocol !=
NULL) {
503 Status =
gBS->CloseProtocol (
505 &gEfiShellParametersProtocolGuid,
509 if (!EFI_ERROR (Status)) {
510 gEfiShellParametersProtocol =
NULL;
541 if (
PcdGetBool (PcdShellLibAutoInitialize) != 0) {
574 IN SHELL_FILE_HANDLE FileHandle
577 return (FileFunctionMap.GetFileInfo (FileHandle));
602 IN SHELL_FILE_HANDLE FileHandle,
606 return (FileFunctionMap.SetFileInfo (FileHandle,
FileInfo));
642 OUT SHELL_FILE_HANDLE *FileHandle,
651 if ((FilePath ==
NULL) || (FileHandle ==
NULL)) {
652 return (EFI_INVALID_PARAMETER);
658 if (gEfiShellProtocol !=
NULL) {
662 FileName = gEfiShellProtocol->GetFilePathFromDevicePath (*FilePath);
663 if (FileName ==
NULL) {
664 return (EFI_INVALID_PARAMETER);
676 if (EFI_ERROR (Status)) {
683 *FileHandle = (VOID *)File;
722 OUT SHELL_FILE_HANDLE *FileHandle,
730 CHAR16 *FileNameCopy;
736 ASSERT (FileName !=
NULL);
738 if (FileName ==
NULL) {
739 return (EFI_INVALID_PARAMETER);
742 if (gEfiShellProtocol !=
NULL) {
743 if ((OpenMode & EFI_FILE_MODE_CREATE) == EFI_FILE_MODE_CREATE) {
747 if ((Attributes & EFI_FILE_DIRECTORY) == EFI_FILE_DIRECTORY) {
755 if (FileNameCopy ==
NULL) {
756 return (EFI_OUT_OF_RESOURCES);
766 SHELL_FREE_NON_NULL (FileNameCopy);
772 Status = gEfiShellProtocol->OpenFileByName (
777 if (EFI_ERROR (Status)) {
781 if (mUnicodeCollationProtocol ==
NULL) {
782 Status =
gBS->LocateProtocol (&gEfiUnicodeCollation2ProtocolGuid,
NULL, (VOID **)&mUnicodeCollationProtocol);
783 if (EFI_ERROR (Status)) {
784 gEfiShellProtocol->CloseFile (*FileHandle);
789 if ((mUnicodeCollationProtocol->StriColl (mUnicodeCollationProtocol, (CHAR16 *)FileName, L
"NUL") != 0) &&
790 (mUnicodeCollationProtocol->StriColl (mUnicodeCollationProtocol, (CHAR16 *)FileName, L
"NULL") != 0) &&
791 !EFI_ERROR (Status) && ((OpenMode & EFI_FILE_MODE_CREATE) != 0))
793 FileInfo = FileFunctionMap.GetFileInfo (*FileHandle);
796 Status2 = FileFunctionMap.SetFileInfo (*FileHandle,
FileInfo);
798 if (EFI_ERROR (Status2)) {
799 gEfiShellProtocol->CloseFile (*FileHandle);
813 ASSERT (mEfiShellEnvironment2 !=
NULL);
814 FilePath = mEfiShellEnvironment2->NameToPath ((CHAR16 *)FileName);
815 if (FilePath !=
NULL) {
824 return (EFI_DEVICE_ERROR);
858 IN CONST CHAR16 *DirectoryName,
859 OUT SHELL_FILE_HANDLE *FileHandle
862 if (gEfiShellProtocol !=
NULL) {
866 return (gEfiShellProtocol->CreateFile (
875 EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE,
913 IN SHELL_FILE_HANDLE FileHandle,
918 return (FileFunctionMap.ReadFile (FileHandle, BufferSize, Buffer));
948 IN SHELL_FILE_HANDLE FileHandle,
953 return (FileFunctionMap.WriteFile (FileHandle, BufferSize, Buffer));
970 IN SHELL_FILE_HANDLE *FileHandle
973 return (FileFunctionMap.CloseFile (*FileHandle));
993 IN SHELL_FILE_HANDLE *FileHandle
996 return (FileFunctionMap.DeleteFile (*FileHandle));
1021 IN SHELL_FILE_HANDLE FileHandle,
1025 return (FileFunctionMap.SetFilePosition (FileHandle, Position));
1046 IN SHELL_FILE_HANDLE FileHandle,
1047 OUT UINT64 *Position
1050 return (FileFunctionMap.GetFilePosition (FileHandle, Position));
1070 IN SHELL_FILE_HANDLE FileHandle
1073 return (FileFunctionMap.FlushFile (FileHandle));
1101 IN SHELL_FILE_HANDLE DirHandle,
1132 IN SHELL_FILE_HANDLE DirHandle,
1161 IN SHELL_FILE_HANDLE FileHandle,
1165 return (FileFunctionMap.GetFileSize (FileHandle, Size));
1185 if (gEfiShellProtocol !=
NULL) {
1189 if (
gBS->CheckEvent (gEfiShellProtocol->ExecutionBreak) !=
EFI_SUCCESS) {
1199 if (mEfiShellEnvironment2 !=
NULL) {
1200 return (mEfiShellEnvironment2->GetExecutionBreak ());
1226 if (gEfiShellProtocol !=
NULL) {
1227 return (gEfiShellProtocol->GetEnv (EnvKey));
1233 if (mEfiShellEnvironment2 !=
NULL) {
1234 return (mEfiShellEnvironment2->GetEnv ((CHAR16 *)EnvKey));
1271 if (gEfiShellProtocol !=
NULL) {
1272 return (gEfiShellProtocol->SetEnv (EnvKey, EnvVal, Volatile));
1278 return (EFI_UNSUPPORTED);
1315 IN CHAR16 *CommandLine OPTIONAL,
1316 IN BOOLEAN Output OPTIONAL,
1317 IN CHAR16 **EnvironmentVariables OPTIONAL,
1326 if (gEfiShellProtocol !=
NULL) {
1330 return (gEfiShellProtocol->Execute (
1333 EnvironmentVariables,
1341 if (mEfiShellEnvironment2 !=
NULL) {
1364 CmdStatus = (mEfiShellEnvironment2->Execute (
1372 if (Status !=
NULL) {
1373 *Status = CmdStatus;
1384 return (EFI_UNSUPPORTED);
1404 IN CHAR16 *
CONST DeviceName OPTIONAL
1410 if (gEfiShellProtocol !=
NULL) {
1411 return (gEfiShellProtocol->GetCurDir (DeviceName));
1417 if (mEfiShellEnvironment2 !=
NULL) {
1418 return (mEfiShellEnvironment2->CurDir (DeviceName));
1435 IN BOOLEAN CurrentState
1441 if (CurrentState != 0x00) {
1445 if (gEfiShellProtocol !=
NULL) {
1449 gEfiShellProtocol->EnablePageBreak ();
1455 if (mEfiShellEnvironment2 !=
NULL) {
1459 mEfiShellEnvironment2->EnablePageBreak (DEFAULT_INIT_ROW, DEFAULT_AUTO_LF);
1467 if (gEfiShellProtocol !=
NULL) {
1471 gEfiShellProtocol->DisablePageBreak ();
1477 if (mEfiShellEnvironment2 !=
NULL) {
1481 mEfiShellEnvironment2->DisablePageBreak ();
1497 SHELL_FILE_HANDLE Handle;
1528 ASSERT (FileList !=
NULL);
1529 ASSERT (ListHead !=
NULL);
1534 for (Link = FileList->ForwardLink; Link != FileList; Link = Link->ForwardLink) {
1536 ASSERT (OldInfo !=
NULL);
1556 if (NewInfo ==
NULL) {
1585 SHELL_FREE_NON_NULL (NewInfo->
FullName);
1586 SHELL_FREE_NON_NULL (NewInfo->
FileName);
1587 SHELL_FREE_NON_NULL (NewInfo->
Info);
1588 SHELL_FREE_NON_NULL (NewInfo);
1640 CHAR16 *CleanFilePathStr;
1645 ASSERT (Arg !=
NULL);
1646 ASSERT (ListHead !=
NULL);
1648 CleanFilePathStr =
NULL;
1651 if (EFI_ERROR (Status)) {
1658 if (gEfiShellProtocol !=
NULL) {
1659 if (*ListHead ==
NULL) {
1661 if (*ListHead ==
NULL) {
1663 return (EFI_OUT_OF_RESOURCES);
1669 Status = gEfiShellProtocol->OpenFileList (
1674 if (EFI_ERROR (Status)) {
1675 gEfiShellProtocol->RemoveDupInFileList (ListHead);
1677 Status = gEfiShellProtocol->RemoveDupInFileList (ListHead);
1684 return (EFI_NOT_FOUND);
1694 if (mEfiShellEnvironment2 !=
NULL) {
1703 Status = mEfiShellEnvironment2->FileMetaArg (CleanFilePathStr, &mOldStyleFileList);
1704 if (EFI_ERROR (Status)) {
1710 if (*ListHead ==
NULL) {
1712 if (*ListHead ==
NULL) {
1714 return (EFI_OUT_OF_RESOURCES);
1728 mEfiShellEnvironment2->FreeFileList (&mOldStyleFileList);
1730 if (((*ListHead)->Link.ForwardLink == (*ListHead)->Link.BackLink) && ((*ListHead)->Link.BackLink == &((*ListHead)->Link))) {
1733 Status = EFI_NOT_FOUND;
1741 return (EFI_UNSUPPORTED);
1764 ASSERT (ListHead !=
NULL);
1769 if (gEfiShellProtocol !=
NULL) {
1770 return (gEfiShellProtocol->FreeFileList (ListHead));
1771 }
else if (mEfiShellEnvironment2 !=
NULL) {
1788 SHELL_FREE_NON_NULL (*ListHead);
1792 return (EFI_UNSUPPORTED);
1814 SHELL_FILE_HANDLE Handle;
1818 CONST CHAR16 *Walker;
1828 if (!EFI_ERROR (Status)) {
1830 ASSERT (RetVal ==
NULL);
1841 Size =
StrSize (Path) +
sizeof (CHAR16);
1844 if (TestPath ==
NULL) {
1848 StrCpyS (TestPath, Size/
sizeof (CHAR16), Path);
1849 StrCatS (TestPath, Size/
sizeof (CHAR16), L
"\\");
1850 StrCatS (TestPath, Size/
sizeof (CHAR16), FileName);
1852 if (!EFI_ERROR (Status)) {
1854 ASSERT (RetVal ==
NULL);
1869 Size =
StrSize (Path)+
sizeof (CHAR16);
1872 if (TestPath ==
NULL) {
1876 Walker = (CHAR16 *)Path;
1879 if (TestPath !=
NULL) {
1880 TempChar =
StrStr (TestPath, L
";");
1881 if (TempChar !=
NULL) {
1882 *TempChar = CHAR_NULL;
1885 if (TestPath[
StrLen (TestPath)-1] != L
'\\') {
1886 StrCatS (TestPath, Size/
sizeof (CHAR16), L
"\\");
1889 if (FileName[0] == L
'\\') {
1893 StrCatS (TestPath, Size/
sizeof (CHAR16), FileName);
1895 Walker =
StrStr (Walker, L
";") + 1;
1901 if (!EFI_ERROR (Status)) {
1903 ASSERT (RetVal ==
NULL);
1912 }
while (Walker !=
NULL && Walker[0] != CHAR_NULL);
1940 IN CONST CHAR16 *FileExtension
1945 CONST CHAR16 *ExtensionWalker;
1950 ASSERT (FileName !=
NULL);
1951 if (FileExtension ==
NULL) {
1956 if (RetVal !=
NULL) {
1961 Size +=
StrSize (FileExtension);
1963 if (TestPath ==
NULL) {
1967 for (ExtensionWalker = FileExtension, TempChar2 = (CHAR16 *)FileExtension; TempChar2 !=
NULL; ExtensionWalker = TempChar2 + 1) {
1968 StrCpyS (TestPath, Size/
sizeof (CHAR16), FileName);
1969 if (ExtensionWalker !=
NULL) {
1970 StrCatS (TestPath, Size/
sizeof (CHAR16), ExtensionWalker);
1973 TempChar =
StrStr (TestPath, L
";");
1974 if (TempChar !=
NULL) {
1975 *TempChar = CHAR_NULL;
1979 if (RetVal !=
NULL) {
1983 ASSERT (ExtensionWalker !=
NULL);
1984 TempChar2 =
StrStr (ExtensionWalker, L
";");
1996 UINTN OriginalPosition;
2027 ASSERT (CheckList !=
NULL);
2028 ASSERT (Type !=
NULL);
2029 ASSERT (Name !=
NULL);
2034 if ((
StrCmp (Name, L
"-?") == 0) ||
2035 (
StrCmp (Name, L
"-b") == 0)
2045 for (TempListItem = (
SHELL_PARAM_ITEM *)CheckList; TempListItem->Name !=
NULL; TempListItem++) {
2051 if (
StrnCmp (Name, TempListItem->Name,
StrLen (TempListItem->Name)) == 0) {
2052 *Type = TempListItem->Type;
2058 if (TempString !=
NULL) {
2060 *Type = TempListItem->Type;
2068 *Type = TempListItem->Type;
2089 IN CONST BOOLEAN AlwaysAllowNumbers,
2096 ASSERT (Name !=
NULL);
2108 if ((Name[0] == L
'/') ||
2109 (Name[0] == L
'-') ||
2148 OUT CHAR16 **ProblemParam OPTIONAL,
2149 IN BOOLEAN AutoPageBreak,
2152 IN BOOLEAN AlwaysAllowNumbers
2161 CONST CHAR16 *TempPointer;
2162 UINTN CurrentValueSize;
2165 CurrentItemPackage =
NULL;
2174 *CheckPackage =
NULL;
2181 ASSERT (CheckList !=
NULL);
2182 ASSERT (Argv !=
NULL);
2188 if (*CheckPackage ==
NULL) {
2189 return (EFI_OUT_OF_RESOURCES);
2197 for (LoopCounter = 0; LoopCounter < Argc; ++LoopCounter) {
2198 if (Argv[LoopCounter] ==
NULL) {
2206 if (GetItemValue != 0) {
2215 if (CurrentItemPackage ==
NULL) {
2217 *CheckPackage =
NULL;
2218 return (EFI_OUT_OF_RESOURCES);
2222 if (CurrentItemPackage->Name ==
NULL) {
2224 *CheckPackage =
NULL;
2225 return (EFI_OUT_OF_RESOURCES);
2228 CurrentItemPackage->Type = CurrentItemType;
2229 CurrentItemPackage->OriginalPosition = (
UINTN)(-1);
2230 CurrentItemPackage->Value =
NULL;
2235 switch (CurrentItemPackage->Type) {
2249 GetItemValue = (
UINTN)(-1);
2257 ASSERT (GetItemValue == 0);
2260 }
else if ((GetItemValue != 0) && (CurrentItemPackage !=
NULL) && !
InternalIsFlag (Argv[LoopCounter], AlwaysAllowNumbers, (BOOLEAN)(CurrentItemPackage->Type ==
TypeTimeValue))) {
2264 CurrentValueSize = ValueSize +
StrSize (Argv[LoopCounter]) +
sizeof (CHAR16);
2265 NewValue =
ReallocatePool (ValueSize, CurrentValueSize, CurrentItemPackage->Value);
2266 if (NewValue ==
NULL) {
2267 SHELL_FREE_NON_NULL (CurrentItemPackage->Value);
2268 SHELL_FREE_NON_NULL (CurrentItemPackage);
2270 *CheckPackage =
NULL;
2271 return EFI_OUT_OF_RESOURCES;
2274 CurrentItemPackage->Value = NewValue;
2275 if (ValueSize == 0) {
2277 CurrentItemPackage->Value,
2278 CurrentValueSize/sizeof (CHAR16),
2283 CurrentItemPackage->Value,
2284 CurrentValueSize/sizeof (CHAR16),
2288 CurrentItemPackage->Value,
2289 CurrentValueSize/sizeof (CHAR16),
2294 ValueSize +=
StrSize (Argv[LoopCounter]) +
sizeof (CHAR16);
2297 if (GetItemValue == 0) {
2305 TempPointer = Argv[LoopCounter];
2306 if ( ((*TempPointer == L
'^') && (*(TempPointer+1) == L
'-'))
2307 || ((*TempPointer == L
'^') && (*(TempPointer+1) == L
'/'))
2308 || ((*TempPointer == L
'^') && (*(TempPointer+1) == L
'+'))
2315 if (CurrentItemPackage ==
NULL) {
2317 *CheckPackage =
NULL;
2318 return (EFI_OUT_OF_RESOURCES);
2321 CurrentItemPackage->Name =
NULL;
2324 if (CurrentItemPackage->Value ==
NULL) {
2326 *CheckPackage =
NULL;
2327 return (EFI_OUT_OF_RESOURCES);
2330 CurrentItemPackage->OriginalPosition = Count++;
2336 if (ProblemParam !=
NULL) {
2341 *CheckPackage =
NULL;
2342 return (EFI_VOLUME_CORRUPTED);
2346 if (GetItemValue != 0) {
2390 OUT CHAR16 **ProblemParam OPTIONAL,
2391 IN BOOLEAN AutoPageBreak,
2392 IN BOOLEAN AlwaysAllowNumbers
2398 ASSERT (CheckList !=
NULL);
2399 ASSERT (CheckPackage !=
NULL);
2404 if (gEfiShellParametersProtocol !=
NULL) {
2410 (
CONST CHAR16 **)gEfiShellParametersProtocol->
Argv,
2411 gEfiShellParametersProtocol->
Argc,
2419 ASSERT (mEfiShellInterface !=
NULL);
2425 (
CONST CHAR16 **)mEfiShellInterface->
Argv,
2426 mEfiShellInterface->Argc,
2454 if (CheckPackage ==
NULL) {
2524 if ((CheckPackage ==
NULL) || (KeyString ==
NULL)) {
2532 ; !
IsNull (CheckPackage, Node)
2550 if (TempString !=
NULL) {
2584 IN CHAR16 *KeyString
2593 if ((CheckPackage ==
NULL) || (KeyString ==
NULL)) {
2601 ; !
IsNull (CheckPackage, Node)
2619 if (TempString !=
NULL) {
2661 if (CheckPackage ==
NULL) {
2669 ; !
IsNull (CheckPackage, Node)
2703 if (CheckPackage ==
NULL) {
2708 ; !
IsNull (CheckPackage, Node1)
2744 ASSERT (CheckPackage !=
NULL);
2747 ; !
IsNull (CheckPackage, Node1)
2752 ; !
IsNull (CheckPackage, Node2)
2757 if (Param !=
NULL) {
2762 return (EFI_DEVICE_ERROR);
2800 IN CHAR16
CONST *SourceString,
2805 IN CONST BOOLEAN SkipPreCarrot,
2806 IN CONST BOOLEAN ParameterReplacing
2812 if ( (SourceString ==
NULL)
2814 || (FindTarget ==
NULL)
2815 || (ReplaceWith ==
NULL)
2816 || (
StrLen (FindTarget) < 1)
2817 || (
StrLen (SourceString) < 1)
2820 return (EFI_INVALID_PARAMETER);
2824 if ((
StrStr (ReplaceWith, L
" ") ==
NULL) || !ParameterReplacing) {
2828 if (Replace !=
NULL) {
2833 if (Replace ==
NULL) {
2834 return (EFI_OUT_OF_RESOURCES);
2838 while (*SourceString != CHAR_NULL) {
2843 if ( (
StrnCmp (SourceString, FindTarget,
StrLen (FindTarget)) == 0)
2844 && ((SkipPreCarrot && (*(SourceString-1) != L
'^')) || !SkipPreCarrot)
2847 SourceString +=
StrLen (FindTarget);
2849 if ((Size + (
StrLen (Replace)*
sizeof (CHAR16))) > NewSize) {
2851 return (EFI_BUFFER_TOO_SMALL);
2857 if (Size +
sizeof (CHAR16) > NewSize) {
2859 return (EFI_BUFFER_TOO_SMALL);
2888 Size =
StrSize (String) -
sizeof (CHAR16);
2893 if (gEfiShellParametersProtocol !=
NULL) {
2894 return (gEfiShellProtocol->WriteFile (gEfiShellParametersProtocol->
StdOut, &Size, (VOID *)String));
2897 if (mEfiShellInterface !=
NULL) {
2898 if (mEfiShellInterface->RedirArgc == 0) {
2905 return (mEfiShellInterface->StdOut->Write (mEfiShellInterface->StdOut, &Size, (VOID *)String));
2909 return (EFI_UNSUPPORTED);
2943 IN INT32 Col OPTIONAL,
2944 IN INT32 Row OPTIONAL,
2950 CHAR16 *ResumeLocation;
2951 CHAR16 *FormatWalker;
2952 UINTN OriginalAttribute;
2953 CHAR16 *mPostReplaceFormat;
2954 CHAR16 *mPostReplaceFormat2;
2959 if ((mPostReplaceFormat ==
NULL) || (mPostReplaceFormat2 ==
NULL)) {
2960 SHELL_FREE_NON_NULL (mPostReplaceFormat);
2961 SHELL_FREE_NON_NULL (mPostReplaceFormat2);
2962 return (EFI_OUT_OF_RESOURCES);
2987 if ((Col != -1) && (Row != -1)) {
2991 FormatWalker = mPostReplaceFormat2;
2992 while (*FormatWalker != CHAR_NULL) {
2996 ResumeLocation =
StrStr (FormatWalker, L
"%");
2997 if (ResumeLocation !=
NULL) {
2998 *ResumeLocation = CHAR_NULL;
3004 if (
StrLen (FormatWalker) > 0) {
3006 if (EFI_ERROR (Status)) {
3014 if (ResumeLocation !=
NULL) {
3015 if ((ResumeLocation != mPostReplaceFormat2) && (*(ResumeLocation-1) == L
'^')) {
3025 ResumeLocation = ResumeLocation - 1;
3027 switch (*(ResumeLocation+1)) {
3032 gST->
ConOut->SetAttribute (
gST->
ConOut, EFI_TEXT_ATTR (EFI_YELLOW, ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)));
3035 gST->
ConOut->SetAttribute (
gST->
ConOut, EFI_TEXT_ATTR (EFI_WHITE, ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)));
3038 gST->
ConOut->SetAttribute (
gST->
ConOut, EFI_TEXT_ATTR (EFI_LIGHTBLUE, ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)));
3041 gST->
ConOut->SetAttribute (
gST->
ConOut, EFI_TEXT_ATTR (EFI_LIGHTGREEN, ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)));
3048 if (EFI_ERROR (Status)) {
3052 ResumeLocation = ResumeLocation - 1;
3066 FormatWalker = ResumeLocation + 2;
3071 SHELL_FREE_NON_NULL (mPostReplaceFormat);
3072 SHELL_FREE_NON_NULL (mPostReplaceFormat2);
3108 IN INT32 Col OPTIONAL,
3109 IN INT32 Row OPTIONAL,
3117 if (Format ==
NULL) {
3118 return (EFI_INVALID_PARAMETER);
3162 IN INT32 Col OPTIONAL,
3163 IN INT32 Row OPTIONAL,
3164 IN CONST CHAR8 *Language OPTIONAL,
3165 IN CONST EFI_STRING_ID HiiFormatStringId,
3171 CHAR16 *HiiFormatString;
3174 RetVal = EFI_DEVICE_ERROR;
3176 VA_START (Marker, HiiFormatHandle);
3177 HiiFormatString =
HiiGetString (HiiFormatHandle, HiiFormatStringId, Language);
3178 if (HiiFormatString !=
NULL) {
3180 SHELL_FREE_NON_NULL (HiiFormatString);
3205 SHELL_FILE_HANDLE Handle;
3206 CHAR16 *TempLocation;
3207 CHAR16 *TempLocation2;
3209 ASSERT (DirName !=
NULL);
3212 TempLocation =
NULL;
3215 if (EFI_ERROR (Status)) {
3219 if (gEfiShellProtocol !=
NULL) {
3221 if (TempLocation ==
NULL) {
3223 return (EFI_OUT_OF_RESOURCES);
3226 TempLocation2 =
StrStr (TempLocation, L
":");
3227 if ((TempLocation2 !=
NULL) && (
StrLen (
StrStr (TempLocation, L
":")) == 2)) {
3228 *(TempLocation2+1) = CHAR_NULL;
3231 if (gEfiShellProtocol->GetDevicePathFromMap (TempLocation) !=
NULL) {
3241 TempLocation =
StrStr (DirName, L
"\\");
3242 if ((TempLocation !=
NULL) && (*(TempLocation+1) == CHAR_NULL)) {
3256 return (EFI_NOT_FOUND);
3275 SHELL_FILE_HANDLE Handle;
3277 ASSERT (Name !=
NULL);
3282 if (EFI_ERROR (Status)) {
3292 return (EFI_NOT_FOUND);
3322 if (NewName ==
NULL) {
3323 return (EFI_NOT_FOUND);
3351 return ((
UINTN)RetVal);
3354 return ((
UINTN)(-1));
3382 return ((
UINTN)RetVal);
3385 return ((
UINTN)(-1));
3423 IN OUT CHAR16 **Destination,
3429 UINTN DestinationStartSize;
3435 ASSERT (Destination !=
NULL);
3440 if (Source ==
NULL) {
3441 return (*Destination);
3447 if ((CurrentSize !=
NULL) && (*CurrentSize == 0)) {
3448 *Destination =
NULL;
3454 if (*Destination !=
NULL) {
3455 ASSERT (CurrentSize != 0);
3456 DestinationStartSize =
StrSize (*Destination);
3457 ASSERT (DestinationStartSize <= *CurrentSize);
3459 DestinationStartSize = 0;
3473 if (CurrentSize !=
NULL) {
3474 NewSize = *CurrentSize;
3475 if (NewSize < DestinationStartSize + (Count *
sizeof (CHAR16))) {
3476 while (NewSize < (DestinationStartSize + (Count*
sizeof (CHAR16)))) {
3477 NewSize += 2 * Count *
sizeof (CHAR16);
3480 *Destination =
ReallocatePool (*CurrentSize, NewSize, *Destination);
3481 *CurrentSize = NewSize;
3484 NewSize = (Count+1)*
sizeof (CHAR16);
3491 if (*Destination ==
NULL) {
3495 StrnCatS (*Destination, NewSize/
sizeof (CHAR16), Source, Count);
3496 return *Destination;
3527 IN CHAR16 *Prompt OPTIONAL,
3528 IN OUT VOID **Response OPTIONAL
3538 Status = EFI_UNSUPPORTED;
3542 if (Type != ShellPromptResponseTypeFreeform) {
3545 if (Response !=
NULL) {
3549 return (EFI_OUT_OF_RESOURCES);
3554 case ShellPromptResponseTypeQuitContinue:
3555 if (Prompt !=
NULL) {
3564 if (EFI_ERROR (Status)) {
3569 if ((Key.UnicodeChar == L
'Q') || (Key.UnicodeChar == L
'q')) {
3570 *Resp = ShellPromptResponseQuit;
3572 *Resp = ShellPromptResponseContinue;
3576 case ShellPromptResponseTypeYesNoCancel:
3577 if (Prompt !=
NULL) {
3584 *Resp = ShellPromptResponseMax;
3585 while (*Resp == ShellPromptResponseMax) {
3587 Status = EFI_ABORTED;
3593 if (EFI_ERROR (Status)) {
3598 switch (Key.UnicodeChar) {
3601 *Resp = ShellPromptResponseYes;
3605 *Resp = ShellPromptResponseNo;
3609 *Resp = ShellPromptResponseCancel;
3615 case ShellPromptResponseTypeYesNoAllCancel:
3616 if (Prompt !=
NULL) {
3623 *Resp = ShellPromptResponseMax;
3624 while (*Resp == ShellPromptResponseMax) {
3626 Status = EFI_ABORTED;
3632 if (EFI_ERROR (Status)) {
3636 if ((Key.UnicodeChar <= 127) && (Key.UnicodeChar >= 32)) {
3640 switch (Key.UnicodeChar) {
3643 *Resp = ShellPromptResponseYes;
3647 *Resp = ShellPromptResponseNo;
3651 *Resp = ShellPromptResponseAll;
3655 *Resp = ShellPromptResponseCancel;
3661 case ShellPromptResponseTypeEnterContinue:
3662 case ShellPromptResponseTypeAnyKeyContinue:
3663 if (Prompt !=
NULL) {
3670 *Resp = ShellPromptResponseMax;
3671 while (*Resp == ShellPromptResponseMax) {
3673 Status = EFI_ABORTED;
3678 if (Type == ShellPromptResponseTypeEnterContinue) {
3680 if (EFI_ERROR (Status)) {
3685 if (Key.UnicodeChar == CHAR_CARRIAGE_RETURN) {
3686 *Resp = ShellPromptResponseContinue;
3691 if (Type == ShellPromptResponseTypeAnyKeyContinue) {
3694 *Resp = ShellPromptResponseContinue;
3700 case ShellPromptResponseTypeYesNo:
3701 if (Prompt !=
NULL) {
3708 *Resp = ShellPromptResponseMax;
3709 while (*Resp == ShellPromptResponseMax) {
3711 Status = EFI_ABORTED;
3717 if (EFI_ERROR (Status)) {
3722 switch (Key.UnicodeChar) {
3725 *Resp = ShellPromptResponseYes;
3729 *Resp = ShellPromptResponseNo;
3735 case ShellPromptResponseTypeFreeform:
3736 if (Prompt !=
NULL) {
3742 Status = EFI_ABORTED;
3748 if (EFI_ERROR (Status)) {
3753 if (Key.UnicodeChar == CHAR_CARRIAGE_RETURN) {
3757 ASSERT ((Buffer ==
NULL && Size == 0) || (Buffer !=
NULL));
3758 StrnCatGrow (&Buffer, &Size, &Key.UnicodeChar, 1);
3770 if (Response !=
NULL) {
3773 }
else if (Buffer !=
NULL) {
3783 if (Buffer !=
NULL) {
3813 IN CONST EFI_STRING_ID HiiFormatStringId,
3815 IN OUT VOID **Response
3823 if (Prompt !=
NULL) {
3852 BOOLEAN LeadingZero;
3854 if (String ==
NULL) {
3861 if (*String == L
'-') {
3865 if (*String == CHAR_NULL) {
3872 LeadingZero =
FALSE;
3873 while (*String == L
'0') {
3881 if ((*String == L
'x') || (*String == L
'X')) {
3891 }
else if (ForceHex) {
3900 for ( ; *String != CHAR_NULL && !(StopAtSpace && *String == L
' '); String++) {
3901 if (TimeNumbers && (String[0] == L
':')) {
3937 ASSERT (Name !=
NULL);
3941 if (EFI_ERROR (Status)) {
4015 return (EFI_INVALID_PARAMETER);
4021 while ((*String == L
' ') || (*String == L
'\t')) {
4028 while (*String == L
'0') {
4033 if (*(String - 1) != L
'0') {
4048 if (*String == L
' ') {
4049 return (EFI_INVALID_PARAMETER);
4059 return (EFI_DEVICE_ERROR);
4069 if (StopAtSpace && (*String == L
' ')) {
4117 return (EFI_INVALID_PARAMETER);
4123 while ((*String == L
' ') || (*String == L
'\t')) {
4130 while (*String == L
'0') {
4140 if (StopAtSpace && (*String == L
' ')) {
4151 if (!(Result <= (
DivU64x32 ((((UINT64) ~0) - (*String - L
'0')), 10)))) {
4152 return (EFI_DEVICE_ERROR);
4155 Result =
MultU64x32 (Result, 10) + (*String - L
'0');
4161 if (StopAtSpace && (*String == L
' ')) {
4195 CONST CHAR16 *Walker;
4205 return (EFI_INVALID_PARAMETER);
4208 return (EFI_INVALID_PARAMETER);
4215 for (Walker = String; Walker !=
NULL && *Walker != CHAR_NULL && *Walker == L
' '; Walker++) {
4222 return (EFI_INVALID_PARAMETER);
4228 if (Hex || (
StrnCmp (Walker, L
"0x", 2) == 0) || (
StrnCmp (Walker, L
"0X", 2) == 0)) {
4234 if ((Value ==
NULL) && !EFI_ERROR (Status)) {
4235 return (EFI_NOT_FOUND);
4238 if (Value !=
NULL) {
4291 IN SHELL_FILE_HANDLE Handle,
4292 IN OUT BOOLEAN *Ascii
4303 if (Status == EFI_BUFFER_TOO_SMALL) {
4305 if (RetVal ==
NULL) {
4312 if ((Status == EFI_END_OF_FILE) && (RetVal !=
NULL) && (*RetVal != CHAR_NULL)) {
4316 if (EFI_ERROR (Status) && (RetVal !=
NULL)) {
4364 IN SHELL_FILE_HANDLE Handle,
4365 IN OUT CHAR16 *Buffer,
4367 IN BOOLEAN Truncate,
4368 IN OUT BOOLEAN *Ascii
4375 UINT64 OriginalFilePosition;
4377 if ( (Handle ==
NULL)
4381 return (EFI_INVALID_PARAMETER);
4384 if (Buffer ==
NULL) {
4385 ASSERT (*Size == 0);
4387 *Buffer = CHAR_NULL;
4390 gEfiShellProtocol->GetFilePosition (Handle, &OriginalFilePosition);
4391 if (OriginalFilePosition == 0) {
4392 CharSize =
sizeof (CHAR16);
4393 Status = gEfiShellProtocol->ReadFile (Handle, &CharSize, &CharBuffer);
4399 gEfiShellProtocol->SetFilePosition (Handle, OriginalFilePosition);
4404 CharSize =
sizeof (CHAR8);
4406 CharSize =
sizeof (CHAR16);
4409 for (CountSoFar = 0; ; CountSoFar++) {
4411 Status = gEfiShellProtocol->ReadFile (Handle, &CharSize, &CharBuffer);
4412 if ( EFI_ERROR (Status)
4414 || ((CharBuffer == L
'\n') && !(*Ascii))
4415 || ((CharBuffer ==
'\n') && *Ascii)
4418 if (CharSize == 0) {
4419 Status = EFI_END_OF_FILE;
4428 if ((CountSoFar+1)*
sizeof (CHAR16) < *Size) {
4429 ASSERT (Buffer !=
NULL);
4430 ((CHAR16 *)Buffer)[CountSoFar] = CharBuffer;
4431 ((CHAR16 *)Buffer)[CountSoFar+1] = CHAR_NULL;
4438 if ((CountSoFar+1)*
sizeof (CHAR16) > *Size) {
4439 *Size = (CountSoFar+1)*
sizeof (CHAR16);
4441 gEfiShellProtocol->SetFilePosition (Handle, OriginalFilePosition);
4443 DEBUG ((DEBUG_WARN,
"The line was truncated in ShellFileHandleReadLine"));
4446 return (EFI_BUFFER_TOO_SMALL);
4449 while (Buffer[
StrLen (Buffer)-1] == L
'\r') {
4450 Buffer[
StrLen (Buffer)-1] = CHAR_NULL;
4470 IN CONST CHAR16 *CommandToGetHelpOn,
4471 IN CONST CHAR16 *SectionToGetHelpOn,
4472 IN BOOLEAN PrintCommandText
4483 Status = gEfiShellProtocol->GetHelpText (CommandToGetHelpOn, SectionToGetHelpOn, &OutText);
4488 if (EFI_ERROR (Status)) {
4492 if ((OutText ==
NULL) || (
StrLen (OutText) == 0)) {
4493 return EFI_NOT_FOUND;
4499 while (OutText[
StrLen (OutText)-1] == L
'\r' || OutText[
StrLen (OutText)-1] == L
'\n' || OutText[
StrLen (OutText)-1] == L
' ') {
4500 OutText[
StrLen (OutText)-1] = CHAR_NULL;
4506 if (PrintCommandText) {
4507 ShellPrintEx (-1, -1, L
"%H%-14s%N- %s\r\n", CommandToGetHelpOn, OutText);
4512 SHELL_FREE_NON_NULL (OutText);
4547 SHELL_FILE_HANDLE FileHandle;
4552 Status =
ShellOpenFileByName (FileName, &FileHandle, EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE, 0x0);
4573 IN CONST CHAR16 *OriginalString,
4574 OUT CHAR16 **CleanString
4579 if ((OriginalString ==
NULL) || (CleanString ==
NULL)) {
4580 return EFI_INVALID_PARAMETER;
4584 if (*CleanString ==
NULL) {
4585 return EFI_OUT_OF_RESOURCES;
4588 for (Walker = *CleanString; Walker !=
NULL && *Walker != CHAR_NULL; Walker++) {
4589 if (*Walker == L
'\"') {
4590 CopyMem (Walker, Walker+1,
StrSize (Walker) -
sizeof (Walker[0]));
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)
CHAR16 EFIAPI CharToUpper(IN CHAR16 Char)
LIST_ENTRY *EFIAPI GetNextNode(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
UINT64 EFIAPI DivU64x32(IN UINT64 Dividend, IN UINT32 Divisor)
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)
UINT64 EFIAPI RShiftU64(IN UINT64 Operand, IN UINTN Count)
UINT64 EFIAPI MultU64x32(IN UINT64 Multiplicand, IN UINT32 Multiplier)
CHAR16 *EFIAPI PathCleanUpDirectories(IN CHAR16 *Path)
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)
UINT64 EFIAPI LShiftU64(IN UINT64 Operand, IN UINTN Count)
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)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
#define SHELL_FILE_ARG_SIGNATURE
Signature for SHELL_FILE_ARG.
VOID *EFIAPI ReallocatePool(IN UINTN OldSize, IN UINTN NewSize, IN VOID *OldBuffer OPTIONAL)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
EFI_STATUS EFIAPI FileHandleFlush(IN EFI_FILE_HANDLE FileHandle)
EFI_STATUS EFIAPI FileHandleSetInfo(IN EFI_FILE_HANDLE FileHandle, IN CONST EFI_FILE_INFO *FileInfo)
EFI_STATUS EFIAPI FileHandleGetPosition(IN EFI_FILE_HANDLE FileHandle, OUT UINT64 *Position)
EFI_STATUS EFIAPI FileHandleSetPosition(IN EFI_FILE_HANDLE FileHandle, IN UINT64 Position)
EFI_FILE_INFO *EFIAPI FileHandleGetInfo(IN EFI_FILE_HANDLE FileHandle)
EFI_STATUS EFIAPI FileHandleIsDirectory(IN EFI_FILE_HANDLE DirHandle)
EFI_STATUS EFIAPI FileHandleFindNextFile(IN EFI_FILE_HANDLE DirHandle, OUT EFI_FILE_INFO *Buffer, OUT BOOLEAN *NoFile)
EFI_STATUS EFIAPI FileHandleClose(IN EFI_FILE_HANDLE FileHandle)
EFI_STATUS EFIAPI FileHandleGetSize(IN EFI_FILE_HANDLE FileHandle, OUT UINT64 *Size)
EFI_STATUS EFIAPI FileHandleDelete(IN EFI_FILE_HANDLE FileHandle)
EFI_STATUS EFIAPI FileHandleFindFirstFile(IN EFI_FILE_HANDLE DirHandle, OUT EFI_FILE_INFO **Buffer)
EFI_STATUS EFIAPI FileHandleWrite(IN EFI_FILE_HANDLE FileHandle, IN OUT UINTN *BufferSize, IN VOID *Buffer)
EFI_STATUS EFIAPI FileHandleRead(IN EFI_FILE_HANDLE FileHandle, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
CONST UINT16 gUnicodeFileTag
EFI_STRING EFIAPI HiiGetString(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId, IN CONST CHAR8 *Language OPTIONAL)
UINTN EFIAPI UnicodeVSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString, IN VA_LIST Marker)
UINTN EFIAPI UnicodeSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
#define VA_START(Marker, Parameter)
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
#define CR(Record, TYPE, Field, TestSignature)
EFI_FILE_INFO *(EFIAPI * EFI_SHELL_GET_FILE_INFO)(IN SHELL_FILE_HANDLE FileHandle)
EFI_STATUS(EFIAPI * EFI_SHELL_SET_FILE_INFO)(IN SHELL_FILE_HANDLE FileHandle, IN CONST EFI_FILE_INFO *FileInfo)
EFI_STATUS(EFIAPI * EFI_SHELL_CLOSE_FILE)(IN SHELL_FILE_HANDLE FileHandle)
EFI_STATUS(EFIAPI * EFI_SHELL_WRITE_FILE)(IN SHELL_FILE_HANDLE FileHandle, IN OUT UINTN *BufferSize, IN VOID *Buffer)
EFI_STATUS(EFIAPI * EFI_SHELL_GET_FILE_POSITION)(IN SHELL_FILE_HANDLE FileHandle, OUT UINT64 *Position)
EFI_STATUS(EFIAPI * EFI_SHELL_DELETE_FILE)(IN SHELL_FILE_HANDLE FileHandle)
EFI_STATUS(EFIAPI * EFI_SHELL_READ_FILE)(IN SHELL_FILE_HANDLE FileHandle, IN OUT UINTN *ReadSize, IN OUT VOID *Buffer)
EFI_STATUS(EFIAPI * EFI_SHELL_SET_FILE_POSITION)(IN SHELL_FILE_HANDLE FileHandle, IN UINT64 Position)
EFI_STATUS(EFIAPI * EFI_SHELL_GET_FILE_SIZE)(IN SHELL_FILE_HANDLE FileHandle, OUT UINT64 *Size)
EFI_STATUS(EFIAPI * EFI_SHELL_FLUSH_FILE)(IN SHELL_FILE_HANDLE FileHandle)
#define PcdGet32(TokenName)
#define PcdGetBool(TokenName)
EFI_FILE_INFO * FileInfo(IN EFI_FILE_HANDLE FHand)
EFI_STRING_ID NewString(IN CHAR16 *String, IN EFI_HII_HANDLE HiiHandle)
SHELL_PROMPT_REQUEST_TYPE
@ TypeStart
A flag that has variable value appended to the end (IE "-ad", "-afd", "-adf", etc....
@ TypeValue
A flag that has some data following it with a space (IE "-a 1").
@ TypeTimeValue
A flag that has a time value following it (IE "-a -5:00").
@ TypeMaxValue
A flag followed by all the command line data before the next flag.
@ TypeDoubleValue
A flag that has 2 space seperated value data following it (IE "-a 1 2").
@ TypeFlag
A flag that is present or not present only (IE "-a").
@ TypePosition
Some data that did not follow a parameter (IE "filename.txt").
INTN EFIAPI StringNoCaseCompare(IN CONST VOID *Buffer1, IN CONST VOID *Buffer2)
EFI_STATUS EFIAPI EfiOpenFileByDevicePath(IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath, OUT EFI_FILE_PROTOCOL **File, IN UINT64 OpenMode, IN UINT64 Attributes)
EFI_STATUS EFIAPI ShellPrintHelp(IN CONST CHAR16 *CommandToGetHelpOn, IN CONST CHAR16 *SectionToGetHelpOn, IN BOOLEAN PrintCommandText)
EFI_STATUS EFIAPI ShellGetFileSize(IN SHELL_FILE_HANDLE FileHandle, OUT UINT64 *Size)
CONST CHAR16 *EFIAPI ShellGetCurrentDir(IN CHAR16 *CONST DeviceName OPTIONAL)
BOOLEAN EFIAPI ShellIsHexaDecimalDigitCharacter(IN CHAR16 Char)
CHAR16 *EFIAPI ShellFileHandleReturnLine(IN SHELL_FILE_HANDLE Handle, IN OUT BOOLEAN *Ascii)
BOOLEAN InternalShellIsHexOrDecimalNumber(IN CONST CHAR16 *String, IN CONST BOOLEAN ForceHex, IN CONST BOOLEAN StopAtSpace, IN CONST BOOLEAN TimeNumbers)
CHAR16 *EFIAPI FullyQualifyPath(IN CONST CHAR16 *Path)
CONST CHAR16 *EFIAPI ShellCommandLineGetValue(IN CONST LIST_ENTRY *CheckPackage, IN CHAR16 *KeyString)
EFI_STATUS EFIAPI ShellOpenFileByDevicePath(IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath, OUT SHELL_FILE_HANDLE *FileHandle, IN UINT64 OpenMode, IN UINT64 Attributes)
EFI_FILE_INFO *EFIAPI ShellGetFileInfo(IN SHELL_FILE_HANDLE FileHandle)
EFI_STATUS EFIAPI ShellSetEnvironmentVariable(IN CONST CHAR16 *EnvKey, IN CONST CHAR16 *EnvVal, IN BOOLEAN Volatile)
EFI_STATUS EFIAPI ShellSetFileInfo(IN SHELL_FILE_HANDLE FileHandle, IN EFI_FILE_INFO *FileInfo)
EFI_STATUS EFIAPI ShellDeleteFile(IN SHELL_FILE_HANDLE *FileHandle)
EFI_STATUS ShellLibConstructorWorker(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
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)
UINTN EFIAPI ShellStrToUintn(IN CONST CHAR16 *String)
BOOLEAN EFIAPI ShellGetExecutionBreakFlag(VOID)
VOID EFIAPI ShellSetPageBreakMode(IN BOOLEAN CurrentState)
EFI_STATUS EFIAPI ShellDeleteFileByName(IN CONST CHAR16 *FileName)
EFI_STATUS InternalShellPrintWorker(IN INT32 Col OPTIONAL, IN INT32 Row OPTIONAL, IN CONST CHAR16 *Format, IN VA_LIST Marker)
EFI_STATUS EFIAPI ShellPromptForResponseHii(IN SHELL_PROMPT_REQUEST_TYPE Type, IN CONST EFI_STRING_ID HiiFormatStringId, IN CONST EFI_HII_HANDLE HiiFormatHandle, IN OUT VOID **Response)
EFI_STATUS EFIAPI ShellCreateDirectory(IN CONST CHAR16 *DirectoryName, OUT SHELL_FILE_HANDLE *FileHandle)
EFI_STATUS EFIAPI ShellCloseFileMetaArg(IN OUT EFI_SHELL_FILE_INFO **ListHead)
EFI_STATUS EFIAPI ShellExecute(IN EFI_HANDLE *ParentHandle, IN CHAR16 *CommandLine OPTIONAL, IN BOOLEAN Output OPTIONAL, IN CHAR16 **EnvironmentVariables OPTIONAL, OUT EFI_STATUS *Status OPTIONAL)
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,...)
BOOLEAN EFIAPI ShellCommandLineGetFlag(IN CONST LIST_ENTRY *CONST CheckPackage, IN CONST CHAR16 *CONST KeyString)
LIST_ENTRY * InternalShellConvertFileListType(IN LIST_ENTRY *FileList, IN OUT LIST_ENTRY *ListHead)
BOOLEAN EFIAPI ShellIsHexOrDecimalNumber(IN CONST CHAR16 *String, IN CONST BOOLEAN ForceHex, IN CONST BOOLEAN StopAtSpace)
EFI_STATUS InternalCommandLineParse(IN CONST SHELL_PARAM_ITEM *CheckList, OUT LIST_ENTRY **CheckPackage, OUT CHAR16 **ProblemParam OPTIONAL, IN BOOLEAN AutoPageBreak, IN CONST CHAR16 **Argv, IN UINTN Argc, IN BOOLEAN AlwaysAllowNumbers)
EFI_STATUS EFIAPI ShellOpenFileByName(IN CONST CHAR16 *FileName, OUT SHELL_FILE_HANDLE *FileHandle, IN UINT64 OpenMode, IN UINT64 Attributes)
BOOLEAN EFIAPI ShellIsDecimalDigitCharacter(IN CHAR16 Char)
SHELL_PARAM_ITEM SfoParamList[]
Helper structure for -sfo only (besides -? and -b)
BOOLEAN InternalIsFlag(IN CONST CHAR16 *Name, IN CONST BOOLEAN AlwaysAllowNumbers, IN CONST BOOLEAN TimeNumbers)
CHAR16 *EFIAPI StrnCatGrow(IN OUT CHAR16 **Destination, IN OUT UINTN *CurrentSize, IN CONST CHAR16 *Source, IN UINTN Count)
EFI_STATUS EFIAPI ShellFindFirstFile(IN SHELL_FILE_HANDLE DirHandle, OUT EFI_FILE_INFO **Buffer)
CHAR16 *EFIAPI ShellFindFilePathEx(IN CONST CHAR16 *FileName, IN CONST CHAR16 *FileExtension)
EFI_STATUS EFIAPI ShellPromptForResponse(IN SHELL_PROMPT_REQUEST_TYPE Type, IN CHAR16 *Prompt OPTIONAL, IN OUT VOID **Response OPTIONAL)
EFI_STATUS EFIAPI ShellCommandLineCheckDuplicate(IN CONST LIST_ENTRY *CheckPackage, OUT CHAR16 **Param)
UINTN InternalShellHexCharToUintn(IN CHAR16 Char)
EFI_STATUS InternalShellStripQuotes(IN CONST CHAR16 *OriginalString, OUT CHAR16 **CleanString)
EFI_STATUS EFIAPI ShellFindNextFile(IN SHELL_FILE_HANDLE DirHandle, OUT EFI_FILE_INFO *Buffer, OUT BOOLEAN *NoFile)
CONST CHAR16 *EFIAPI ShellGetEnvironmentVariable(IN CONST CHAR16 *EnvKey)
EFI_STATUS EFIAPI ShellFileExists(IN CONST CHAR16 *Name)
EFI_STATUS EFIAPI ShellFileHandleReadLine(IN SHELL_FILE_HANDLE Handle, IN OUT CHAR16 *Buffer, IN OUT UINTN *Size, IN BOOLEAN Truncate, IN OUT BOOLEAN *Ascii)
EFI_STATUS EFIAPI ShellOpenFileMetaArg(IN CHAR16 *Arg, IN UINT64 OpenMode, IN OUT EFI_SHELL_FILE_INFO **ListHead)
EFI_STATUS EFIAPI ShellCommandLineParseEx(IN CONST SHELL_PARAM_ITEM *CheckList, OUT LIST_ENTRY **CheckPackage, OUT CHAR16 **ProblemParam OPTIONAL, IN BOOLEAN AutoPageBreak, IN BOOLEAN AlwaysAllowNumbers)
EFI_STATUS InternalShellStrHexToUint64(IN CONST CHAR16 *String, OUT UINT64 *Value, IN CONST BOOLEAN StopAtSpace)
VOID EFIAPI ShellCommandLineFreeVarList(IN LIST_ENTRY *CheckPackage)
EFI_STATUS EFIAPI ShellInitialize(VOID)
UINTN EFIAPI ShellHexStrToUintn(IN CONST CHAR16 *String)
EFI_STATUS EFIAPI ShellIsFile(IN CONST CHAR16 *Name)
EFI_STATUS EFIAPI ShellIsDirectory(IN CONST CHAR16 *DirName)
EFI_STATUS EFIAPI ShellReadFile(IN SHELL_FILE_HANDLE FileHandle, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
EFI_STATUS EFIAPI ShellGetFilePosition(IN SHELL_FILE_HANDLE FileHandle, OUT UINT64 *Position)
EFI_STATUS EFIAPI ShellSetFilePosition(IN SHELL_FILE_HANDLE FileHandle, IN UINT64 Position)
EFI_STATUS InternalPrintTo(IN CONST CHAR16 *String)
BOOLEAN InternalIsOnCheckList(IN CONST CHAR16 *Name, IN CONST SHELL_PARAM_ITEM *CheckList, OUT SHELL_PARAM_TYPE *Type)
CHAR16 *EFIAPI ShellFindFilePath(IN CONST CHAR16 *FileName)
EFI_STATUS EFIAPI ShellLibConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
EFI_STATUS EFIAPI ShellPrintEx(IN INT32 Col OPTIONAL, IN INT32 Row OPTIONAL, IN CONST CHAR16 *Format,...)
EFI_STATUS EFIAPI ShellIsFileInPath(IN CONST CHAR16 *Name)
EFI_STATUS EFIAPI ShellLibDestructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
CONST CHAR16 *EFIAPI ShellCommandLineGetRawValue(IN CONST LIST_ENTRY *CONST CheckPackage, IN UINTN Position)
UINTN EFIAPI ShellCommandLineGetCount(IN CONST LIST_ENTRY *CheckPackage)
EFI_STATUS EFIAPI ShellConvertStringToUint64(IN CONST CHAR16 *String, OUT UINT64 *Value, IN CONST BOOLEAN ForceHex, IN CONST BOOLEAN StopAtSpace)
SHELL_PARAM_ITEM EmptyParamList[]
Helper structure for no parameters (besides -? and -b)
EFI_STATUS ShellFindSE2(IN EFI_HANDLE ImageHandle)
EFI_STATUS EFIAPI ShellFlushFile(IN SHELL_FILE_HANDLE FileHandle)
EFI_STATUS InternalShellStrDecimalToUint64(IN CONST CHAR16 *String, OUT UINT64 *Value, IN CONST BOOLEAN StopAtSpace)
EFI_STATUS EFIAPI ShellWriteFile(IN SHELL_FILE_HANDLE FileHandle, IN OUT UINTN *BufferSize, IN VOID *Buffer)
EFI_STATUS EFIAPI ShellCloseFile(IN SHELL_FILE_HANDLE *FileHandle)
EFI_SIMPLE_TEXT_OUTPUT_MODE * Mode
EFI_SHELL_ENVIRONMENT2 protocol structure.
EFI_STATUS Status
Status of opening the file. Valid only if Handle != NULL.
CHAR16 * FileName
name of this file.
EFI_FILE_INFO * Info
Pointer to the FileInfo struct for this file or NULL.
SHELL_FILE_HANDLE Handle
Handle for interacting with the opened file or NULL if closed.
CHAR16 * FullName
Fully qualified filename.
LIST_ENTRY Link
Linked list members.
EFI_SIMPLE_TEXT_INPUT_PROTOCOL * ConIn
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * ConOut
EFI_STATUS Status
File's status.
CHAR16 * FullName
Path and file name for this file.
EFI_FILE_HANDLE Handle
Handle to this file.
EFI_FILE_INFO * Info
Pointer to file info for this file.
CHAR16 * FileName
File name for this file.