From 089a342b293c64436b491daa4fde4f971d92c64b Mon Sep 17 00:00:00 2001 From: Joursoir Date: Wed, 17 Nov 2021 19:30:11 +0300 Subject: fs: make scanfs() --- Library/UefiShellUfmCommandLib/fs.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'Library/UefiShellUfmCommandLib/fs.c') diff --git a/Library/UefiShellUfmCommandLib/fs.c b/Library/UefiShellUfmCommandLib/fs.c index fe2d590..a675688 100644 --- a/Library/UefiShellUfmCommandLib/fs.c +++ b/Library/UefiShellUfmCommandLib/fs.c @@ -87,3 +87,25 @@ VOID fsa_release(struct fs_array *fsa) } FreePool(fsa); } + +struct fs_array *scanfs(VOID) +{ + UINTN handle_count; + EFI_HANDLE *handle_buffer; + struct fs_array *fsa; + EFI_STATUS status; + + status = gBS->LocateHandleBuffer( + ByProtocol, + &gEfiSimpleFileSystemProtocolGuid, + NULL, + &handle_count, + &handle_buffer + ); + if(EFI_ERROR(status) || handle_count <= 0) + return NULL; + + fsa = fsa_alloc(handle_buffer, handle_count); + FreePool(handle_buffer); + return fsa; +} \ No newline at end of file -- cgit v1.2.3-18-g5258