提交 2b99d2b7 编写于 作者: W WAKAYAMA Shirou

refactor proc name.

上级 4f591291
......@@ -8,8 +8,7 @@ import (
)
var (
modKernel32 = syscall.NewLazyDLL("kernel32.dll")
globalMemoryStatusEx = modKernel32.NewProc("GlobalMemoryStatusEx")
procGlobalMemoryStatusEx = modKernel32.NewProc("GlobalMemoryStatusEx")
)
type MEMORYSTATUSEX struct {
......@@ -29,7 +28,7 @@ func (m Mem) Virtual_memory() (Virtual_memory, error) {
var memInfo MEMORYSTATUSEX
memInfo.cbSize = uint32(unsafe.Sizeof(memInfo))
mem, _, _ := globalMemoryStatusEx.Call(uintptr(unsafe.Pointer(&memInfo)))
mem, _, _ := procGlobalMemoryStatusEx.Call(uintptr(unsafe.Pointer(&memInfo)))
if mem == 0 {
return ret, syscall.GetLastError()
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册