I've got a problem with Named Pipe under Windows. I've created a (waiting and duplex) Named Pipe with CreateNamedPipe() and ConnectNamedPipe(). On the client side I've connected to this with CreateFile() and write an amount of data to this pipe. How can the client tell the server, that the end of data is reached. When I try SetEndOfFile() I got the error code ERROR_INVALID_PARAMETER. And closing the handle is inacceptable because after the client wrote its data, it want to read the answer, so I need the handle.