mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-10-18 02:29:04 +02:00
terminal_services: fix swapped cpu_time labels, pending broker gauge, shared PDH query and series caching (#2687)
Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
1f96f71a7c
commit
08bcab7f9a
@@ -18,7 +18,6 @@
|
||||
package wtsapi32
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"unsafe"
|
||||
@@ -145,13 +144,10 @@ func WTSOpenServer(server string) (windows.Handle, error) {
|
||||
return serverHandle, nil
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
return nil
|
||||
// WTSCloseServer closes a handle opened by WTSOpenServer. The function returns
|
||||
// void, so neither r1 nor the last error say whether it failed.
|
||||
func WTSCloseServer(server windows.Handle) {
|
||||
_, _, _ = procWTSCloseServer.Call(uintptr(server))
|
||||
}
|
||||
|
||||
func WTSFreeMemoryEx(class WTSTypeClass, pMemory uintptr, numberOfEntries uint32) error {
|
||||
|
||||
Reference in New Issue
Block a user