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.
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.