This is actually a Vista+ function, but we need it enable umpnpmgr.dll to notify services of device events. Up until WinXP it was possible to make direct calls to the service manager by umpnpmgr.dll because umpnpmgr.dll was loaded into the service manager process. From Vista onwards umpnpmgr.dll is run as a separate service host process. And since ReactOS always ran umpnpmgr.dll as a separate process, we have to use the Vista RPC functions to notify services.
Partial revert of 0.4.15-dev-4274-g d31a557237
As hbelusca explained the special character will warn only
once for each non-UTF8-file and not every time, unlike I anticipated.
The g_dwServiceBits is not important right now, but hpoussin expects it
to be a preparation step for making the stuff passed to the
function SetServiceBits() persistent
https://docs.microsoft.com/en-us/windows/win32/api/lmserver/nf-lmserver-setservicebits
for (yet unknown) features to come.
Fixes some typos like "alread"->"already"
and kill g_dwServiceBits in rpcserver.cpp
and omit points and exclamation marks at end of prints.
On GCC8.4.0dbg RosBE2.2.1 this shrinks the file for me from 210.432 to 209.920
The file is loaded many times into memory, therefore
optimization pays off here at runtime memory consumption.
Also shorten to H. Poussineau in the header sections,
to stop git from displaying diff in that line on each review
due to that special char.
- Add a function that creates a new control set and deletes unused control sets in case of a successful boot.
- Add a stub function that will soon switch to the last known good control set in case of an unsuccessful boot.
Also comment about the observed behaviour of the returned number of "characters"
returned by the ANSI versions of these APIs (which is tested by advapi32_winetest:service).
[ADVAPI32:SCM] Add a comment concerning wide characters vs. bytes mismatch.
- RI_ScSetServiceBitsA: Just call RI_ScSetServiceBitsW.
- RI_ScSetServiceBitsW: Store the service bits in the service list entry.
TODO: Merge all service bits in a global variable and pass it to the server service. Maybe use netapi.I_NetServerSetServiceBits(Ex)?
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
- The initial dwWin32ExitCode for a disabled service is ERROR_SERVICE_DISABLED and ERROR_SRVICE_NEVER_STARTED for non-disabled services.
- The initial dwWaitHint is 2000 (2 seconds) for (user-mode) services and 0 for drivers.
- Move all driver-related code to driver.c.