Pipes won't work with limited accounts

I am using Named Pipes to commmunicate between a Windows Service and one or more client applications (depending on the number of users logged in).

Everything works fine if the client app runs under a user with administrator rights.

When it runs under a limited user account I get the ERROR_ACCESS_DENIED message when the client is trying to connect to the Pipe Server (created by the service).

This is the code section generating the error message:

hPipe =Win32API.CreateFile(

pipeName,// pipe name

GENERIC_READ |// read and write access

GENERIC_WRITE,

0,// no sharing

IntPtr.Zero,// default security attributes

OPEN_EXISTING,// opens existing pipe

0,// default attributes

IntPtr.Zero);

I suspect that I have to supply a structure to thelpSecurityAttributesargument specifying a security descriptor, but I don't know how that would look like in code.

Can someone shed some light on this issue? Preferably with a short example in code.

Thanks

[1601 byte] By [MatchBrace] at [2007-12-29]
# 1

Been awhile since I messed with named pipes, but you may have to use impersonation to open the pipe with a limited account. If I read your message right then the service and the client are running locally. The client is running under a limited account, and the service is probably running under the system or localservice account. Here is an MSDN article giving an overview.

http://msdn2.microsoft.com/en-us/library/aa378832.aspx

MarkBetz at 2007-9-4 > top of Msdn Tech,Software Development for Windows Vista,Windows SDK...

Software Development for Windows Vista

Site Classified