Instrumentation extract showing handle duplication and another showing socket context lookup failure -- instrumentation shows the handle is duplicated, so the handle layer does not seem to be the issue. (ntoskrnl/ex/handle.c:1100) (PID 408) ExDupHandleTable() Loop starting to process entry: 0000067C, checking audit mask value: b19be80b mask: 2 (ntoskrnl/ex/handle.c:1123) (PID 408) ExDupHandleTable() locked entry copied address and is calling DupHandleProcedure(). (ntoskrnl/ex/handle.c:1133) (PID 408) ExDupHandleTable() call to DupHandleProcedure() callback returned success, adjusting references and new table count. (ntoskrnl/ex/handle.c:1140) (PID 408) 0000067C: Object: B19BE820 GrantedAccess: 12019f Entry: E1724CF8 (ntoskrnl/ex/handle.c:1141) (PID 408) Object: B19BE820 Type: (b266fe70) File (ntoskrnl/ex/handle.c:1142) (PID 408) ObjectHeader: B19BE808 (ntoskrnl/ex/handle.c:1143) (PID 408) HandleCount: 2 PointerCount: 2 (ntoskrnl/ex/handle.c:1152) (PID 408) Name: \Endpoint (ntoskrnl/ex/handle.c:1245) (PID 408) ExDupHandleTable() finished current handle entry - incrementing counters and looping for next one. -- instrumentation shows failure at winsock layer output follows (dll/win32/ws2_32/src/recv.c:35) (PID 438) recv: 1660, 0, 200, 0022F8BC (dll/win32/ws2_32/src/dsocket.c:157) (PID 438) WsSockGetSocket() calling WahReferenceContextByHandle for 0000067C. (dll/win32/ws2help/context.c:548) (PID 438) WahReferenceContextByHandle() failed to retreive the HashTable (undetected fault). (dll/win32/ws2help/context.c:562) (PID 438) WahReferenceContextByHandle() failed to retreive the HashHandle (undetected fault). (dll/win32/ws2_32/src/dsocket.c:166) (PID 438) WsSockGetSocket() WahReferenceContextByHandle returned NULL calling WsSockFindIfsSocket for 0000067C. (dll/win32/ws2_32/src/dsocket.c:110) (PID 438) WsSockFindIfsSocket() called for 0000067C. (dll/win32/ws2_32/src/dsocket.c:137) (PID 438) WsSockFindIfsSocket() call to WsTcFindIfsProviderForSocket() returned error (not ERROR_SUCCESS - undetected failure) for 0000067C returning NULL. (dll/win32/ws2_32/src/recv.c:83) (PID 438) recv: completed with error, returning SOCKET_ERROR - recv: 1660, 0, 200, 0022F8BC something is definitely rotten in the winsock layer, the context lookup fails for the socket. Maybe the context structure is non-global ?? other UDP socket lookups by our test app seem to work through WahReferenceContextByHandle (when using non inherited handles) (dll/win32/ws2_32/src/sockctrl.c:34) (PID 438) connect: socket:1752, name:0022FCC0, namelen:10 (dll/win32/ws2_32/src/sockctrl.c:40) (PID 438) connect: call WsGetSocket() to get socket context. (dll/win32/ws2_32/src/dsocket.c:157) (PID 438) WsSockGetSocket() calling WahReferenceContextByHandle for 000006D8. (dll/win32/ws2_32/src/dsocket.c:161) (PID 438) WsSockGetSocket() WahReferenceContextByHandle returned 235f18. (dll/win32/ws2_32/src/sockctrl.c:46) (PID 438) connect: call to WsGetSocket() returned valid sockaddr struct in name. (dll/win32/ws2_32/src/sockctrl.c:50) (PID 438) connect: AF_INET host 127.0.0.1:8888 (dll/win32/ws2_32/src/sockctrl.c:55) (PID 438) connect: host 127.0.0.1:8888 calling provider lpWSPConnect() context lookup fails because these two end up returning NULL for inherited handles