Author: cgutman
Date: Thu Mar 25 06:16:31 2010
New Revision: 46431
URL: http://svn.reactos.org/svn/reactos?rev=46431&view=rev
Log:
[NTOSKRNL]
- Handle devices that are run by their own bus drivers
- This could be done a bit nicer but it works
Modified:
trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Thu Mar 25 06:16:31 2010
@@ -1847,6 +1847,7 @@
PUNICODE_STRING Service;
UNICODE_STRING ClassGUID;
NTSTATUS Status;
+ DEVICE_CAPABILITIES DeviceCaps;
DPRINT("IopActionConfigureChildServices(%p, %p)\n", DeviceNode, Context);
@@ -1920,15 +1921,32 @@
if (Service->Buffer == NULL)
{
- IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED);
-
- if (ClassGUID.Length != 0)
+ 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;
+
+ 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
* device is started */
DPRINT1("%wZ is using NULL driver\n", &DeviceNode->InstancePath);
IopDeviceNodeSetFlag(DeviceNode, DNF_STARTED);
+ }
+ else
+ {
+ IopDeviceNodeSetFlag(DeviceNode, DNF_DISABLED);
}
return STATUS_SUCCESS;
}