Details
-
Bug
-
Resolution: Fixed
-
Major
-
None
-
None
-
Operating System: ReactOS
Platform: x86 Hardware
Description
Created an attachment (id=5772)
error log file
I use qemu to boot livecd, sometimes it booted success, and sometimes it showed "EnableUserModePnpManager() failed", and sometimes it got no reponse.
The logs were attached.
In order to show what was the question, I modified a little in two files, first is dll\win32\syssetup\install.c:
static BOOL
EnableUserModePnpManager(VOID)
{
SC_HANDLE hSCManager = NULL;
SC_HANDLE hService = NULL;
BOOL ret = FALSE;
hSCManager = OpenSCManagerW(NULL, NULL, SC_MANAGER_ENUMERATE_SERVICE);
if (hSCManager == NULL)
hService = OpenServiceW(hSCManager,
L"PlugPlay",
SERVICE_CHANGE_CONFIG | SERVICE_START);
if (hService == NULL)
ret = ChangeServiceConfigW(hService,
SERVICE_NO_CHANGE,
SERVICE_AUTO_START,
SERVICE_NO_CHANGE,
NULL, NULL, NULL,
NULL, NULL, NULL, NULL);
if (!ret)
ret = StartServiceW(hService, 0, NULL);
if (!ret)
ret = TRUE;
cleanup:
if (hSCManager != NULL)
CloseServiceHandle(hSCManager);
if (hService != NULL)
CloseServiceHandle(hService);
return ret;
}
the other is dll\win32\advapi32\service\scm.c:
BOOL WINAPI
StartServiceW(SC_HANDLE hService,
DWORD dwNumServiceArgs,
LPCWSTR *lpServiceArgVectors)
{
DWORD dwError;
RpcTryExcept
{ dwError = RStartServiceW((SC_RPC_HANDLE)hService, dwNumServiceArgs, (LPSTRING_PTRSW)lpServiceArgVectors); }RpcExcept(EXCEPTION_EXECUTE_HANDLER)
{ dwError = ScmRpcStatusToWinError(RpcExceptionCode()); }RpcEndExcept;
if (dwError != ERROR_SUCCESS)
{ ERR("RStartServiceW() failed (Error %lu)\n", dwError); SetLastError(dwError); return FALSE; } return TRUE;
}
and something else, if I changed base\services\svchost\svchost.c to:
DWORD LoadServiceCategory(LPCTSTR ServiceCategory)
{
HKEY hServicesKey;
DWORD KeyType;
DWORD BufferSize = REG_MAX_DATA_SIZE;
TCHAR Buffer[REG_MAX_DATA_SIZE];
LPCTSTR ServiceName;
DWORD BufferIndex = 0;
DWORD NrOfServices = 0;
/* Get all the services in this category */
if (ERROR_SUCCESS != RegOpenKeyEx(HKEY_LOCAL_MACHINE, SVCHOST_REG_KEY, 0, KEY_READ, &hServicesKey))
if (ERROR_SUCCESS != RegQueryValueEx(hServicesKey, ServiceCategory, NULL, &KeyType, (LPBYTE)Buffer, &BufferSize))
{ DPRINT1("Could not open service category (2): %s\n", ServiceCategory); RegCloseKey(hServicesKey); return 0; } /* Clean up */
RegCloseKey(hServicesKey);
/* Load services in the category */
ServiceName = Buffer;
while (_T('\0') != ServiceName[0])
{
size_t Length;
Length = _tcslen(ServiceName);
if (0 == Length)
break;
if (strcmp(ServiceName, "DHCP") == 0)
{ BufferIndex += (Length + 1) * sizeof(TCHAR); ServiceName = &Buffer[BufferIndex]; continue; } if (TRUE == PrepareService(ServiceName))
++NrOfServices;
BufferIndex += (Length + 1) * sizeof(TCHAR);
ServiceName = &Buffer[BufferIndex];
}
return NrOfServices;
}
it seems more than 95% it can boot success, but still has some time it boot no response.