mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-08 05:56:37 +00:00
chore(deps): update dependency golangci/golangci-lint to v2.2.1 (#2110)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
@@ -154,6 +154,7 @@ func GetIfEntry2Ex(row *MIB_IF_ROW2) error {
|
||||
// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/nf-netioapi-convertinterfaceguidtoluid
|
||||
func ConvertInterfaceGUIDToLUID(guid ole.GUID) (uint64, error) {
|
||||
var luid uint64
|
||||
|
||||
ret, _, _ := procConvertInterfaceGuidToLuid.Call(
|
||||
uintptr(unsafe.Pointer(&guid)),
|
||||
uintptr(unsafe.Pointer(&luid)),
|
||||
|
||||
@@ -51,6 +51,7 @@ var (
|
||||
// GetPerformanceInfo returns the dereferenced version of GetLPPerformanceInfo.
|
||||
func GetPerformanceInfo() (PerformanceInformation, error) {
|
||||
var lppi PerformanceInformation
|
||||
|
||||
size := (uint32)(unsafe.Sizeof(lppi))
|
||||
lppi.cb = size
|
||||
r1, _, err := procGetPerformanceInfo.Call(uintptr(unsafe.Pointer(&lppi)), uintptr(size))
|
||||
|
||||
@@ -50,7 +50,6 @@ func SLIsWindowsGenuineLocal() (SL_GENUINE_STATE, error) {
|
||||
_, _, err := procSLIsWindowsGenuineLocal.Call(
|
||||
uintptr(unsafe.Pointer(&genuineState)),
|
||||
)
|
||||
|
||||
if !errors.Is(err, windows.NTE_OP_OK) {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
@@ -127,6 +127,7 @@ var (
|
||||
// https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-globalmemorystatusex
|
||||
func GlobalMemoryStatusEx() (MemoryStatus, error) {
|
||||
var mse memoryStatusEx
|
||||
|
||||
mse.dwLength = (uint32)(unsafe.Sizeof(mse))
|
||||
r1, _, err := procGlobalMemoryStatusEx.Call(uintptr(unsafe.Pointer(&mse)))
|
||||
|
||||
|
||||
@@ -147,7 +147,6 @@ func WTSOpenServer(server string) (windows.Handle, error) {
|
||||
|
||||
func WTSCloseServer(server windows.Handle) error {
|
||||
r1, _, err := procWTSCloseServer.Call(uintptr(server))
|
||||
|
||||
if r1 != 1 && !errors.Is(err, windows.ERROR_SUCCESS) {
|
||||
return fmt.Errorf("failed to close server: %w", err)
|
||||
}
|
||||
@@ -196,6 +195,7 @@ func WTSEnumerateSessionsEx(server windows.Handle, logger *slog.Logger) ([]WTSSe
|
||||
}
|
||||
|
||||
var sizeTest wtsSessionInfo1
|
||||
|
||||
sessionSize := unsafe.Sizeof(sizeTest)
|
||||
|
||||
sessions := make([]WTSSession, 0, count)
|
||||
|
||||
Reference in New Issue
Block a user