+\r
+/**\r
+ Print at a specific location on the screen.\r
+\r
+ This function will move the cursor to a given screen location and print the specified string\r
+ \r
+ If -1 is specified for either the Row or Col the current screen location for BOTH \r
+ will be used.\r
+\r
+ if either Row or Col is out of range for the current console, then ASSERT\r
+ if Format is NULL, then ASSERT\r
+\r
+ In addition to the standard %-based flags as supported by UefiLib Print() this supports \r
+ the following additional flags:\r
+ %N - Set output attribute to normal\r
+ %H - Set output attribute to highlight\r
+ %E - Set output attribute to error\r
+ %B - Set output attribute to blue color\r
+ %V - Set output attribute to green color\r
+\r
+ Note: The background color is controlled by the shell command cls.\r
+\r
+ @param[in] Row the row to print at\r
+ @param[in] Col the column to print at\r
+ @param[in] Format the format string\r
+\r
+ @return the number of characters printed to the screen\r
+**/\r
+\r
+UINTN\r
+EFIAPI\r
+ShellPrintEx(\r
+ IN INT32 Col OPTIONAL,\r
+ IN INT32 Row OPTIONAL,\r
+ IN CONST CHAR16 *Format,\r
+ ...\r
+ ) \r
+{\r
+ VA_LIST Marker;\r
+ VA_START (Marker, Format);\r
+ return (InternalShellPrintWorker(Col, Row, Format, Marker));\r
+}\r
+\r
+/**\r
+ Print at a specific location on the screen.\r
+\r
+ This function will move the cursor to a given screen location, print the specified string, \r
+ and return the cursor to the original locaiton. \r
+ \r
+ If -1 is specified for either the Row or Col the current screen location for BOTH \r
+ will be used and the cursor's position will not be moved back to an original location.\r
+\r
+ if either Row or Col is out of range for the current console, then ASSERT\r
+ if Format is NULL, then ASSERT\r
+\r
+ In addition to the standard %-based flags as supported by UefiLib Print() this supports \r
+ the following additional flags:\r
+ %N - Set output attribute to normal\r
+ %H - Set output attribute to highlight\r
+ %E - Set output attribute to error\r
+ %B - Set output attribute to blue color\r
+ %V - Set output attribute to green color\r
+\r
+ Note: The background color is controlled by the shell command cls.\r
+\r
+ @param[in] Row the row to print at\r
+ @param[in] Col the column to print at\r
+ @param[in] HiiFormatStringId the format string Id for getting from Hii\r
+ @param[in] HiiFormatHandle the format string Handle for getting from Hii\r
+\r
+ @return the number of characters printed to the screen\r
+**/\r
+UINTN\r
+EFIAPI\r
+ShellPrintHiiEx(\r
+ IN INT32 Col OPTIONAL,\r
+ IN INT32 Row OPTIONAL,\r
+ IN CONST EFI_STRING_ID HiiFormatStringId,\r
+ IN CONST EFI_HANDLE HiiFormatHandle,\r
+ ...\r
+ )\r
+{\r
+ VA_LIST Marker;\r
+ CHAR16 *HiiFormatString;\r
+ UINTN RetVal;\r
+\r
+ VA_START (Marker, HiiFormatHandle);\r
+ HiiFormatString = HiiGetString(HiiFormatHandle, HiiFormatStringId, NULL);\r
+ ASSERT(HiiFormatString != NULL);\r
+\r
+ RetVal = InternalShellPrintWorker(Col, Row, HiiFormatString, Marker);\r
+\r
+ FreePool(HiiFormatString);\r
+\r
+ return (RetVal);\r
+}\r
+\r
+/**\r
+ Function to determine if a given filename represents a file or a directory.\r
+\r
+ @param[in] DirName Path to directory to test.\r
+\r
+ @retval EFI_SUCCESS The Path represents a directory\r
+ @retval EFI_NOT_FOUND The Path does not represent a directory\r
+ @return other The path failed to open\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+ShellIsDirectory(\r
+ IN CONST CHAR16 *DirName\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ EFI_FILE_HANDLE Handle;\r
+\r
+ Handle = NULL;\r
+\r
+ Status = ShellOpenFileByName(DirName, &Handle, EFI_FILE_MODE_READ, 0);\r
+ if (EFI_ERROR(Status)) {\r
+ return (Status);\r
+ }\r
+\r
+ if (FileHandleIsDirectory(Handle) == EFI_SUCCESS) {\r
+ ShellCloseFile(&Handle);\r
+ return (EFI_SUCCESS);\r
+ }\r
+ ShellCloseFile(&Handle);\r
+ return (EFI_NOT_FOUND);\r
+}\r
+\r