Solved

Named Pipes

Posted on 2010-08-17
10
1,094 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
Want to promote your upcoming event?

Are you going to an event? Are you going to be exhibiting at a tradeshow? Talking at a conference? Using a promotional banner in your email signature ensures that your organization’s most important contacts stay in the know and can potentially spread the word about the event.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
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…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

919 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

20 Experts available now in Live!

Get 1:1 Help Now