I've got two processes that need to communicate. One process is a service and the other is a user interface application. According to Microsoft's guidelines for Vista, named pipes should be a viable mechanism for this communication.
The problem is when I attempt to open the pipe in the UI application, I get ERROR_ACCESS_DENIED. I'm doing my testing under Vista Ultimate Edition. The OS installation is fairly vanilla with little changes to defaults. UAC is enabled. The service is running under a user account identical to the logged in user although the problem is identical when the service is running under the system account.
Here's the code I use for creating the named pipe in the service :
CreateNamedPipe("\\\\.\\pipe\\MCMONITORMessSyncPipe", PIPE_ACCESS_INBOUND, PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT,PIPE_UNLIMITED_INSTANCES, 200, 200, NMPWAIT_USE_DEFAULT_WAIT,NULL);
Here's the code I use for opening the named pipe in the UI app :
It is this CreateFile that results in the ERROR_ACCESS_DENIED.
Any ideas what I'm doing wrong. It is obviously something related to UAC because if I run the UI application as an Administrator (not acceptable) or disable UAC (not acceptable) everything works fine.