views:

28

answers:

2

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?

+2  A: 

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.

All the WCF bindings that start with "Net" are .NET-specific. They use a certain protocol (which is undocumented AFAIK) that may change in the future.

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...

Steve Townsend
I'm not willing to believe in the first part of your answer but after I test the pipelist, as you suggest, I will be able to confirm that.
Jader Dias
@Jader - let me know and I will edit, or you can. Thanks and good luck.
Steve Townsend
@Steve I posted the results as an answer
Jader Dias
+3  A: 

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.

Jader Dias
+1 - nice info, thx
Steve Townsend