Uploaded image for project: 'Core ReactOS'
  1. Core ReactOS
  2. CORE-5372

PATCH: syssetup: livecd + qemu boot crash or no response

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • None
    • Setup
    • 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)

      { DPRINT1("Unable to open the service control manager.\n"); goto cleanup; }

      hService = OpenServiceW(hSCManager,
      L"PlugPlay",
      SERVICE_CHANGE_CONFIG | SERVICE_START);
      if (hService == NULL)

      { DPRINT1("Unable to open PlugPlay service\n"); goto cleanup; }

      ret = ChangeServiceConfigW(hService,
      SERVICE_NO_CHANGE,
      SERVICE_AUTO_START,
      SERVICE_NO_CHANGE,
      NULL, NULL, NULL,
      NULL, NULL, NULL, NULL);
      if (!ret)

      { DPRINT1("Unable to change the service configuration\n"); goto cleanup; }

      ret = StartServiceW(hService, 0, NULL);
      if (!ret)

      { DPRINT1("Unable to start service\n"); goto cleanup; }

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

      { DPRINT1("Could not open service category: %s\n", ServiceCategory); return 0; }

      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.

      Attachments

        1. patch.patch
          1 kB
        2. patch.patch
          4 kB
        3. roslog.7z
          6 kB

        Issue Links

          Activity

            People

              bug zilla Bug Zilla
              hzlilx hzlilx
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: