From b87fc6b140772ba3017de311c7063c259424264c Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 15 Aug 2016 17:11:31 +0200 Subject: First public release. Used by VeraCrypt 1.18. --- DcsCfg/DcsCfgBlockio.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 DcsCfg/DcsCfgBlockio.c (limited to 'DcsCfg/DcsCfgBlockio.c') diff --git a/DcsCfg/DcsCfgBlockio.c b/DcsCfg/DcsCfgBlockio.c new file mode 100644 index 0000000..ca9ec09 --- /dev/null +++ b/DcsCfg/DcsCfgBlockio.c @@ -0,0 +1,52 @@ +/** @file +DCS configuration block devices + +Copyright (c) 2016. Disk Cryptography Services for EFI (DCS), Alex Kolotnikov +Copyright (c) 2016. VeraCrypt, Mounir IDRASSI + +This program and the accompanying materials +are licensed and made available under the terms and conditions +of the GNU Lesser General Public License, version 3.0 (LGPL-3.0). + +The full text of the license may be found at +https://opensource.org/licenses/LGPL-3.0 +**/ + +#include +#include +#include +#include +#include +#include + +#include "DcsCfg.h" + +////////////////////////////////////////////////////////////////////////// +// Block I/O +////////////////////////////////////////////////////////////////////////// +UINTN BioIndexStart = 0; +UINTN BioIndexEnd = 0; +BOOLEAN BioSkipPartitions = FALSE; + +void BioPrintDevicePath(UINTN bioIndex) { + OUT_PRINT(L"%V%d%N ", bioIndex); + EfiPrintDevicePath(gBIOHandles[bioIndex]); +} + +void BioPrintDevicePaths(CHAR16* msg) { + UINTN i; + OUT_PRINT(msg); + if (BioIndexStart >= gBIOCount) return; + for (i = BioIndexStart; i < gBIOCount; ++i) { + if(BioSkipPartitions && EfiIsPartition(gBIOHandles[i])) continue; + BioPrintDevicePath(i); + OUT_PRINT(L"\n"); + } +} + +VOID +PrintBioList() { + InitBio(); + BioPrintDevicePaths(L"%HBlock IO handles%N\n"); +} + -- cgit v1.2.3