title: PIP installed pywin32 service fails: Incorrect function
body: <p>Running Python 3.6.5, PyWin32 223.<br>
  After install I have included the the C:\Python32\lib\win32 folder in path.</p>
  
  <p>I am just running the normal testService shell that seems to be all over the internet.  Can be found below.</p>
  
  <pre><code>import win32serviceutil
  import win32service
  import win32event
  import servicemanager
  import socket
  
  
  class AppServerSvc (win32serviceutil.ServiceFramework):
      _svc_name_ = "TestService"
      _svc_display_name_ = "Test Service"
  
      def __init__(self,args):
          win32serviceutil.ServiceFramework.__init__(self,args)
          self.hWaitStop = win32event.CreateEvent(None,0,0,None)
          socket.setdefaulttimeout(60)
  
      def SvcStop(self):
          self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
          win32event.SetEvent(self.hWaitStop)
  
      def SvcDoRun(self):
          servicemanager.LogMsg(servicemanager.EVENTLOG_INFORMATION_TYPE,
                                servicemanager.PYS_SERVICE_STARTED,
                                (self._svc_name_,''))
          self.main()
  
      def main(self):
          pass
  
  if __name__ == '__main__':
      win32serviceutil.HandleCommandLine(AppServerSvc)
  </code></pre>
  
  <p>I can "compile" and install the service fine, as soon as I run it I get an error to check the system logs.  When I do I get the following error.</p>
  
  <blockquote>
    <p>The Test Service Process service terminated with the service-specific error Incorrect function..</p>
  </blockquote>
  
  <p>I have not been able to find any help through google from this decade.  I am new to the library and the only help I found was to add its lib to the path.  If its a path error, its no longer that.  Anyone have any ideas?</p>
  
  <p>Thanks in advance!</p>