Hi Rick,
I found the following on MSDN: Is this what you are talking about? (http://msdn2.microsoft.com/en-us/library/ms682075.aspx)
However, the
SetStdHandle
function can redirect the standard handles by changing the handle
associated with STDIN, STDOUT, or STDERR. Because the parent's standard
handles are inherited by any child process, subsequent calls to GetStdHandle return the redirected handle. A handle returned by
GetStdHandle may, therefore, refer to something other than
console I/O. For example, before creating a child process, a parent
process can use SetStdHandle to set a pipe handle to be the STDIN handle that is inherited by the child process
If this is correct, can I use this HANDLE I received from GetStdHandle() to look up the named pipe?
Again, this is what I found on MSDN: (http://msdn2.microsoft.com/en-us/library/aa365592.aspx)
A named pipe client uses the
CreateFile function to open a handle to a named pipe...
The handle returned by CreateFile defaults to byte-read mode, blocking-wait mode, overlapped mode disabled, and write-through mode disabled...
The client can use the
SetNamedPipeHandleState
function to enable nonblocking mode by specifying PIPE_NOWAIT or to
enable message-read mode by specifying PIPE_READMODE_MESSAGE...
So, the way I understand this is that I would not need to call CreateFile() (the FastCGI server would have done that, right?) The HANDLE I would have received from GetStdHandle() would in effect be the handle you would get if you called CreateFile()?
I might possibly have to call SetNamedPipeHandleStates()?
I would then be able to ReadFile() and WriteFile() using this handle?
I am sorry that I am pestering you with so much questions, but my own C++ career stopped before it got to this level.
Regards,
Pieter