ShellPkg: Allow opening of root drive nodes
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jaben Carsey <Jaben.carsey@intel.com> Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15424 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -1898,7 +1898,7 @@ CreateAndPopulateShellFileInfo(
|
|||||||
TempString = StrnCatGrow(&TempString, &Size, BasePath, 0);
|
TempString = StrnCatGrow(&TempString, &Size, BasePath, 0);
|
||||||
if (TempString == NULL) {
|
if (TempString == NULL) {
|
||||||
FreePool((VOID*)ShellFileListItem->FileName);
|
FreePool((VOID*)ShellFileListItem->FileName);
|
||||||
FreePool(ShellFileListItem->Info);
|
SHELL_FREE_NON_NULL(ShellFileListItem->Info);
|
||||||
FreePool(ShellFileListItem);
|
FreePool(ShellFileListItem);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
@ -2105,6 +2105,7 @@ ShellSearchHandle(
|
|||||||
EFI_SHELL_FILE_INFO *ShellInfo;
|
EFI_SHELL_FILE_INFO *ShellInfo;
|
||||||
EFI_SHELL_FILE_INFO *ShellInfoNode;
|
EFI_SHELL_FILE_INFO *ShellInfoNode;
|
||||||
EFI_SHELL_FILE_INFO *NewShellNode;
|
EFI_SHELL_FILE_INFO *NewShellNode;
|
||||||
|
EFI_FILE_INFO *FileInfo;
|
||||||
BOOLEAN Directory;
|
BOOLEAN Directory;
|
||||||
CHAR16 *NewFullName;
|
CHAR16 *NewFullName;
|
||||||
UINTN Size;
|
UINTN Size;
|
||||||
@ -2134,12 +2135,27 @@ ShellSearchHandle(
|
|||||||
&&NextFilePatternStart[0] == CHAR_NULL
|
&&NextFilePatternStart[0] == CHAR_NULL
|
||||||
){
|
){
|
||||||
//
|
//
|
||||||
// Add the current parameter FileHandle to the list, then end...
|
// we want the parent or root node (if no parent)
|
||||||
//
|
//
|
||||||
if (ParentNode == NULL) {
|
if (ParentNode == NULL) {
|
||||||
Status = EFI_INVALID_PARAMETER;
|
//
|
||||||
|
// We want the root node. create the node.
|
||||||
|
//
|
||||||
|
FileInfo = FileHandleGetInfo(FileHandle);
|
||||||
|
NewShellNode = CreateAndPopulateShellFileInfo(
|
||||||
|
L":",
|
||||||
|
EFI_SUCCESS,
|
||||||
|
L"\\",
|
||||||
|
FileHandle,
|
||||||
|
FileInfo
|
||||||
|
);
|
||||||
|
SHELL_FREE_NON_NULL(FileInfo);
|
||||||
} else {
|
} else {
|
||||||
|
//
|
||||||
|
// Add the current parameter FileHandle to the list, then end...
|
||||||
|
//
|
||||||
NewShellNode = InternalDuplicateShellFileInfo((EFI_SHELL_FILE_INFO*)ParentNode, TRUE);
|
NewShellNode = InternalDuplicateShellFileInfo((EFI_SHELL_FILE_INFO*)ParentNode, TRUE);
|
||||||
|
}
|
||||||
if (NewShellNode == NULL) {
|
if (NewShellNode == NULL) {
|
||||||
Status = EFI_OUT_OF_RESOURCES;
|
Status = EFI_OUT_OF_RESOURCES;
|
||||||
} else {
|
} else {
|
||||||
@ -2156,7 +2172,6 @@ ShellSearchHandle(
|
|||||||
|
|
||||||
Status = EFI_SUCCESS;
|
Status = EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Status = EfiShellFindFilesInDir(FileHandle, &ShellInfo);
|
Status = EfiShellFindFilesInDir(FileHandle, &ShellInfo);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user