One other thing, TransmitFile isn't checking the return value. It should probably do something like ConnectEx does, ie call WSAGetLastError and raise an exception for anything other than ERROR_IO_PENDING. Roger