mirror of
https://github.com/reactos/reactos.git
synced 2024-11-18 21:13:52 +00:00
[UMPNPMGR] Install drivers for all devices available on boot
Don't wait for their events to appear, just retrieve the list and install drivers. This fixes the installation of manually reported device nodes CORE-17212 CORE-17398
This commit is contained in:
parent
0fed07b7e4
commit
420c4a7abf
1 changed files with 53 additions and 2 deletions
|
@ -358,13 +358,64 @@ DeviceInstallThread(LPVOID lpParameter)
|
|||
{
|
||||
PLIST_ENTRY ListEntry;
|
||||
DeviceInstallParams* Params;
|
||||
BOOL showWizard;
|
||||
|
||||
UNREFERENCED_PARAMETER(lpParameter);
|
||||
|
||||
// Step 1: install all drivers which were configured during the boot
|
||||
|
||||
DPRINT("Step 1: Installing devices configured during the boot\n");
|
||||
|
||||
PWSTR deviceList;
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
UINT32 devListSize;
|
||||
DWORD status = PNP_GetDeviceListSize(NULL, NULL, &devListSize, 0);
|
||||
if (status != CR_SUCCESS)
|
||||
{
|
||||
goto Step2;
|
||||
}
|
||||
|
||||
deviceList = HeapAlloc(GetProcessHeap(), 0, devListSize * sizeof(WCHAR));
|
||||
if (!deviceList)
|
||||
{
|
||||
goto Step2;
|
||||
}
|
||||
|
||||
status = PNP_GetDeviceList(NULL, NULL, deviceList, &devListSize, 0);
|
||||
if (status == CR_BUFFER_SMALL)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, deviceList);
|
||||
}
|
||||
else if (status != CR_SUCCESS)
|
||||
{
|
||||
DPRINT1("PNP_GetDeviceList failed with error %u\n", status);
|
||||
goto Cleanup;
|
||||
}
|
||||
else // status == CR_SUCCESS
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (PWSTR currentDev = deviceList;
|
||||
currentDev[0] != UNICODE_NULL;
|
||||
currentDev += lstrlenW(currentDev) + 1)
|
||||
{
|
||||
InstallDevice(currentDev, FALSE);
|
||||
}
|
||||
|
||||
Cleanup:
|
||||
HeapFree(GetProcessHeap(), 0, deviceList);
|
||||
|
||||
// Step 2: start the wait-loop for newly added devices
|
||||
Step2:
|
||||
|
||||
DPRINT("Step 2: Starting the wait-loop\n");
|
||||
|
||||
WaitForSingleObject(hInstallEvent, INFINITE);
|
||||
|
||||
showWizard = !SetupIsActive() && !IsConsoleBoot();
|
||||
BOOL showWizard = !SetupIsActive() && !IsConsoleBoot();
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue