mi: Revert "replace all WMI calls with MI calls" (#1713)

This commit is contained in:
Jan-Otto Kröpke
2024-11-03 11:20:46 +01:00
committed by GitHub
parent c4f5d58a3e
commit 45d3eabab9
82 changed files with 738 additions and 2767 deletions

View File

@@ -1,28 +0,0 @@
package testutils
import (
"unsafe"
"golang.org/x/sys/windows"
)
var (
modkernel32 = windows.NewLazySystemDLL("kernel32.dll")
procGetProcessHandleCount = modkernel32.NewProc("GetProcessHandleCount")
)
func GetProcessHandleCount(handle windows.Handle) (uint32, error) {
var count uint32
r1, _, err := procGetProcessHandleCount.Call(
uintptr(handle),
uintptr(unsafe.Pointer(&count)),
)
if r1 != 1 {
return 0, err
}
return count, nil
}