0

I'm trying to pause a windows driver that has the NOT_PAUSABLE attribute set. when I send a

sc query ServiceName

the output is as follow:

TYPE               : 110  WIN32_OWN_PROCESS (interactive)
STATE              : 4  RUNNING
                        (NOT_STOPPABLE,NOT_PAUSABLE,ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE    : 0  (0x0)
SERVICE_EXIT_CODE  : 0  (0x0)
CHECKPOINT         : 0x0
WAIT_HINT          : 0x0

Of course when I try to use SC to pause the driver/service I get an error.

Is there any way to pause (or force it to pause) this driver? from the command line? or by code (C or C++)

thanks!

1 Answer 1

0

Pausing a windows service is not like pausing a VM where it's freezing the code execution at a moment in time. A Pause event in a windows service is technically no different than a Start or Stop event. They're all just events passed by the service control manager to the service. Those events need to be coded for by the service writer. If the service doesn't support the Pause event, there's nothing you can do to force it.

Even if you can manage to trick the service control manager to send a pause event to the service, the best case is that the service just ignores the message. The worst case is that the code doesn't know what to do with the event and freaks out in some spectacular way (most likely crashing).

2
  • ok. so basically if it says non stoppable or non pausable then there's nothing I can do. The only way to stop the service is to reboot? Is there a way to disable it?
    – Uri
    Sep 30, 2009 at 17:48
  • Pretty much. If this is a driver service, you can probably set it to disabled in the registry and then it won't startup after a reboot. But once it's running, the only way to stop it is to basically terminate the process. Sep 30, 2009 at 19:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .