mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-18 18:49:05 +02:00
headers: fail Build on missing native exports and assert MI/COM layouts (#2739)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
@@ -21,6 +21,7 @@ import (
|
||||
"errors"
|
||||
"unsafe"
|
||||
|
||||
"github.com/prometheus-community/windows_exporter/internal/headers/lazyproc"
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
@@ -28,8 +29,14 @@ import (
|
||||
var (
|
||||
slc = windows.NewLazySystemDLL("slc.dll")
|
||||
procSLIsWindowsGenuineLocal = slc.NewProc("SLIsWindowsGenuineLocal")
|
||||
|
||||
load = lazyproc.Once(slc, procSLIsWindowsGenuineLocal)
|
||||
)
|
||||
|
||||
// Load checks that slc.dll exports every function of this package. Call it in
|
||||
// Build: a missing export panics on the first call otherwise.
|
||||
func Load() error { return load() }
|
||||
|
||||
// SL_GENUINE_STATE enumeration
|
||||
//
|
||||
// https://learn.microsoft.com/en-us/windows/win32/api/slpublic/ne-slpublic-sl_genuine_state
|
||||
|
||||
Reference in New Issue
Block a user