typedef BOOL(WINAPI *nGetFirmwareType)(
    PFIRMWARE_TYPE FirmwareType);

static nGetFirmwareType pGetFirmwareType = NULL;
static HMODULE hKernel32 = NULL;

if (IsWindows8OrGreater()) {
    FIRMWARE_TYPE FirmwareType;
    if (!hKernel32) {
        hKernel32 = LoadLibrary(L"Kernel32.dll");
    }
    if (hKernel32) {
        if (!pGetFirmwareType) {
            pGetFirmwareType = (nGetFirmwareType)GetProcAddress(hKernel32, "GetFirmwareType");
        }
    }
    pGetFirmwareType(&FirmwareType);
}

https://msdn.microsoft.com/en-us/library/windows/desktop/hh848321.aspx

https://msdn.microsoft.com/en-us/library/aa270759.aspx

Comments
Write a Comment