+ //\r
+ // Check whether the current file system still exists. If not exist, we need update "cwd" and gShellCurMapping.\r
+ //\r
+ CurDir = EfiShellGetCurDir (NULL);\r
+ if (CurDir != NULL) {\r
+ if (EFI_ERROR(ShellFileExists (CurDir))) {\r
+ //\r
+ // EfiShellSetCurDir() cannot set current directory to NULL.\r
+ // EfiShellSetEnv() is not allowed to set the "cwd" variable.\r
+ // Only InternalEfiShellSetEnv () is allowed setting the "cwd" variable.\r
+ //\r
+ InternalEfiShellSetEnv (L"cwd", NULL, TRUE);\r
+ gShellCurMapping = NULL;\r
+ }\r
+ }\r
+\r