2

can I somehow list named pipes on remote server from a client application?
On local computer I use

hFindFile = FindFirstFile("\\\\.\\pipe\\*",&fdFileData);

where hFindFile is a handle and fdFileData is WIN32_FIND_DATA struct. I call FindNextFile() repeatedly and when it returns 0 I close with FindClose(). It works perfect on local machine, but when I try call

hFindFile = FindFirstFile("\\\\servername\\pipe\\*",&fdFileData);

it resulted to ERROR_INVALID_FUNCTION. Someone advise me that I need to connect to remote server by WNetUseConnection(), but for me it's not clear what object I have connect to.

  • Wow. Frankly I'm amazed that the first one actually works. I think it might be dangerous to rely on it, though, as it is not documented as supporting pipes. – Luke Feb 09 '11 at 22:36
  • 1
    @Luke: named pipes on Windows are in fact temporary "files" on NPFS filesystem which is mounted to \\.\pipe\ directory. That's why you can use CreateFile() to connect to named pipe in client program. – PanPredseda Feb 14 '11 at 07:54
  • See this http://stackoverflow.com/questions/719353/win32-named-pipes-and-remote-clients – MartyTPS Oct 27 '11 at 04:04

1 Answers1

0

If the other machine is windows, it is often sufficient to map any drive using WNetUseConnection() and gain the credentials you require to connect to other resources (i.e. named pipes).

http://support.microsoft.com/kb/256847

MartyTPS
  • 530
  • 2
  • 5