Solved

Named Pipes

Posted on 2010-08-17
10
1,104 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 33

Expert Comment

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

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: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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
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…

724 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