Click to See Complete Forum and Search --> : what does ERROR_IO_PENDING means?


venAdder
December 9th, 2004, 02:37 PM
I get this error a lot while trying to start and stop a windows service.

What does this mean and how to prevent it?

This error is in system error codes on msdn with error code 997

Andreas Masur
December 9th, 2004, 03:05 PM
Well..which function does return this error?

Gyannea
December 9th, 2004, 03:36 PM
It often means that an overlapped write or read operation has not completed. It is usually not an error per se when you are using asynchronous reads and writes of files (or in my case serial ports). It simply means that the WriteFile or ReadFile has been called and the operation returns without finishing the task. That is what you want; the task goes on in the background while you do something else. When the operation is completed a WaitOnXXXEvent() type function is called and then you do whatever needs to be done.

venAdder
December 9th, 2004, 04:14 PM
The functions returning this are
::StartService and ::StopService in services API.

I try to dc all conenctions from a DB before restoring. One of these conenctions is a custom service. So whever i try to stop it and start it I get this error.

Also When i try to schedule automatic backups, i check wether SQl Server Agent is running or not. If not is start it. I get this when starting SQL Server Agent too.

Is there a way I can prevent this error or atleast wait till the service in question is finished doing what it is doing(unless it's forever );

What I don't understand is why will starting a service will be a problem, sicne it's stopped so there should be no IO concerning it?

Thanks for your answers

Gyannea
December 9th, 2004, 07:28 PM
I can't help you there; I only know what the error is from my own experiences with programming overlapped I/O. I have never even heard of the items you are talking about. Maybe you should show some code (if you are coding). Without any code, there is no way (I) can say anything.

Brian

venAdder
December 9th, 2004, 09:38 PM
It's like this in simple terms.

There is a windows service called SQL Server Agent.

What I am trying to do is before I do whatever I do I want to make sure this service is running. I check if it's running. If it's not I configure it using
ChangeServiceConfig function in windows services api to start in automatic mode.

Everything goes fine to thsi point.

Then i start the service by using StartService function in same API.

But it returns often that the error overlapped io in progress ( description for code ERROR_IO_PENDING).

I think I migth ahve solved the problem though. I will get back with code if it still persists with the error.

Thanks for your help.

tholz
November 23rd, 2008, 07:09 AM
I'm having a problem where NetShareAddEx returns 5 (Access Denied) and GetLastError returns
ERROR_IO_PENDING.

Now what does that mean? Is it really an access denied problem or is there some other operation pending? (This isn't happening on my computer, so it's not easy for me to debug...)

Thanks!
__________________________________________
Boilerplate texts in Outlook (http://www.replybutler.com/en/produkte/replybutler.php)