mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-17 10:09:05 +02:00
wmi: add generic wmi collector (#2530)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
a67a64c55c
commit
88034b818e
@@ -107,6 +107,7 @@ func (instance *Instance) GetElement(elementName string) (*Element, error) {
|
||||
var (
|
||||
valueBuf [5]uint64
|
||||
valueType ValueType
|
||||
flags uint32
|
||||
)
|
||||
|
||||
r0, _, _ := syscall.SyscallN(
|
||||
@@ -115,7 +116,7 @@ func (instance *Instance) GetElement(elementName string) (*Element, error) {
|
||||
uintptr(unsafe.Pointer(elementNameUTF16)),
|
||||
uintptr(unsafe.Pointer(&valueBuf)),
|
||||
uintptr(unsafe.Pointer(&valueType)),
|
||||
0,
|
||||
uintptr(unsafe.Pointer(&flags)),
|
||||
0,
|
||||
)
|
||||
|
||||
@@ -127,6 +128,8 @@ func (instance *Instance) GetElement(elementName string) (*Element, error) {
|
||||
value: uintptr(valueBuf[0]),
|
||||
arrayLen: uint32(valueBuf[1]),
|
||||
valueType: valueType,
|
||||
flags: flags,
|
||||
raw: valueBuf,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user