-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Hello. I just discovered this project.
But trying to build for _WIN32 is broken at the moment. Seems it has never worked.
Several issues:
- Use of
std::vectorw/o an#include <vector> Signatureshould besignature.getDMI()should be calledget_dmi_data()- etc.
So with this patch it works for MSVC and clang-cl:
--- a/smbios_decode.c 2024-12-13 01:43:15
+++ b/smbios_decode.c 2025-09-13 07:25:05
@@ -24,22 +24,24 @@
#include <Windows.h>
-static bool getDMI( std::vector<uint8_t> &buffer )
+static bool get_dmi_data( uint8_t **buffer, size_t *size )
{
const BYTE byteSignature[] = { 'B', 'M', 'S', 'R' };
const DWORD signature = *((DWORD*)byteSignature);
// get the size of SMBIOS table
- DWORD size = GetSystemFirmwareTable(signature, 0, NULL, 0);
- if (size == 0) return false;
- buffer.resize(size, 0);
+ *size = GetSystemFirmwareTable(signature, 0, NULL, 0);
+ if (*size == 0)
+ return false;
+
+ *buffer = (uint8_t*) malloc(*size);
+ if (*buffer == NULL)
+ return false;
+
// retrieve the SMBIOS table
- if (size != GetSystemFirmwareTable(Signature, 0, buffer.data(), size))
- {
- buffer.clear();
+ if (*size != GetSystemFirmwareTable(signature, 0, *buffer, *size))
return false;
- }
return true;
}brunexgeek
Metadata
Metadata
Assignees
Labels
No labels