1. You pass the local variable ClientAddressPtr to the call, but as far as I can read from the documentation, you have to pass the pointer to this variable. So call it with @ClientAddressPtr.
2. What about this comment
Zitat:
// function always returns an error 997: overlapped IO on session 0
and what does dwBytesReturned contain after the call?