mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 14:53:09 +00:00
[SYSSETUP]
SC Manager needs SC_MANAGER_ENUMERATE_SERVICE access right to be able to open a service Add debug prints to help tracking down the "EnableUserModePnpManager()" issue svn path=/trunk/; revision=50609
This commit is contained in:
parent
32bd053438
commit
0b0d97cc92
1 changed files with 13 additions and 1 deletions
|
@ -477,15 +477,21 @@ EnableUserModePnpManager(VOID)
|
||||||
SC_HANDLE hService = NULL;
|
SC_HANDLE hService = NULL;
|
||||||
BOOL ret = FALSE;
|
BOOL ret = FALSE;
|
||||||
|
|
||||||
hSCManager = OpenSCManager(NULL, NULL, 0);
|
hSCManager = OpenSCManagerW(NULL, NULL, SC_MANAGER_ENUMERATE_SERVICE);
|
||||||
if (hSCManager == NULL)
|
if (hSCManager == NULL)
|
||||||
|
{
|
||||||
|
DPRINT1("Unable to open the service control manager.\n");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
hService = OpenServiceW(hSCManager,
|
hService = OpenServiceW(hSCManager,
|
||||||
L"PlugPlay",
|
L"PlugPlay",
|
||||||
SERVICE_CHANGE_CONFIG | SERVICE_START);
|
SERVICE_CHANGE_CONFIG | SERVICE_START);
|
||||||
if (hService == NULL)
|
if (hService == NULL)
|
||||||
|
{
|
||||||
|
DPRINT1("Unable to open PlugPlay service\n");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
ret = ChangeServiceConfigW(hService,
|
ret = ChangeServiceConfigW(hService,
|
||||||
SERVICE_NO_CHANGE,
|
SERVICE_NO_CHANGE,
|
||||||
|
@ -494,11 +500,17 @@ EnableUserModePnpManager(VOID)
|
||||||
NULL, NULL, NULL,
|
NULL, NULL, NULL,
|
||||||
NULL, NULL, NULL, NULL);
|
NULL, NULL, NULL, NULL);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
|
{
|
||||||
|
DPRINT1("Unable to change the service configuration\n");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
ret = StartServiceW(hService, 0, NULL);
|
ret = StartServiceW(hService, 0, NULL);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
|
{
|
||||||
|
DPRINT("Unable to start service\n");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue