hPipe = CreateNamedPipe(
lpszPipename,
PIPE_ACCESS_DUPLEX,
PIPE_TYPE_MESSAGE |
PIPE_READMODE_MESSAGE |
PIPE_WAIT,
PIPE_UNLIMITED_INSTANCES,
100,
100,
0,
NULL);
DWORD totalBytesAvailable;
PeekNamedPipe(
hPipe ,
NULL,
0,
NULL,
&totalBytesAvailable,
NULL
);
if(totalBytesAvailable allows)
WriteFile( tmp_pipe, pBuffer, BufferLen, &dwWritten, NULL );
As you can see, I used PeekNamedPipeto get the available space, but it turns out that totalBytesAvailablealways 0, how to do it right?
source
share