How do I consume this windows dll method from golang : I am trying to use the following method which is present in kernel32.dll
[MSDN Entry - GetPhysicallyInstalledSystemMemory][1]

it requires a single argument of the type [PULONGLONG][2] 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? (I would be interested if anyone knows of any good examples/tuts on working with .dll in golang).

Thanks in advance
  
    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\n", ret)
    	fmt.Printf("GetPhysicallyInstalledSystemMemory, memory: %d\n", memory)
    	fmt.Printf("GetPhysicallyInstalledSystemMemory, err: %s\n", err)
    
    }


  [1]: https://msdn.microsoft.com/en-us/library/windows/desktop/cc300158(v=vs.85).aspx
  [2]: https://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx#PULONGLONG