In the process of re-writing my CAsyncSocket to the more controllable WSA flavor I got stuck on WaitForMultipleObjects.
For Each Event on the socket that I do a bind by that I mean FD_READ, FD_WRITE I CreateEvent I associate the events with WSAEventSelect.
I pass all the info (HWND windows message etc when I want notification to be sent in a structure) pointed to by a LPVOID the parameter in The CreateThread
I let the worker thread wait on the events and do the appropriate SendMessage
Problems is I am abending or rather getting an Access violation on WaitForMultipleobjects
Running under the visual studio debugger I can see the values of the 5 events are correct
The first thing i thought of was that my worker thread didnt have security rights to the events I created in the Mother thread ( all threads are in the same process)
I just figured the quickest way to resolve this was to name the events and do a OpenEvent If I get a null from any events I would have a problem
All of the events named from OpenEvent return a value however they are not the same event values that I created
Real mystery to me
Hope some one can help