MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / DumpVariable

Function DumpVariable

rEFIt_UEFI/refit/lib.cpp:1693–1724  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1691}
1692
1693BOOLEAN DumpVariable(CHAR16* Name, EFI_GUID* Guid, INTN DevicePathAt)
1694{
1695 UINTN dataSize = 0;
1696 UINT8 *data = NULL;
1697 UINTN i;
1698 EFI_STATUS Status;
1699
1700 Status = gRT->GetVariable (Name, Guid, NULL, &dataSize, data);
1701 if (Status == EFI_BUFFER_TOO_SMALL) {
1702 data = (__typeof__(data))AllocateZeroPool(dataSize);
1703 Status = gRT->GetVariable (Name, Guid, NULL, &dataSize, data);
1704 if (EFI_ERROR(Status)) {
1705 DBG("Can't get %ls, size=%llu\n", Name, dataSize);
1706 FreePool(data);
1707 data = NULL;
1708 } else {
1709 DBG("%ls var size=%llu\n", Name, dataSize);
1710 for (i = 0; i < dataSize; i++) {
1711 DBG("%02hhX ", data[i]);
1712 }
1713 DBG("\n");
1714 if (DevicePathAt >= 0) {
1715 DBG("%ls: %ls\n", Name, FileDevicePathToXStringW((EFI_DEVICE_PATH_PROTOCOL*)&data[DevicePathAt]).wc_str());
1716 }
1717 }
1718 }
1719 if (data) {
1720 FreePool(data);
1721 return TRUE;
1722 }
1723 return FALSE;
1724}
1725
1726VOID DbgHeader(CONST CHAR8 *str)
1727{

Callers 1

RefitMainFunction · 0.85

Calls 4

FileDevicePathToXStringWFunction · 0.85
AllocateZeroPoolFunction · 0.50
FreePoolFunction · 0.50
wc_strMethod · 0.45

Tested by

no test coverage detected