[UMPNPMGR] PNP_CreateDevInst: Create a device node for the device to be installed

This commit is contained in:
Eric Kohl 2022-04-24 12:56:42 +02:00
parent 969f950bf3
commit 74efe979a8

View file

@ -3056,8 +3056,10 @@ PNP_CreateDevInst(
PNP_RPC_STRING_LEN ulLength,
DWORD ulFlags)
{
PLUGPLAY_CONTROL_DEVICE_CONTROL_DATA ControlData;
HKEY hKey = NULL;
DWORD dwSize, dwPhantom;
NTSTATUS Status;
CONFIGRET ret = CR_SUCCESS;
DPRINT("PNP_CreateDevInst(%p %S %S %lu 0x%08lx)\n",
@ -3115,7 +3117,18 @@ PNP_CreateDevInst(
RegOpenKeyEx(hEnumKey, pszDeviceID, 0, KEY_READ | KEY_WRITE, &hKey);
}
/* If the device instance is a phantom, turn it into an non-phantom */
/* Create a device node for the device */
RtlInitUnicodeString(&ControlData.DeviceInstance, pszDeviceID);
Status = NtPlugPlayControl(PlugPlayControlInitializeDevice,
&ControlData,
sizeof(ControlData));
if (!NT_SUCCESS(Status))
{
ret = CR_FAILURE;
goto done;
}
/* If the device is a phantom device, turn it into a normal device */
if (hKey != NULL)
{
dwPhantom = 0;