How to turn off Named Pipe security?
<p>I'm trying to create a named pipe between two Windows processes. The server process runs under a normal account, in a UI session. The client process runs in an unknown security context, apparently rather restricted.</p>

<p>Initially I called </p>

<pre><code>pipe = CreateNamedPipeA(MY_PIPE_NAME, PIPE_ACCESS_DUPLEX,
        PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE, maxClients,
                     pipeChunkSize, pipeChunkSize, 0, nullptr); 
</code></pre>

<p>I.e. leave pass no <code>SECURITY_ATTRIBUTES</code>. Usually, this works - no security means no security. Apparently, this is no longer the case for named pips. The caller tried </p>

<pre><code>CreateFileA(MY_PIPE_NAME, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0);
</code></pre>

<p>and got back a <code>GetLastError=5</code>, access denied. Testing showed that this was due to a security failure; the exact same line would succeed if the client executable was run from a test environment in the same UI session as the server.</p>

<p>The logical solution would be to set the DACL to <code>SECURITY_WORLD_SID_AUTHORITY, KEY_ALL_ACCESS</code> (S-1-1-0) in the <code>SECURITY_ATTRIBUTES</code> used for <code>CreateNamedPipeA</code>. This didn't fix the problem. </p>

<p>The only security downgrade left from "everybody can do everything"  would be "no security whatsoever". What do I have to do in <code>CreateNamedPipe</code> so that <code>CreateFileA</code> <em>never</em> fails with an Access Denied?</p>

<p><sub>Security is pretty irrelevant here. <code>PIPE_TYPE_MESSAGE</code> and <code>pipeChunkSize</code> already mean that the server is safe against buffer overflows by rogue clients. </sub></p>