The debug/trace feature of Windows Sockets 2 will only work with the debug version of ws2_32.dll. For documentation of the debug/trace feature, as well as this dt_dll sample source code, consult DBGSPEC.DOC.