30 IN OUT CHAR16 **FullPath,
42 if ((FullPath ==
NULL) || (*FullPath ==
NULL)) {
46 Splitter =
StrStr (*FullPath, L
":");
47 ASSERT (Splitter != *FullPath);
49 if ((Splitter !=
NULL) && (*(Splitter + 1) != L
'\\') && (*(Splitter + 1) != L
'/')) {
52 if (TempBuffer ==
NULL) {
53 return EFI_OUT_OF_RESOURCES;
56 StrCpyS (TempBuffer, TotalSize /
sizeof (CHAR16), Cwd);
57 StrCatS (TempBuffer, TotalSize /
sizeof (CHAR16), L
"\\");
58 StrCatS (TempBuffer, TotalSize /
sizeof (CHAR16), Splitter + 1);
61 *FullPath = TempBuffer;
88 ASSERT (FullPath !=
NULL);
90 Splitter1 =
StrStr (FullPath, L
":");
91 if (Splitter1 ==
NULL) {
95 Splitter2 =
StrStr (Cwd, L
":");
100 if (
StrniCmp (FullPath, Cwd, ((
UINTN)Splitter1 - (
UINTN)FullPath) /
sizeof (CHAR16)) == 0) {
129 ASSERT (FullPath !=
NULL);
131 Splitter =
StrStr (FullPath, L
":");
133 if (Splitter ==
NULL) {
137 return EFI_OUT_OF_RESOURCES;
140 if (*(Splitter + 1) == CHAR_NULL) {
143 if (*Drive ==
NULL) {
144 return EFI_OUT_OF_RESOURCES;
147 *Drive =
AllocateCopyPool ((Splitter - FullPath + 2) *
sizeof (CHAR16), FullPath);
148 if (*Drive ==
NULL) {
149 return EFI_OUT_OF_RESOURCES;
152 (*Drive)[Splitter - FullPath + 1] = CHAR_NULL;
157 return EFI_OUT_OF_RESOURCES;
183 CHAR16 *ProblemParam;
185 CONST CHAR16 *Param1;
214 if (EFI_ERROR (Status)) {
215 if ((Status == EFI_VOLUME_CORRUPTED) && (ProblemParam !=
NULL)) {
245 if (Param1 ==
NULL) {
252 for (Walker = Param1Copy; Walker !=
NULL && *Walker != CHAR_NULL; Walker++) {
253 if (*Walker == L
'\"') {
254 CopyMem (Walker, Walker + 1,
StrSize (Walker) -
sizeof (Walker[0]));
265 Status = EFI_NOT_FOUND;
268 if (!EFI_ERROR (Status) && (Param1Copy !=
NULL)) {
269 Splitter =
StrStr (Cwd, L
":");
270 if (Param1Copy[0] == L
'\\') {
274 TotalSize = ((Splitter - Cwd + 1) *
sizeof (CHAR16)) +
StrSize (Param1Copy);
276 if (TempBuffer ==
NULL) {
277 Status = EFI_OUT_OF_RESOURCES;
279 StrnCpyS (TempBuffer, TotalSize /
sizeof (CHAR16), Cwd, (Splitter - Cwd + 1));
280 StrCatS (TempBuffer, TotalSize /
sizeof (CHAR16), Param1Copy);
283 Param1Copy = TempBuffer;
290 if (TempBuffer ==
NULL) {
291 Status = EFI_OUT_OF_RESOURCES;
293 StrCpyS (TempBuffer, TotalSize /
sizeof (CHAR16), Cwd);
294 StrCatS (TempBuffer, TotalSize /
sizeof (CHAR16), L
"\\");
295 StrCatS (TempBuffer, TotalSize /
sizeof (CHAR16), Param1Copy);
298 Param1Copy = TempBuffer;
305 if (!EFI_ERROR (Status)) {
307 if (Param1Copy ==
NULL) {
308 Status = EFI_NOT_FOUND;
315 if (!EFI_ERROR (Status) && (Drive !=
NULL) && (Path !=
NULL)) {
320 Status = gEfiShellProtocol->SetCurDir (Drive, Path + 1);
321 if (EFI_ERROR (Status)) {
349 return (ShellStatus);
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
RETURN_STATUS EFIAPI StrCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
RETURN_STATUS EFIAPI StrCatS(IN OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source)
CHAR16 *EFIAPI PathCleanUpDirectories(IN CHAR16 *Path)
RETURN_STATUS EFIAPI StrnCpyS(OUT CHAR16 *Destination, IN UINTN DestMax, IN CONST CHAR16 *Source, IN UINTN Length)
CHAR16 *EFIAPI StrStr(IN CONST CHAR16 *String, IN CONST CHAR16 *SearchString)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
EFI_STATUS ExtractDriveAndPath(IN CONST CHAR16 *FullPath, OUT CHAR16 **Drive, OUT CHAR16 **Path)
BOOLEAN IsCurrentFileSystem(IN CONST CHAR16 *FullPath, IN CONST CHAR16 *Cwd)
EFI_STATUS ReplaceDriveWithCwd(IN OUT CHAR16 **FullPath, IN CONST CHAR16 *Cwd)
SHELL_STATUS EFIAPI ShellCommandRunCd(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
#define ASSERT_EFI_ERROR(StatusParameter)
@ SHELL_INVALID_PARAMETER
EFI_STATUS EFIAPI CommandInit(VOID)
CONST CHAR16 *EFIAPI ShellGetCurrentDir(IN CHAR16 *CONST DeviceName OPTIONAL)
#define ShellCommandLineParse(CheckList, CheckPackage, ProblemParam, AutoPageBreak)
Make it easy to upgrade from older versions of the shell library.
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)
VOID EFIAPI ShellCommandLineFreeVarList(IN LIST_ENTRY *CheckPackage)
EFI_STATUS EFIAPI ShellInitialize(VOID)
EFI_STATUS EFIAPI ShellIsDirectory(IN CONST CHAR16 *DirName)
CONST CHAR16 *EFIAPI ShellCommandLineGetRawValue(IN CONST LIST_ENTRY *CONST CheckPackage, IN UINTN Position)
SHELL_PARAM_ITEM EmptyParamList[]
Helper structure for no parameters (besides -? and -b)
CHAR16 *EFIAPI CatSPrint(IN CHAR16 *String OPTIONAL, IN CONST CHAR16 *FormatString,...)
INTN StrniCmp(IN CONST CHAR16 *Source, IN CONST CHAR16 *Target, IN CONST UINTN Count)