From 42d7c987c89c294560fef23f440c9a2bd1df65c6 Mon Sep 17 00:00:00 2001 From: kavsrf Date: Sun, 3 Sep 2017 09:23:17 +0300 Subject: size of sector = 512 (check and info) --- DcsInt/DcsInt.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'DcsInt') diff --git a/DcsInt/DcsInt.c b/DcsInt/DcsInt.c index 3dad27e..f7c3965 100644 --- a/DcsInt/DcsInt.c +++ b/DcsInt/DcsInt.c @@ -494,13 +494,20 @@ SecRegionLoadDefault(EFI_HANDLE partHandle) // get BlockIo protocol bio = EfiGetBlockIO(SecRegionHandle); if (bio == NULL) { - ERR_PRINT(L"Block io not supported\n,"); + ERR_PRINT(L"Block I/O not supported\n"); return EFI_NOT_FOUND; } + if (bio->Media != NULL) { + if (bio->Media->BlockSize != 512) { + ERR_PRINT(L"Block size is %d. (not supported)\n", bio->Media->BlockSize); + return EFI_INVALID_PARAMETER; + } + } + SecRegionData = MEM_ALLOC(512); if (SecRegionData == NULL) { - ERR_PRINT(L"No memory\n,"); + ERR_PRINT(L"No memory\n"); return EFI_BUFFER_TOO_SMALL; } SecRegionSize = 512; -- cgit v1.2.3