Hi there,
I'm currently a little lost in the "syscall" space of Go. I tried to migrate a the following code from C to Go:
DeviceIoControl(fd, IOCTL_FUNCTION, &flag, sizeof(flag), &flag, sizeof(flag), &len, NULL)
But there isn't such a low level function in Go, so I rewrote the "CTL_CODE" Macro from Windows
and tried instead (don't hit me, I'm not very expirienced with Windows and the arguments fitted):
code := CtlCode(FILE_DEVICE_UNKNOWN, IOCTL_FUNCTION, METHOD_BUFFERED, FILE_ANY_ACCESS)
err = syscall.WSAIoctl(handle, code, &flag[0], flagLen, &flag[0], flagLen, &retLen, nil, 0)
if err != nil { ...
But I allways get an error like "An operation was attempted on something that is not a socket".
I know that, because I try to access an opened character device ...
Question: What is the correct way of converting the "DeviceIoControl()" into Go ?
Thanx a lot,
C.