skeleton for testing purposes

This commit is contained in:
lin committed 2026-10-05 14:17:03 +02:00
1 parent 8076b30e3f
commit 71e4f1294e
11 files changed
+273

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
package system_check
import (
"sync"
"golang.org/x/sys/windows"
)
type WindowsSystemCheckTools struct {
/*
* Win32 API
*/
Kernel32 *windows.LazyDLL
/*
* Windows memory information
*/
ProcGlobalMemoryStatusEx *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") })
return WindowsSystemCheckTools{
Kernel32: kernel32(),
ProcGlobalMemoryStatusEx: procGlobalMemoryStatusEx(),
}
}