Overlapped problem with CreateNamedPipe in NT Service

L

Lewap

Hi!

I have a problem:
Function CreateNamedPipe (a piece of source below) called in a NT service I
get an error 997 - Overlapped I/O operation is in progress.

When I run the same code as oridinal application (not NT service) everything
works properly.

Service is develop in Managed/Unmanaged C++ (.NET Environment). And is
runing on LocalSystem account so I think it is not problem with privileges

<code>
LPTSTR lpszPipename = (LPTSTR) \\\\.\\pipe\\testpipe;

hPipe = CreateNamedPipe(

lpszPipename, // pipe name

PIPE_ACCESS_DUPLEX | // read/write access

FILE_FLAG_OVERLAPPED,

PIPE_TYPE_MESSAGE | // message type pipe

PIPE_READMODE_MESSAGE | // message-read mode

PIPE_WAIT, // blocking mode

1, // number of instances (max. instances - PIPE_UNLIMITED_INSTANCES)

BUFSIZE, // output buffer size

BUFSIZE, // input buffer size

PIPE_TIMEOUT, // client time-out

NULL);

if (hPipe == INVALID_HANDLE_VALUE) {

log->WriteEntry("Error creating pipe!", EventLogEntryType::Error);

err = __box(GetLastError());

logEntry = String::Format("Last error: {0}", err);

log->WriteEntry(logEntry);

}

else {

log->WriteEntry("Success creating pipe!");

}

CloseHandle(hPipe);

<code>

Thanks in advance for any help or suggestions

Best regards
Pawel.
 

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,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top