mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-13 16:36:37 +00:00
*: avoid using default wmi client. (#1590)
This commit is contained in:
@@ -43,7 +43,7 @@ type DynamicTimezoneInformation struct {
|
||||
func GetDynamicTimeZoneInformation() (DynamicTimezoneInformation, error) {
|
||||
var tzi DynamicTimezoneInformation
|
||||
|
||||
r0, _, err := syscall.SyscallN(procGetDynamicTimeZoneInformationSys.Addr(), uintptr(unsafe.Pointer(&tzi)))
|
||||
r0, _, err := procGetDynamicTimeZoneInformationSys.Call(uintptr(unsafe.Pointer(&tzi)))
|
||||
if uint32(r0) == 0xffffffff {
|
||||
return tzi, err
|
||||
}
|
||||
|
||||
@@ -45,16 +45,16 @@ var NetApiStatus = map[uint32]string{
|
||||
2351: "NERR_InvalidComputer",
|
||||
// This operation is only allowed on the primary domain controller of the domain.
|
||||
2226: "NERR_NotPrimary",
|
||||
/// This operation is not allowed on this special group.
|
||||
// This operation is not allowed on this special group.
|
||||
2234: "NERR_SpeGroupOp",
|
||||
/// This operation is not allowed on the last administrative account.
|
||||
// This operation is not allowed on the last administrative account.
|
||||
2452: "NERR_LastAdmin",
|
||||
/// The password parameter is invalid.
|
||||
// The password parameter is invalid.
|
||||
2203: "NERR_BadPassword",
|
||||
/// The password does not meet the password policy requirements.
|
||||
/// Check the minimum password length, password complexity and password history requirements.
|
||||
// The password does not meet the password policy requirements.
|
||||
// Check the minimum password length, password complexity and password history requirements.
|
||||
2245: "NERR_PasswordTooShort",
|
||||
/// The user name could not be found.
|
||||
// The user name could not be found.
|
||||
2221: "NERR_UserNotFound",
|
||||
// Errors
|
||||
5: "ERROR_ACCESS_DENIED",
|
||||
|
||||
@@ -12,7 +12,8 @@ var (
|
||||
procSLIsWindowsGenuineLocal = slc.NewProc("SLIsWindowsGenuineLocal")
|
||||
)
|
||||
|
||||
// Define SL_GENUINE_STATE enumeration
|
||||
// SL_GENUINE_STATE enumeration
|
||||
//
|
||||
// https://learn.microsoft.com/en-us/windows/win32/api/slpublic/ne-slpublic-sl_genuine_state
|
||||
type SL_GENUINE_STATE uint32
|
||||
|
||||
|
||||
Reference in New Issue
Block a user