Testing for linux cpuinfo
This commit is contained in:
1 parent
cbc9e4a0b4
commit
ea5e79a46a
8 files changed
+172
-20
No files matched your search
@@ -0,0 +1,36 @@
|
||||
//go:build windows
|
||||
|
||||
package windows_system
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"golang.org/x/sys/windows"
|
||||
)
|
||||
|
||||
type WindowsSystemCheckTools struct {
|
||||
/*
|
||||
* Win32 API
|
||||
*/
|
||||
Kernel32 *windows.LazyDLL
|
||||
/*
|
||||
* Windows memory information
|
||||
*/
|
||||
ProcGlobalMemoryStatusEx *windows.LazyProc
|
||||
/*
|
||||
* Windows processor information
|
||||
*/
|
||||
SystemTimes *windows.LazyProc
|
||||
}
|
||||
|
||||
func GetWindowsTools() WindowsSystemCheckTools {
|
||||
kernel32 := sync.OnceValue(func() *windows.LazyDLL { return windows.NewLazySystemDLL("kernel32.dll") })
|
||||
procGlobalMemoryStatusEx := sync.OnceValue(func() *windows.LazyProc { return kernel32().NewProc("GlobalMemoryStatusEx") })
|
||||
systemTimes := sync.OnceValue(func() *windows.LazyProc { return kernel32().NewProc("GetSystemTimes") })
|
||||
|
||||
return WindowsSystemCheckTools{
|
||||
Kernel32: kernel32(),
|
||||
ProcGlobalMemoryStatusEx: procGlobalMemoryStatusEx(),
|
||||
SystemTimes: systemTimes(),
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user