X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=ntoskrnl%2Fio%2Fpnpmgr%2Fpnpmgr.c;h=9cd6347e95717083043dfe6cd13f69ed5bcc0348;hp=e6346378566a512c6add98b275de8f54b3e81590;hb=b6edb50eb1a2311af040aadeec7791efa270a72e;hpb=76085ba9824b9b4ac80dc6af201e47ce88df585c diff --git a/ntoskrnl/io/pnpmgr/pnpmgr.c b/ntoskrnl/io/pnpmgr/pnpmgr.c index e6346378566..9cd6347e957 100644 --- a/ntoskrnl/io/pnpmgr/pnpmgr.c +++ b/ntoskrnl/io/pnpmgr/pnpmgr.c @@ -1847,6 +1847,7 @@ IopActionConfigureChildServices(PDEVICE_NODE DeviceNode, PUNICODE_STRING Service; UNICODE_STRING ClassGUID; NTSTATUS Status; + DEVICE_CAPABILITIES DeviceCaps; DPRINT("IopActionConfigureChildServices(%p, %p)\n", DeviceNode, Context); @@ -1920,9 +1921,22 @@ IopActionConfigureChildServices(PDEVICE_NODE DeviceNode, if (Service->Buffer == NULL) { - IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED); + if (NT_SUCCESS(IopQueryDeviceCapabilities(DeviceNode, &DeviceCaps)) && + DeviceCaps.RawDeviceOK) + { + DPRINT1("%wZ is using parent bus driver (%wZ)\n", &DeviceNode->InstancePath, &ParentDeviceNode->ServiceName); + + DeviceNode->ServiceName.Length = 0; + DeviceNode->ServiceName.MaximumLength = ParentDeviceNode->ServiceName.MaximumLength; + DeviceNode->ServiceName.Buffer = ExAllocatePool(PagedPool, DeviceNode->ServiceName.MaximumLength); + if (!DeviceNode->ServiceName.Buffer) + return STATUS_SUCCESS; - if (ClassGUID.Length != 0) + RtlCopyUnicodeString(&DeviceNode->ServiceName, &ParentDeviceNode->ServiceName); + + IopDeviceNodeSetFlag(DeviceNode, DNF_LEGACY_DRIVER); + } + else if (ClassGUID.Length != 0) { /* Device has a ClassGUID value, but no Service value. * Suppose it is using the NULL driver, so state the @@ -1930,6 +1944,10 @@ IopActionConfigureChildServices(PDEVICE_NODE DeviceNode, DPRINT1("%wZ is using NULL driver\n", &DeviceNode->InstancePath); IopDeviceNodeSetFlag(DeviceNode, DNF_STARTED); } + else + { + IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED); + } return STATUS_SUCCESS; }