+EFI_STATUS \r
+EFIAPI\r
+IsValidSplit(\r
+ IN CONST CHAR16 *CmdLine\r
+ )\r
+{\r
+ CHAR16 *Temp;\r
+ CHAR16 *FirstParameter;\r
+ CHAR16 *TempWalker;\r
+ EFI_STATUS Status;\r
+\r
+ Temp = NULL;\r
+\r
+ Temp = StrnCatGrow(&Temp, NULL, CmdLine, 0);\r
+ if (Temp == NULL) {\r
+ return (EFI_OUT_OF_RESOURCES);\r
+ }\r
+\r
+ FirstParameter = StrStr(Temp, L"|");\r
+ if (FirstParameter != NULL) {\r
+ *FirstParameter = CHAR_NULL;\r
+ }\r
+\r
+ FirstParameter = NULL;\r
+\r
+ //\r
+ // Process the command line\r
+ //\r
+ Status = ProcessCommandLineToFinal(&Temp);\r
+\r
+ if (!EFI_ERROR(Status)) {\r
+ FirstParameter = AllocateZeroPool(StrSize(CmdLine));\r
+ if (FirstParameter == NULL) {\r
+ SHELL_FREE_NON_NULL(Temp);\r
+ return (EFI_OUT_OF_RESOURCES);\r
+ }\r
+ TempWalker = (CHAR16*)Temp;\r
+ GetNextParameter(&TempWalker, &FirstParameter);\r
+\r
+ if (GetOperationType(FirstParameter) == UNKNOWN_INVALID) {\r
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_NOT_FOUND), ShellInfoObject.HiiHandle, FirstParameter);\r
+ SetLastError(SHELL_NOT_FOUND);\r
+ Status = EFI_NOT_FOUND;\r
+ }\r
+ }\r
+\r
+ SHELL_FREE_NON_NULL(Temp);\r
+ SHELL_FREE_NON_NULL(FirstParameter);\r
+ return Status;\r
+}\r
+\r
+/**\r
+ Determine if a command line contains with a split contains only valid commands\r
+\r
+ @param[in] CmdLine The command line to parse.\r
+\r
+ @retval EFI_SUCCESS CmdLine has only valid commands, application, or has no split.\r
+ @retval EFI_ABORTED CmdLine has at least one invalid command or application.\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+VerifySplit(\r
+ IN CONST CHAR16 *CmdLine\r
+ )\r
+{\r
+ CONST CHAR16 *TempSpot;\r
+ EFI_STATUS Status;\r
+\r
+ //\r
+ // Verify up to the pipe or end character\r
+ //\r
+ Status = IsValidSplit(CmdLine);\r
+ if (EFI_ERROR(Status)) {\r
+ return (Status);\r
+ }\r
+\r
+ //\r
+ // If this was the only item, then get out\r
+ //\r
+ if (!ContainsSplit(CmdLine)) {\r
+ return (EFI_SUCCESS);\r
+ }\r
+\r
+ //\r
+ // recurse to verify the next item\r
+ //\r
+ TempSpot = FindSplit(CmdLine)+1;\r
+ return (VerifySplit(TempSpot));\r
+}\r
+\r