name. If the DeviceName is not NULL, it returns the current directory name\r
on specified drive.\r
\r
+ Note that the current directory string should exclude the tailing backslash character.\r
+\r
@param DeviceName the name of the drive to get directory on\r
\r
@retval NULL the directory does not exist\r
\r
Path = ShellGetEnvironmentVariable(L"cwd");\r
if (Path != NULL) {\r
- Size = StrSize(Path);\r
+ Size = StrSize(Path) + sizeof(CHAR16);\r
Size += StrSize(FileName);\r
TestPath = AllocateZeroPool(Size);\r
if (TestPath == NULL) {\r
return (NULL);\r
}\r
StrCpyS(TestPath, Size/sizeof(CHAR16), Path);\r
+ StrCatS(TestPath, Size/sizeof(CHAR16), L"\\");\r
StrCatS(TestPath, Size/sizeof(CHAR16), FileName);\r
Status = ShellOpenFileByName(TestPath, &Handle, EFI_FILE_MODE_READ, 0);\r
if (!EFI_ERROR(Status)){\r