I have a DLL compiled with CGO. It exports 3 functions:
```
//export Run1
func Run(text string) (stdout []byte, stderr []byte, err error) {
fmt.Println(text)
return nil, nil, nil
}
//export Run2
func Run2() (stdout []byte, stderr []byte, err error) {
fmt.Println("Heyyyyy")
fmt.Println(111111)
return nil, nil, nil
}
//export Run3
func Run3(a int) (stdout []byte, stderr []byte, err error) {
fmt.Println(a)
return nil, nil, nil
}
```
In a seperate Go file I import the DLL and try to call the exported function.
For Run2 everything works
```
s = uinptr(ADDRESS_RUN2)
syscall.SyscallN(s)
```
It prints Heyyyyy and 1111111 in my output
For Run3, I am not sure how to pass the argument to SyscallN.
```
a := 999999999
syscall.SyscallN(s, uintptr(unsafe.Pointer(&a))) ----> Fail (random Number printed)
a := 999999999
syscall.SyscallN(s, uintptr(unsafe.Pointer(a))) -----> Fail (random Number printed)
```
For Run1, it get worse as sometimes I get C0000005 error as I use the string elsewhere:
```
cmdBytes := []byte(torun)
cmdBytes = append(cmdBytes, 0)
ptr := unsafe.Pointer(&cmdBytes[0])
syscall.SyscallN(d, uintptr(ptr))
```
Any help please ??