Re: Vista IPC using named pipes - ERROR_ACCESS_DENIED



"John Bigbooty" <BOGUSevileye0702BOGUS@xxxxxxxxxxxxxxxxxx> wrote in message
news:461a6f7a.7281421@xxxxxxxxxxxxxxxxxxxxx
The problem is when I attempt to open the pipe in the UI application,
I get ERROR_ACCESS_DENIED.

By default, when you create a pipe it is accessible only by other
applications running under the same user account. My guess is that your
service runs as local system while the application with the user interface
runs as the logged on user.

If you are willing to open up access to your pipe to all clients, you can do
something like this:

// I didn't compile this, beware or typos, etc

BYTE sd[SECURITY_DESCRIPTOR_MIN_LENGTH];
SECURITY_ATTRIBUTES sa;

sa.nLength = sizeof(sa);
sa.bInheritHandle = TRUE;
sa.lpSecurityDescriptor = &sd;

InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION);
SetSecurityDescriptorDacl(&sd, TRUE, (PACL) 0, FALSE);

CreateNamedPipe(..., &sa);

Alternatively, you can restrict access to the accounts you favor.

Regards,
Will


.