This post originated from an RSS feed registered with Ruby Buzz
by Daniel Berger.
Original Post: Norton (Anti) Virus and win32-service
Feed Title: Testing 1,2,3...
Feed URL: http://djberg96.livejournal.com/data/rss
Feed Description: A blog on Ruby and other stuff.
This Christmas I decided to help my dad solve a problem where his Windows XP desktop was taking over 30 minutes to boot. I kid you not. The culprit was, of course, Norton Antivirus. My dad has worked with computers a long time, so he had become loyal to Norton in the past. Unfortunately, his brand loyalty had blinded him to the fact that Norton, once a solid product, was now a steaming pile of crap.
So, my mission was to install NAV, which was no easy task. In fact, it was so difficult I never actually succeeded in completely uninstalling it. Most of the files are gone now (I think), but the services are there, though disabled. The boot time is much better now. :)
Anyway, during the (several) attempts to get the damned thing uninstalled I decided to use our win32-service library to list all the NAV related services. I was convinced that the initial attempt to uninstall NAV had failed because it wasn't shutting down its own services first. On that count I was partially correct.
It was at this point where I discovered an interesting bug. It seems the initial uninstall attempt had removed the registry entries for the services, but not the service itself. That caused the QueryServiceConfig() function within win32-service to choke with a 'file not found' error. The fix I added is to explicitly check for an ERROR_FILE_NOT_FOUND, set most of the ServiceInfo struct members to nil and issue a warning.