Access Denied Problem Help!!!

F

Franco Gustavo

Hi,

I have a process running on background listening in Named Pipe.

Now from my Web Service I'm trying to send and get information through this
pipe, When I make the call to "CallNamedPipe" inside the Web Method I
receive that the function fail. Calling GetLastError() it returns 5 ("Access
is Denied").

What do I have to do to give permission to ASP.NET to execute CallNamedPipe
function?

Thanks.

This is the code:

private string szServerPipe = "\\\\.\\pipe\\Listener1";

public int Test()
{
SendData("TEST");
return 0;
}

private unsafe void SendData(string data)
{
const int BUFSIZE = 60000;
byte[] chRequest = new byte[BUFSIZE];
int cbBytesRead = 0;
bool bResult = false;
int iResult = 0;

fixed (byte* lpchRequest = chRequest)
fixed (char* lpData = data)
{
//Send Document to ReadPipe Process
bResult = CallNamedPipe(szServerPipe,
lpData,
data.Length,
lpchRequest,
BUFSIZE,
&cbBytesRead,
NMPWAIT_NOWAIT);
}

iResult = GetLastError();

Console.WriteLine(iResult);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top