I have tried creating a named pipe but getting GLE 5 (access denied Error)
#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include <tchar.h>
#include "iostream.h"
//#define PIPE_ACCESS_DUPLEX 0x00000003
//#define PIPE_ACCESS_INBOUND 0x00000001
//#define PIPE_ACCESS_OUTBOUND 0x00000002
#define BUFSIZE 512
int main()
{
HANDLE hPipe;
LPTSTR lpszPipename = TEXT("\\\\.\\pipe\\mynamedpipe");
hPipe=CreateNamedPipe(lpszPipename,PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT,PIPE_UNLIMITED_INSTANCES,BUFSIZE,BUFSIZE,0,NULL);
if (hPipe != INVALID_HANDLE_VALUE)
cout<<"Valid";
if (GetLastError() != ERROR_PIPE_BUSY)
{
printf( TEXT("Could not open pipe. GLE=%d\n"), GetLastError() );
return -1;
}
return 0;
}