Solved

Named Pipes

Posted on 2010-08-17
10
1,092 Views
Last Modified: 2012-05-10
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

hPipe=CreateFile(lpPipeName,GENERIC_READ|GENERIC_WRITE,0,NULL,
                      OPEN_EXISTING,0,NULL);

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="\\\\192.168.1.25\\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.

Peter
0
Comment
Question by:PeterC_UK
10 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 33454630
try disable UAC in the remote machine, see if it solves he problem.
0
 
LVL 5

Expert Comment

by:truromeo4juliet
ID: 33454737
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 ...
0
 

Author Comment

by:PeterC_UK
ID: 33455650
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.

Peter
0
 
LVL 33

Expert Comment

by:digitap
ID: 33686996
What version of OS is the server?
0
Do email signature updates give you a headache?

Constantly trying to correctly format email signatures? Spending all of your time at every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today!

 
LVL 38

Accepted Solution

by:
Adam Brown earned 500 total points
ID: 33687075
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.
0
 
LVL 47

Expert Comment

by:dlethe
ID: 33687208
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.
0
 

Author Comment

by:PeterC_UK
ID: 33689475
Hi diqitap

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

Peter
0
 

Author Closing Comment

by:PeterC_UK
ID: 33689481
Many thanks,  All solved.  This had been a nagging issue for some time and then became urgent
0

Featured Post

Do email signature updates give you a headache?

Do you feel like all of your time is spent managing email signatures? Too busy to visit every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today!

Join & Write a Comment

Suggested Solutions

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now