Note that there are some explanatory texts on larger screens.

plurals
  1. PONo bytes in named pipe
    primarykey
    data
    text
    <p><strong>Service:</strong> Creates std out,err,in named pipes. Attaches them to a process that it creates.</p> <pre><code>HANDLE hStdOut = CreateNamedPipe(szStdOutPipeName, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE, 1, 100, 100, 15000, pSa); yStartupInfo.hStdOutput = hStdOut; CreateProcessAsUserW( ..., yStartupInfo, ... ); </code></pre> <p>This part works. The created process's output is being redirected into the pipes.</p> <p><strong>Client:</strong> Connection to named pipe, Successful. Check if there are bytes to read with a peek (at this point bytes are pushed into the pipe!). Then read the bytes from the pipe.</p> <pre><code>hStdOutPide = CreateFileW(szPipeNameStdOut, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL ); PeekNamedPipe(hStdOutPide, szBuffer, kunBufferSize, &amp;ulBytesRead, &amp;ulBytesAvailable, &amp;ulRemainingBytes); if( ulBytesAvailable &gt; 0) ReadFile(hStdOutPide, szBuffer, 1000, &amp;ulBytesRead, NULL) </code></pre> <p>I have removed the surrounding code that makes sure the handles are valid and the process is running and so on.</p> <p>The Peek reveals that <code>ulRemainingBytes</code> is <strong>ALWAYS</strong> <code>0</code>. Does anyone see where my error could be? I have been trying to get this to work for some time and don't know what the proper flags for anything is anymore. Please ask if you need more information!</p> <p>Security Attributes in the CreateNamesPipe are generated from a method. It is used in many other places in the code so I do not believe the problem to be there.</p> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload