/
githubmirror
/
efifs
Обзор
Документация
Войти
/
githubmirror
/
efifs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v1.5
src/missing.c
83 строки
2 KB
Pete Batard
fix EDK2 compilation
10 май 2019, 14:00
Не верифицирован
10 май 2019, 14:00
5c954da
Код
Авторство
О чём код?
/* missing.c - Missing convenience calls from the EFI interface */ /* * Copyright © 2014-2017 Pete Batard <pete@akeo.ie> * Based on GRUB -- GRand Unified Bootloader * Copyright © 1999-2010 Free Software Foundation, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "driver.h" // Needed to avoid a LNK2043 error with EDK2/MSVC/IA32 #if !defined(__MAKEWITH_GNUEFI) && defined(_M_IX86) #pragma comment(linker, "/INCLUDE:_MultS64x64") #endif VOID strcpya(CHAR8 *dst, CONST CHAR8 *src) { INTN len = strlena(src) + 1; CopyMem(dst, src, len); } CHAR8 * strchra(const CHAR8 *s, INTN c) { do { if (*s == c) return (CHAR8 *) s; } while (*s++); return NULL; } CHAR8 * strrchra(const CHAR8 *s, INTN c) { CHAR8 *p = NULL; do { if (*s == c) p = (CHAR8 *) s; } while (*s++); return p; } EFI_STATUS PrintGuid(EFI_GUID *Guid) { if (Guid == NULL) { Print(L"ERROR: PrintGuid called with a NULL value.\n"); return EFI_INVALID_PARAMETER; } Print(L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x\n", Guid->Data1, Guid->Data2, Guid->Data3, Guid->Data4[0], Guid->Data4[1], Guid->Data4[2], Guid->Data4[3], Guid->Data4[4], Guid->Data4[5], Guid->Data4[6], Guid->Data4[7] ); return EFI_SUCCESS; }