aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoursoir <chat@joursoir.net>2021-11-29 00:58:11 +0300
committerJoursoir <chat@joursoir.net>2021-11-29 00:58:11 +0300
commit52c12bddc0143e13ebba055e1d0b398b318e648f (patch)
treeb4ea77409a293d5c3512af96fab5223b7ceeb27f
parent1930323f992bad6f54506a1ba2d698bd97dc5b14 (diff)
downloadufm-52c12bddc0143e13ebba055e1d0b398b318e648f.tar.gz
ufm-52c12bddc0143e13ebba055e1d0b398b318e648f.tar.bz2
ufm-52c12bddc0143e13ebba055e1d0b398b318e648f.zip
dir: add support for marked files
-rw-r--r--Library/UefiShellUfmCommandLib/dir.c7
-rw-r--r--Library/UefiShellUfmCommandLib/dir.h1
2 files changed, 8 insertions, 0 deletions
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
};