Link to home
Start Free TrialLog in
Avatar of PeterC_UK
PeterC_UKFlag for United Kingdom of Great Britain and Northern Ireland

asked on

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

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
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

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 ...
Avatar of PeterC_UK

ASKER

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
What version of OS is the server?
ASKER CERTIFIED SOLUTION
Avatar of Adam Brown
Adam Brown
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Hi diqitap

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

Peter
Many thanks,  All solved.  This had been a nagging issue for some time and then became urgent