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 progress.
Which returns a 0 indicating an error and the remote server never
reboots. Sometimes when the tool runs it has no problems, other times
it does. At this point I am thinking that it is a problem with the
remote server which is a W2K machine. Not sure what it could be
though???
I am setting the the DLL call like this:
<DllImport("AdvAPI32.DLL", SetLastError:=True)> _
Public Shared Function InitiateSystemShutdownEx( _
ByVal lpMachineName As String, _
ByVal lpMessage As String, _
ByVal dwTimeout As Int32, _
ByVal bForceAppsClosed As Boolean, _
ByVal bRebootAfterShutdown As Boolean, _
ByVal dwReason As UInt32) As Boolean
End Function
Here is the function call:
Dim InitShutdown As Integer = InitiateSystemShutdownEx( _
_MacName, _
_Message, _
Int32.Parse(_DispMessageTime), _
_ForceClose, _
_BootAfterShutdown, _
Convert.ToUInt32(ReasonMinor.SHTDN_REASON_MINOR_MA INTENANCE))
Any ideas what may cause this?? Could not find much info on this
error...