I am trying to use the GetPhysicallyInstalledSystemMemory
method which is present in kernel32.dll.
It requires a single argument of the type PULONGLONG, but I have no idea how to map this into a golang variable. Here is my current attempt which results in "err: The parameter is incorrect".
Can anyone explain how to do this?
package main
import (
"fmt"
"syscall"
)
var memory uintptr
func main() {
kernel32 := syscall.NewLazyDLL("kernel32.dll")
getPhysicallyInstalledSystemMemoryProc := kernel32.NewProc("GetPhysicallyInstalledSystemMemory")
ret, _, err := getPhysicallyInstalledSystemMemoryProc.Call(uintptr(memory))
fmt.Printf("GetPhysicallyInstalledSystemMemory, return: %+v
", ret)
fmt.Printf("GetPhysicallyInstalledSystemMemory, memory: %d
", memory)
fmt.Printf("GetPhysicallyInstalledSystemMemory, err: %s
", err)
}