@retval FALSE The move is within a file system.\r
**/\r
BOOLEAN\r
-EFIAPI\r
IsBetweenFileSystem(\r
IN CONST CHAR16 *FullName,\r
IN CONST CHAR16 *Cwd,\r
@retval FALSE The move is not\r
**/\r
BOOLEAN\r
-EFIAPI\r
IsValidMove(\r
IN CONST CHAR16 *SourcePath,\r
IN CONST CHAR16 *Cwd,\r
@retval SHELL_SUCCESS The operation was sucessful.\r
**/\r
SHELL_STATUS\r
-EFIAPI\r
GetDestinationLocation(\r
IN CONST CHAR16 *DestParameter,\r
IN OUT CHAR16 **DestPathPointer,\r
@retval SHELL_SUCCESS The source file was moved to the destination.\r
**/\r
EFI_STATUS\r
-EFIAPI\r
MoveBetweenFileSystems(\r
IN EFI_SHELL_FILE_INFO *Node,\r
IN CONST CHAR16 *DestPath,\r
@retval SHELL_OUT_OF_RESOURCES a memory allocation failed\r
**/\r
EFI_STATUS\r
-EFIAPI\r
CreateFullDestPath(\r
IN CONST CHAR16 **DestPath,\r
OUT CHAR16 **FullDestPath, \r
@retval SHELL_OUT_OF_RESOURCES A memory allocation failed.\r
**/\r
EFI_STATUS\r
-EFIAPI\r
MoveWithinFileSystems(\r
IN EFI_SHELL_FILE_INFO *Node,\r
IN CHAR16 *DestPath,\r
@retval SHELL_OUT_OF_RESOURCES a memory allocation failed\r
**/\r
SHELL_STATUS\r
-EFIAPI\r
ValidateAndMoveFiles(\r
IN EFI_SHELL_FILE_INFO *FileList,\r
OUT VOID **Resp,\r
//\r
CwdSize = StrSize(ShellGetCurrentDir(NULL)) + sizeof(CHAR16);\r
Cwd = AllocateZeroPool(CwdSize);\r
- ASSERT (Cwd != NULL);\r
- StrCpyS(Cwd, CwdSize/sizeof(CHAR16), ShellGetCurrentDir(NULL));\r
- StrCatS(Cwd, CwdSize/sizeof(CHAR16), L"\\");\r
- ShellStatus = ValidateAndMoveFiles(FileList, &Response, Cwd);\r
- FreePool(Cwd);\r
+ if (Cwd == NULL) {\r
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellLevel2HiiHandle, L"mv");\r
+ ShellStatus = SHELL_OUT_OF_RESOURCES;\r
+ } else {\r
+ StrCpyS (Cwd, CwdSize / sizeof (CHAR16), ShellGetCurrentDir (NULL));\r
+ StrCatS (Cwd, CwdSize / sizeof (CHAR16), L"\\");\r
+ ShellStatus = ValidateAndMoveFiles (FileList, &Response, Cwd);\r
+ FreePool (Cwd);\r
+ }\r
}\r
}\r
\r