[SERVICES][ADVAPI32] Fix the broken service stop sequence
authorEric Kohl <eric.kohl@reactos.org>
Sat, 24 Feb 2018 10:14:05 +0000 (11:14 +0100)
committerEric Kohl <eric.kohl@reactos.org>
Sat, 24 Feb 2018 10:14:05 +0000 (11:14 +0100)
commit1dfbed9c3dbd135c7bf51090b9cadde6d2642340
tree9c898b6159612eca2c1074b85608a1edf1badade
parentb6c060ce04be831efa7f1b9f39c29836f45650a3
[SERVICES][ADVAPI32] Fix the broken service stop sequence

services\database.c:
- Refactor ScmControlService() so that it can be used to send the dispatcher loop stop command.
- Separate the code to decrement the image run counter from the service image cleanup code.

services\rpcserver.c:
- RSetServiceStatus(): Stop the dispatcher loop when the image run counter is zero and remove the service image after that.

advapi32\service\sctrl.c:
- Do not terminate the service dispatcher loop when the last service is being stopped. Wait for an explicit dispatcher stop command (empty service name).

CORE-12413
base/system/services/database.c
base/system/services/rpcserver.c
base/system/services/services.h
dll/win32/advapi32/service/sctrl.c