Hello,
How people using Lazarus are dealing with Windows header files ? I have hard time to find them.
In particular, Microsoft says "The WSAID_MULTIPLE_RIO GUID is defined in the Mswsock.h header file."
After much search, I found one header file that does not contain this define. I see for example:
#define WSAID_CONNECTEX {0x25a207b9,0xddf3,0x4660,{0x8e,0xe9,0x76,0xe5,0x8c,0x74,0x06,0x3e}}
but not WSAID_MULTIPLE_RIO GUID .
I found a piece of code online with the following:
WSAID_MULTIPLE_RIO := &windows.GUID{0x8509e081, 0x96dd, 0x4005, [8]byte{0xb1, 0x65, 0x9e, 0x2e, 0xe8, 0xc7, 0x9e, 0x3f}}
const SIO_GET_MULTIPLE_EXTENSION_FUNCTION_POINTER = 0xc8000024
ob := uint32(0)
err = windows.WSAIoctl(socket, SIO_GET_MULTIPLE_EXTENSION_FUNCTION_POINTER,
(*byte)(unsafe.Pointer(WSAID_MULTIPLE_RIO)), uint32(unsafe.Sizeof(*WSAID_MULTIPLE_RIO)),
(*byte)(unsafe.Pointer(&extensionFunctionTable)), uint32(unsafe.Sizeof(extensionFunctionTable)),
&ob, nil, 0)
I created the constants like this:
IOC_IN = $80000000;
IOC_OUT = $40000000;
IOC_INOUT = IOC_IN or IOC_OUT;
IOC_WS2 = $08000000;
SIO_GET_MULTIPLE_EXTENSION_FUNCTION_POINTER = IOC_INOUT or IOC_WS2 or 36; // 3355443236; // $C8 00 00 24
WSAID_MULTIPLE_RIO: array [0..15] of byte = ($85, $09, $e0, $81, + $96, + $dd, $40, $05, $b1, $65, $9e, $2e, $e8, $c7, $9e, $3f); // 0x8509e08196dd4005b1659e2ee8c79e3f;
WSA_FLAG_REGISTERED_IO_BP = 8;
run WSASocketW which returns a valid socket handle. However, WSAIoctl returns -1, and subsequent WSAGetLastError zero.
So, here I am, don't know how to go further.