* DevNotes: Add entry cgf-000005.
* fhandler.h (PIPE_ADD_PID): Redefine to something we actually DON'T use. * pipe.cc (fhandler_pipe::create): Avoid clearing all open_mode bits when checking for PIPE_ADD_PID. Properly keep track of len so that passed in name is not overwritten.
This commit is contained in:
@@ -217,17 +217,17 @@ fhandler_pipe::create (LPSECURITY_ATTRIBUTES sa_ptr, PHANDLE r, PHANDLE w,
|
||||
if (!name)
|
||||
pipe_mode |= pipe_byte ? PIPE_TYPE_BYTE : PIPE_TYPE_MESSAGE;
|
||||
else
|
||||
{
|
||||
strcpy (pipename + len, name);
|
||||
pipe_mode |= PIPE_TYPE_MESSAGE;
|
||||
}
|
||||
pipe_mode |= PIPE_TYPE_MESSAGE;
|
||||
|
||||
if (!name || (open_mode &= PIPE_ADD_PID))
|
||||
if (!name || (open_mode & PIPE_ADD_PID))
|
||||
{
|
||||
len += __small_sprintf (pipename + len, "%u-", GetCurrentProcessId ());
|
||||
open_mode &= ~PIPE_ADD_PID;
|
||||
}
|
||||
|
||||
if (name)
|
||||
len += __small_sprintf (pipename + len, "%s", name);
|
||||
|
||||
open_mode |= PIPE_ACCESS_INBOUND;
|
||||
|
||||
/* Retry CreateNamedPipe as long as the pipe name is in use.
|
||||
|
Reference in New Issue
Block a user