Named Pipes

I use a named pipe server to communicate from a printer port monitor to the user.  This works fine when the pipe server and client are on the same PC.  When I try to use this across a network the following code


returns Error 5 'Access denied'

The same pipe server is running on all PCs.  The only difference is the inclusion of the server name or IP address in the pipe name.

LPSTR lpPipeName="\\\\.\\pipe\\TestPipe"      for the local machine is OK

LPSTR lpPipeName="\\\\\\pipe\\TestPipe"  fails (unless ip is ip of the local machine)

OSs are a mixture of Windows 7 and XP

Programming in C++

I guess it is a security problem but I can't find any useful info on this.

Who is Participating?
Adam BrownConnect With a Mentor Sr Solutions ArchitectCommented:
There are two security settings in Group Policy that can govern the operation of named pipe usage in Windows. Check the computer you're trying to connect to under gpedit.msc and check the settings for computer configuration\windows settings\security settings\local policies\security options. The settings to check are Network access: Named Pipes that can be accessed anonymously and Network access: Restrict anonymous access to Named Pipes and Shares. If the latter is enabled, you'll want to make sure that the named pipe you are attempting to work with is listed in the first policy. If it isn't, add it using a GPO.
Meir RivkinFull stack Software EngineerCommented:
try disable UAC in the remote machine, see if it solves he problem.
Make sure a password isn't required to access the printer's host-computer's resources (such as the printer itself) unless you've included a function to automatically input any required network username/password combination ...
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

PeterC_UKDirectorAuthor Commented:
Thanks but...

Same issue with XP so not UAC

Client PC (which is running named pipe server) can print to the network printer on the server.  It is named pipe from server back to PC that receives Access Denied.  The server can access resources on client PC without a problem.

What version of OS is the server?
Had somewhat similar thing happen with security problems, found if I just copied the executable into the \windows\system32 directory, it worked.  Never looked into the specifics of why, but it did solve the problem.
PeterC_UKDirectorAuthor Commented:
Hi diqitap

Currently testing on peer to peer - mix of windws 7 and XP

PeterC_UKDirectorAuthor Commented:
Many thanks,  All solved.  This had been a nagging issue for some time and then became urgent
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.