From 4566f95fd9f70530866457beb545a794cc80e1d0 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 23 Sep 2019 18:33:04 +0200 Subject: make the rescue disk boot machine directly from disk if "VeraCrypt" folder is missing. This make it easy to create a bootable disk for VeraCrypt from the rescue disk by just removing or renaming its "VeraCrypt" folder. --- Library/CommonLib/EfiFile.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Library') diff --git a/Library/CommonLib/EfiFile.c b/Library/CommonLib/EfiFile.c index 8a9d6d7..4ea164e 100644 --- a/Library/CommonLib/EfiFile.c +++ b/Library/CommonLib/EfiFile.c @@ -57,6 +57,22 @@ DirectoryCreate( return res; } +EFI_STATUS +DirectoryExists( + IN EFI_FILE* root, + IN CHAR16* name + ) +{ + EFI_FILE* file; + EFI_STATUS res; + if (!name) { return EFI_INVALID_PARAMETER; } + + res = FileOpen(root, name, &file, EFI_FILE_MODE_READ, EFI_FILE_DIRECTORY); + if (EFI_ERROR(res)) return res; + FileClose(file); + return EFI_SUCCESS; +} + EFI_STATUS FileOpenRoot( IN EFI_HANDLE rootHandle, -- cgit v1.2.3