none
Windows XP Control Service Function RRS feed

  • Question

  • I work for a company that developed and maintains a set top box tester.  Part of the test system is a video frame grabber installed in a PCIx slot on a PC.  This frame grabber periodically locks up and currently the only way to get it working again is to reboot the PC (using Windows XP).  I was tasked with finding a way to unload and reload the driver without rebooting the PC.  I was trying to stop the driver using the service API but running service_control_stop via the control service function always returns 1052 - The requested control is not valid for this service.  I've also tried running the command line stop with the same result.  A query of the service returns:

    SERVICE_NAME:  dpdm642
            TYPE:              : 1  KERNEL_DRIVER
            STATE              : 4  RUNNING
                                    (STOPPABLE,NOT_PAUSABLE,IGNORES_SHUTDOWN)
            WIN32_EXIT_CODE    : 0  (0x0)
            SERVICE_EXIT_CODE  : 0  (0x0)
            CHECKPOINT         : 0x0
            WAIT_HINT          : 0x0

    I don't know the details of the driver but I've contacted the manufacturer of the frame grabber to see if they can help.  I'm still waiting for a reply.  I'm just wondering if anyone would know if it is even possible to use the sc manager to stop a service that was started by windows?  I've read conflicting information I gathered via Google.  The DeleteService function works but requires a reboot.  Maybe it is impossible to know for sure without knowing the details of the driver.

      

           

    Tuesday, March 19, 2013 9:14 PM

Answers

  • Your problem is using the service API.  This is a Plug and Play driver so you cannot do it that way.  You need to look at the Devcon sample in the WDK and see how it stops a driver.   Devcon is the same model as using the Device Manager GUI to control the device.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Tuesday, March 19, 2013 9:23 PM

All replies

  • Your problem is using the service API.  This is a Plug and Play driver so you cannot do it that way.  You need to look at the Devcon sample in the WDK and see how it stops a driver.   Devcon is the same model as using the Device Manager GUI to control the device.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Tuesday, March 19, 2013 9:23 PM
  • Okay, thanks.  I'll take a look.
    Tuesday, March 19, 2013 9:26 PM