mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-28 07:44:06 +01:00
Bootmgr: cleans code
This commit is contained in:
@@ -171,9 +171,6 @@ NTSTATUS NTAPI NtQuerySystemEnvironmentValueEx(
|
||||
_Out_opt_ PULONG Attributes // EFI_VARIABLE_*
|
||||
);
|
||||
|
||||
NTSTATUS NTAPI RtlGUIDFromString(IN PCUNICODE_STRING GuidString, OUT GUID* Guid);
|
||||
NTSTATUS NTAPI RtlStringFromGUIDEx(IN const GUID* Guid, OUT PUNICODE_STRING GuidString, IN BOOLEAN AllocateGuidString);
|
||||
|
||||
typedef struct _SYSTEM_SECUREBOOT_INFORMATION {
|
||||
BOOLEAN SecureBootEnabled;
|
||||
BOOLEAN SecureBootCapable;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <stdalign.h>
|
||||
|
||||
#define FF_EFIVARS_PATH_PREFIX "/sys/firmware/efi/efivars/"
|
||||
#define FF_EFI_GLOBAL_GUID "8be4df61-93ca-11d2-aa0d-00e098032b8c"
|
||||
|
||||
const char* ffDetectBootmgr(FFBootmgrResult* result) {
|
||||
alignas(uint16_t) uint8_t buffer[2048];
|
||||
|
||||
@@ -39,10 +39,12 @@ const char* ffDetectBootmgr(FFBootmgrResult* result) {
|
||||
return err;
|
||||
}
|
||||
|
||||
GUID efiGlobalGuid;
|
||||
if (!NT_SUCCESS(RtlGUIDFromString(&(UNICODE_STRING) RTL_CONSTANT_STRING(L"{" FF_EFI_GLOBAL_GUID L"}"), &efiGlobalGuid))) {
|
||||
return "RtlGUIDFromString() failed";
|
||||
}
|
||||
GUID efiGlobalGuid = {
|
||||
.Data1 = 0x8be4df61,
|
||||
.Data2 = 0x93ca,
|
||||
.Data3 = 0x11d2,
|
||||
.Data4 = { 0xaa, 0x0d, 0x00, 0xe0, 0x98, 0x03, 0x2b, 0x8c },
|
||||
};
|
||||
|
||||
ULONG size = sizeof(result->order);
|
||||
if (!NT_SUCCESS(NtQuerySystemEnvironmentValueEx(&(UNICODE_STRING) RTL_CONSTANT_STRING(L"BootCurrent"), &efiGlobalGuid, &result->order, &size, nullptr))) {
|
||||
|
||||
@@ -18,5 +18,3 @@ typedef struct FFEfiLoadOption {
|
||||
} FFEfiLoadOption;
|
||||
|
||||
bool ffEfiFillLoadOption(const FFEfiLoadOption* efiOption, FFBootmgrResult* result);
|
||||
|
||||
#define FF_EFI_GLOBAL_GUID "8be4df61-93ca-11d2-aa0d-00e098032b8c"
|
||||
|
||||
Reference in New Issue
Block a user