?
Solved

Named Pipes

Posted on 2010-08-17
10
Medium Priority
?
1,108 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
The Ideal Solution for Multi-Display Applications

Check out ATEN’s VS1912 12-Port DP Video Wall Media Player at InfoComm 2017. Kerri describes how easy it is to design creative video walls in asymmetric layouts and schedule detailed playlists ahead of time with its advanced scheduling feature.

 
LVL 33

Expert Comment

by:digitap
ID: 33686996
What version of OS is the server?
0
 
LVL 42

Accepted Solution

by:
Adam Brown earned 2000 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:David
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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

Determining the an SCCM package name from the Package ID
Windows 10 Creator Update has just been released and I have it working very well on my laptop. Read below for issues, fixes and ideas.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Suggested Courses

800 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