From 52c12bddc0143e13ebba055e1d0b398b318e648f Mon Sep 17 00:00:00 2001 From: Joursoir Date: Mon, 29 Nov 2021 00:58:11 +0300 Subject: dir: add support for marked files --- Library/UefiShellUfmCommandLib/dir.c | 7 +++++++ Library/UefiShellUfmCommandLib/dir.h | 1 + 2 files changed, 8 insertions(+) diff --git a/Library/UefiShellUfmCommandLib/dir.c b/Library/UefiShellUfmCommandLib/dir.c index 6049d18..9160f9f 100644 --- a/Library/UefiShellUfmCommandLib/dir.c +++ b/Library/UefiShellUfmCommandLib/dir.c @@ -52,6 +52,11 @@ struct dir_list *dirl_alloc(CHAR16 *search_path, CONST UINT64 attr) dl->list_head = list_head; dl->len = length; + dl->marked = AllocateZeroPool(length * sizeof(BOOLEAN)); + if(!dl->marked) { + dirl_release(dl); + return NULL; + } return dl; } @@ -59,6 +64,8 @@ VOID dirl_release(struct dir_list *dl) { if(dl->list_head) ShellCloseFileMetaArg(&dl->list_head); + if(dl->marked) + FreePool(dl->marked); FreePool(dl); } diff --git a/Library/UefiShellUfmCommandLib/dir.h b/Library/UefiShellUfmCommandLib/dir.h index 912b00f..34b257d 100644 --- a/Library/UefiShellUfmCommandLib/dir.h +++ b/Library/UefiShellUfmCommandLib/dir.h @@ -5,6 +5,7 @@ struct dir_list { EFI_SHELL_FILE_INFO *list_head; + BOOLEAN *marked; // files are marked on a panel int len; // number of elements in list }; -- cgit v1.2.3-18-g5258