Creates an anonymous pipe, and returns handles to the read and write ends of the pipe.
BOOL CreatePipe( HANDLE * hReadPipe, HANDLE * hWritePipe, PSECURITY_ATTRIBUTES lpPipeAttributes, DWORD nSize )
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.
CreatePipe creates the pipe, assigning the specified pipe size to the storage buffer. CreatePipe also creates handles that the process uses to read from and write to the buffer in subsequent calls to the ReadFile and WriteFile functions.
To read from the pipe, a process uses the read handle in a call to the ReadFile function. ReadFile returns when one of the following is true: a write operation completes on the write end of the pipe, the number of bytes requested has been read, or an error occurs.