Connects to a message-type pipe (and waits if an instance of the pipe is not available), writes to and reads from the pipe, and then closes the pipe.
BOOL CallNamedPipe( LPCTSTR lpNamedPipeName, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesRead, DWORD nTimeOut )
- [input] The pipe name.
- [input] The data to be written to the pipe.
- [input] The size of the write buffer, in bytes.
- [output] A pointer to the buffer that receives the data read from the pipe.
- [input] The size of the read buffer, in bytes.
- [output] A pointer to a variable that receives the number of bytes read from the pipe.
- [input] The number of milliseconds to wait for the named pipe to be available. In addition to numeric values, the following special values can be specified.
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Calling CallNamedPipe is equivalent to calling the CreateFile (or WaitNamedPipe, if CreateFile cannot open the pipe immediately), TransactNamedPipe, and CloseHandle functions. CreateFile is called with an access flag of GENERIC_READ | GENERIC_WRITE, and an inherit handle flag of FALSE.
CallNamedPipe fails if the pipe is a byte-type pipe.
Header to Include