HANDLE CreateThread(
LPSECURITY_ATTRIBUTES lpThreadAttributes, // SD
SIZE_T dwStackSize, // initial stack size
LPTHREAD_START_ROUTINE lpStartAddress, // thread function
LPVOID lpParameter, // thread argument
DWORD dwCreationFlags, // creation option
LPDWORD lpThreadId // thread identifier
);
The Bold param is there for you to pass a 32 bit value to a thread function....now this can be whatever, but usually its best to pass a pointer...
Code:
//Main
SOCKET sock;
//..................
CreateThread(........., (LPVOID) &sock,.....);
//..................
}
DWORD WINAPI ThreadProc(LPVOID lpParameter){
SOCKET sock = (SOCKET)*lpParameter;
//Use socket as you wish....
}