I noticed that WCF's named pipe address
net.pipe://localhost/mynamedpipe
and Windows API's
\\.\pipe\mynamedpipe
don't collide. Why is that? How can I make them point to the same pipe?
I noticed that WCF's named pipe address
net.pipe://localhost/mynamedpipe
and Windows API's
\\.\pipe\mynamedpipe
don't collide. Why is that? How can I make them point to the same pipe?
Linking native and WCF pipes is not possible according to this from Stephen Cleary. This makes sense, given the context of disjoint pipe namespaces for WCF and Win32.
If you just need to know the pipename, you may be able to work this out (by elimination?) using pipelist from Sysinternals. I imagine that under the WCF covers there lurks a native named pipe...
There is no documented way of doing that. After a few tests I came to the following conclusions:
If you have a WCF server and a Win32 C++ client, the last one will see the first one address as a UUID in the following format:
12345678-1234-1234-1234-123456789abc
And this UUID seems random, since it changes for the same WCF address every time the server is started.
I don't know if a Win32 C++ named pipe server with a GUID format address will be visible from a WCF client, but I'm sure that if it does, the server will have to implement the poorly documented protocol used by WCF.
The documentation for such protocol is provided as an answer to my previous question on this subject.
EDIT Further research revealed that the pipe address is stored in the FileMapping. This entry address in its turn is a base64 encoded hash of a normalized version of the NetNamedPipe address.
See here for some detail I discovered on this while trying to do something similar.
You can't control the WCF end of the pipe (well, not without throwing away netNamedPipeBinding and creating your own named pipe transport instead)... but you can locate and open the WCF pipe from native code if you're prepared to work at it.