and will process '?' and '*' as such. the list must be freed with a call to \r
ShellCloseFileMetaArg().\r
\r
- If you are NOT appending to an existing list *ListHead must be NULL.\r
+ If you are NOT appending to an existing list *ListHead must be NULL. If \r
+ *ListHead is NULL then it must be callee freed.\r
\r
@param Arg pointer to path string\r
@param OpenMode mode to open files with\r
// Check for UEFI Shell 2.0 protocols\r
//\r
if (mEfiShellProtocol != NULL) {\r
+ if (*ListHead == NULL) {\r
+ *ListHead = (EFI_SHELL_FILE_INFO*)AllocateZeroPool(sizeof(EFI_SHELL_FILE_INFO));\r
+ if (*ListHead == NULL) {\r
+ return (EFI_OUT_OF_RESOURCES);\r
+ }\r
+ InitializeListHead(&((*ListHead)->Link));\r
+ } \r
return (mEfiShellProtocol->OpenFileList(Arg, \r
OpenMode, \r
ListHead));\r
FreePool(PostReplaceFormat2);\r
\r
return (Return);\r
-}
\ No newline at end of file
+}\r