Pausing a NOT_PAUSABLE service, pausing a not pausable service from the command line or code

Posted on

Pausing a NOT_PAUSABLE service, pausing a not pausable service from the command line or code – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about windows, service, drivers, , .

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
WIN32_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++)


Solution :

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).

Leave a Reply

Your email address will not be published.