473,396 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Overlapped problem with CreateNamedPipe in NT Service

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.
Nov 17 '05 #1
4 4304
"Lewap" <pa*************@nospam.primesoft.pl> wrote in message
news:cr**********@nemesis.news.tpi.pl...
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.


Instead of this

if (hPipe == INVALID_HANDLE_VALUE) {
log->WriteEntry("Error creating pipe!", EventLogEntryType::Error);
err = __box(GetLastError());

try this

if (hPipe == INVALID_HANDLE_VALUE) {
err = __box(GetLastError());
log->WriteEntry("Error creating pipe!", EventLogEntryType::Error);

Note that a thread saves only its _last_ error.

Regards,
Will

Nov 17 '05 #2
Użytkownik "William DePalo [MVP VC++]" <wi***********@mvps.org> wrote in
message
Instead of this

if (hPipe == INVALID_HANDLE_VALUE) {
log->WriteEntry("Error creating pipe!", EventLogEntryType::Error);
err = __box(GetLastError());

try this

if (hPipe == INVALID_HANDLE_VALUE) {
err = __box(GetLastError());
log->WriteEntry("Error creating pipe!", EventLogEntryType::Error);

Note that a thread saves only its _last_ error.


Thank's a lot! In fact that error was caused by another error appear
earlier - 123 "The file name, directory name, or volume label syntax is
incorrect." So, name of named pipe is wrong, I suppose.

Best regards
Pawel.
Nov 17 '05 #3
"Lewap" <pa*************@nospam.primesoft.pl> wrote in message
news:cr**********@atlantis.news.tpi.pl...
Thank's a lot!
You are welcome.
In fact that error was caused by another error appear
earlier - 123 "The file name, directory name, or volume
label syntax is incorrect." So, name of named pipe is
wrong, I suppose.


This is from the docs on pipe names:

<quote>
The pipename part of the name can include any character
other than a backslash, including numbers and special
characters. The entire pipe name string can be up to 256
characters long. Pipe names are not case sensitive.

Windows Me/98/95: Pipe names cannot include a colon.
Therefore, if this pipe will be used from a Windows Me/98/95
client, do not include a colon in the name.
</quote>

Please post any follow-up in the kernel group.

Regards,
Will
Nov 17 '05 #4
The problem was that I've used wrong conversion for name of pipe. I wrote:

LPTSTR lpszPipename = (LPTSTR) "\\\\.\\pipe\\testpipe";

and should be:

LPTSTR lpszPipename = _T("\\\\.\\pipe\\testpipe");

and now everything works fine.

Thanks again!

Best regards,
Pawel.
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: yamadora1999 | last post by:
hi :) http://groups.google.com/groups?q=author:dmost%40magna.com.au&hl=ko&lr=&ie=UTF-8&selm=8pguo8%24bbl%241%40nnrp1.deja.com&rnum=3 GetQueuedCompletionStatus is return new OVERLAPPED yet. i...
1
by: Lewap | last post by:
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...
2
by: CeZaR | last post by:
Hi, What does the "overlapped" word means in windows programming? I've read about overlapped structures, functions?! What does it mean? Thanks!
4
by: Afterburn | last post by:
Hi, Has anyone ever experienced this error occuring when trying to call AddPrinterConnection() from VC6. This is a microsoft defined method call. I have been able to reproduce it on a windows200...
1
by: man-ab | last post by:
This message appears in the visor of events, aplication part. Regards -- man-ab ------------------------------------------------------------------------ Posted via...
0
by: bike_mike | last post by:
I have written a service in VB.NET which goes out and periodically reboots servers on our network based on a set schedule. On occasion, the API throws this error: Overlapped I/O operation is in...
1
by: dvestal | last post by:
I'm trying to use Overlapped I/O from C#, and utterly failing. I've tried to boil down my code to as simple an example as possible, in hopes that you people can point to where I'm going wrong. ...
4
by: Eric Renken | last post by:
I am trying to do an Overlapped ReadFile on a HID device and it just isn't working for me. The WaitForSingleObject keeps giving me an error "The system cannot find the file specified." This...
0
by: Ingenious | last post by:
Hi I am reading data from device in overlapped way. i am able to read the data correctly with WaitforMultipleObject() but now i want to use HasOverlappedIoCompleted () to inceraese the speed...
7
by: =?Utf-8?B?TmljayBCdXJraXR0?= | last post by:
Hi. I have a C# app that uses named pipes via InteropServices. I have no problems running on a 32-bit machine, or when targeting x86 architecture, but it fails on a 64-bit machine when...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.