Author: cgutman
Date: Fri Feb 3 23:34:21 2012
New Revision: 55401
URL:
http://svn.reactos.org/svn/reactos?rev=55401&view=rev
Log:
[HIVESYS]
- Add HID devices to the critical device database
- Fixes issues with mouse/keyboard not working until new device wizards are dismissed (USB
drives work too)
[UMPNPMGR]
- Fix install failure after the kernel detects a critical device
[NTOSKRNL]
- Finally enable the proper IopResetDevice code
- Driver updating without a reboot for running devices is supported now (if someone will
write the GUI)
[USBEHCI][USBOHCI]
- Fix removal bugs
Modified:
branches/usb-bringup-trunk/base/services/umpnpmgr/umpnpmgr.c
branches/usb-bringup-trunk/boot/bootdata/hivesys_i386.inf
branches/usb-bringup-trunk/drivers/usb/usbehci_new/hcd_controller.cpp
branches/usb-bringup-trunk/drivers/usb/usbohci/hcd_controller.cpp
branches/usb-bringup-trunk/ntoskrnl/io/pnpmgr/plugplay.c
Modified: branches/usb-bringup-trunk/base/services/umpnpmgr/umpnpmgr.c
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/base/services…
==============================================================================
--- branches/usb-bringup-trunk/base/services/umpnpmgr/umpnpmgr.c [iso-8859-1] (original)
+++ branches/usb-bringup-trunk/base/services/umpnpmgr/umpnpmgr.c [iso-8859-1] Fri Feb 3
23:34:21 2012
@@ -2811,7 +2811,7 @@
&DeviceKey) == ERROR_SUCCESS)
{
if (RegQueryValueExW(DeviceKey,
- L"ClassGUID",
+ L"Class",
NULL,
NULL,
NULL,
Modified: branches/usb-bringup-trunk/boot/bootdata/hivesys_i386.inf
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/boot/bootdata…
==============================================================================
--- branches/usb-bringup-trunk/boot/bootdata/hivesys_i386.inf [iso-8859-1] (original)
+++ branches/usb-bringup-trunk/boot/bootdata/hivesys_i386.inf [iso-8859-1] Fri Feb 3
23:34:21 2012
@@ -11,6 +11,7 @@
; Critical Device Database
HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\acpipic_up","ClassGUID",0x00000000,"{4D36E966-E325-11CE-BFC1-08002BE10318}"
+HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\e_isa_up","ClassGUID",0x00000000,"{4D36E966-E325-11CE-BFC1-08002BE10318}"
HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0A03","Service",0x00000000,"pci"
HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\*PNP0A03","ClassGUID",0x00000000,"{4D36E97D-E325-11CE-BFC1-08002BE10318}"
@@ -44,6 +45,19 @@
HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\GenDisk","Service",0x00000000,"disk"
HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\GenDisk","ClassGUID",0x00000000,"{4D36E967-E325-11CE-BFC1-08002BE10318}"
+
+HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\USB#Class_03","Service",0x00000000,"hidusb"
+HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\USB#Class_03","ClassGUID",0x00000000,"{745a17a0-74d3-11d0-b6fe-00a0c90f57da}"
+
+HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\GENERIC_HID_DEVICE","Service",0x00000000,"hidusb"
+HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\GENERIC_HID_DEVICE","ClassGUID",0x00000000,"{745a17a0-74d3-11d0-b6fe-00a0c90f57da}"
+
+HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\HID_DEVICE_SYSTEM_KEYBOARD","Service",0x00000000,"kbdhid"
+HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\HID_DEVICE_SYSTEM_KEYBOARD","ClassGUID",0x00000000,"{4D36E96B-E325-11CE-BFC1-08002BE10318}"
+
+HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\HID_DEVICE_SYSTEM_MOUSE","Service",0x00000000,"mouhid"
+HKLM,"SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\HID_DEVICE_SYSTEM_MOUSE","ClassGUID",0x00000000,"{4D36E96F-E325-11CE-BFC1-08002BE10318}"
+
HKLM,"SYSTEM\CurrentControlSet\Control\SafeBoot","AlternateShell",2,"cmd.exe"
@@ -1451,26 +1465,44 @@
HKLM,"SYSTEM\CurrentControlSet\Services\Packet","Start",0x00010001,0x00000004
HKLM,"SYSTEM\CurrentControlSet\Services\Packet","Type",0x00010001,0x00000001
+; USB HID driver
+HKLM,"SYSTEM\CurrentControlSet\Services\hidusb","ErrorControl",0x00010001,0x00000001
+HKLM,"SYSTEM\CurrentControlSet\Services\hidusb","Group",0x00000000,"Extended
Base"
+HKLM,"SYSTEM\CurrentControlSet\Services\hidusb","ImagePath",0x00020000,"system32\drivers\hidusb.sys"
+HKLM,"SYSTEM\CurrentControlSet\Services\hidusb","Start",0x00010001,0x00000003
+HKLM,"SYSTEM\CurrentControlSet\Services\hidusb","Type",0x00010001,0x00000001
+
+; HID keyboard driver
+HKLM,"SYSTEM\CurrentControlSet\Services\kbdhid","ErrorControl",0x00010001,0x00000001
+HKLM,"SYSTEM\CurrentControlSet\Services\kbdhid","Group",0x00000000,"Keyboard
Port"
+HKLM,"SYSTEM\CurrentControlSet\Services\kbdhid","ImagePath",0x00020000,"system32\drivers\kbdhid.sys"
+HKLM,"SYSTEM\CurrentControlSet\Services\kbdhid","Start",0x00010001,0x00000003
+HKLM,"SYSTEM\CurrentControlSet\Services\kbdhid","Type",0x00010001,0x00000001
+
+; HID mouse driver
+HKLM,"SYSTEM\CurrentControlSet\Services\mouhid","ErrorControl",0x00010001,0x00000001
+HKLM,"SYSTEM\CurrentControlSet\Services\mouhid","Group",0x00000000,"Pointer
Port"
+HKLM,"SYSTEM\CurrentControlSet\Services\mouhid","ImagePath",0x00020000,"system32\drivers\mouhid.sys"
+HKLM,"SYSTEM\CurrentControlSet\Services\mouhid","Start",0x00010001,0x00000003
+HKLM,"SYSTEM\CurrentControlSet\Services\mouhid","Type",0x00010001,0x00000001
+
; USB hub driver
HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","ErrorControl",0x00010001,0x00000001
HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","Group",0x00000000,"Boot
Bus Extender"
-HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","Tag",0x00010001,0x00000002
HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","ImagePath",0x00020000,"system32\drivers\usbhub.sys"
HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","Start",0x00010001,0x00000000
-HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","Type",0x00010001,0x00000002
+HKLM,"SYSTEM\CurrentControlSet\Services\usbhub","Type",0x00010001,0x00000001
; EHCI controller driver
HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","ErrorControl",0x00010001,0x00000001
HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","Group",0x00000000,"Boot
Bus Extender"
-HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","Tag",0x00010001,0x00000002
HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","ImagePath",0x00020000,"system32\drivers\usbehci.sys"
HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","Start",0x00010001,0x00000000
-HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","Type",0x00010001,0x00000002
+HKLM,"SYSTEM\CurrentControlSet\Services\usbehci","Type",0x00010001,0x00000001
; OHCI controller driver
HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","ErrorControl",0x00010001,0x00000001
HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","Group",0x00000000,"Boot
Bus Extender"
-HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","Tag",0x00010001,0x00000002
HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","ImagePath",0x00020000,"system32\drivers\usbohci.sys"
HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","Start",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Services\usbohci","Type",0x00010001,0x00000001
@@ -1478,7 +1510,6 @@
; UHCI controller driver
;HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","ErrorControl",0x00010001,0x00000001
;HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","Group",0x00000000,"Boot
Bus Extender"
-;HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","Tag",0x00010001,0x00000002
;HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","ImagePath",0x00020000,"system32\drivers\usbuhci.sys"
;HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","Start",0x00010001,0x00000000
;HKLM,"SYSTEM\CurrentControlSet\Services\usbuhci","Type",0x00010001,0x00000001
@@ -1486,7 +1517,6 @@
; USB storage driver
HKLM,"SYSTEM\CurrentControlSet\Services\usbstor","ErrorControl",0x00010001,0x00000001
HKLM,"SYSTEM\CurrentControlSet\Services\usbstor","Group",0x00000000,"Primary
Disk"
-HKLM,"SYSTEM\CurrentControlSet\Services\usbstor","Tag",0x00010001,0x00000002
HKLM,"SYSTEM\CurrentControlSet\Services\usbstor","ImagePath",0x00020000,"system32\drivers\usbstor.sys"
HKLM,"SYSTEM\CurrentControlSet\Services\usbstor","Start",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Services\usbstor","Type",0x00010001,0x00000001
@@ -1494,7 +1524,6 @@
; USB composite generic parent
HKLM,"SYSTEM\CurrentControlSet\Services\usbccgp","ErrorControl",0x00010001,0x00000001
HKLM,"SYSTEM\CurrentControlSet\Services\usbccgp","Group",0x00000000,"Boot
Bus Extender"
-HKLM,"SYSTEM\CurrentControlSet\Services\usbccgp","Tag",0x00010001,0x00000002
HKLM,"SYSTEM\CurrentControlSet\Services\usbccgp","ImagePath",0x00020000,"system32\drivers\usbccgp.sys"
HKLM,"SYSTEM\CurrentControlSet\Services\usbccgp","Start",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Services\usbccgp","Type",0x00010001,0x00000001
@@ -1502,7 +1531,6 @@
; ACPI driver
HKLM,"SYSTEM\CurrentControlSet\Services\acpi","ErrorControl",0x00010001,0x00000001
HKLM,"SYSTEM\CurrentControlSet\Services\acpi","Group",0x00000000,"Boot
Bus Extender"
-HKLM,"SYSTEM\CurrentControlSet\Services\acpi","Tag",0x00010001,0x00000002
HKLM,"SYSTEM\CurrentControlSet\Services\acpi","ImagePath",0x00020000,"system32\drivers\acpi.sys"
HKLM,"SYSTEM\CurrentControlSet\Services\acpi","Start",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Services\acpi","Type",0x00010001,0x00000001
@@ -1510,7 +1538,6 @@
; PCI Bus driver
HKLM,"SYSTEM\CurrentControlSet\Services\Pci","ErrorControl",0x00010001,0x00000001
HKLM,"SYSTEM\CurrentControlSet\Services\Pci","Group",0x00000000,"Boot
Bus Extender"
-HKLM,"SYSTEM\CurrentControlSet\Services\Pci","Tag",0x00010001,0x00000002
HKLM,"SYSTEM\CurrentControlSet\Services\Pci","ImagePath",0x00020000,"system32\drivers\pci.sys"
HKLM,"SYSTEM\CurrentControlSet\Services\Pci","Start",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Services\Pci","Type",0x00010001,0x00000001
Modified: branches/usb-bringup-trunk/drivers/usb/usbehci_new/hcd_controller.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
==============================================================================
--- branches/usb-bringup-trunk/drivers/usb/usbehci_new/hcd_controller.cpp [iso-8859-1]
(original)
+++ branches/usb-bringup-trunk/drivers/usb/usbehci_new/hcd_controller.cpp [iso-8859-1] Fri
Feb 3 23:34:21 2012
@@ -534,11 +534,36 @@
}
break;
}
+ case IRP_MN_QUERY_REMOVE_DEVICE:
+ case IRP_MN_QUERY_STOP_DEVICE:
+ {
+ //
+ // sure
+ //
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+
+ //
+ // forward irp to next device object
+ //
+ IoSkipCurrentIrpStackLocation(Irp);
+ return IoCallDriver(m_NextDeviceObject, Irp);
+ }
case IRP_MN_REMOVE_DEVICE:
{
DPRINT1("CHCDController::HandlePnp IRP_MN_REMOVE_DEVICE FDO\n");
//
+ // delete the symbolic link
+ //
+ SetSymbolicLink(FALSE);
+
+ //
+ // forward irp to next device object
+ //
+ IoSkipCurrentIrpStackLocation(Irp);
+ IoCallDriver(m_NextDeviceObject, Irp);
+
+ //
// detach device from device stack
//
IoDetachDevice(m_NextDeviceObject);
@@ -548,8 +573,7 @@
//
IoDeleteDevice(m_FunctionalDeviceObject);
- Status = STATUS_SUCCESS;
- break;
+ return STATUS_SUCCESS;
}
default:
{
Modified: branches/usb-bringup-trunk/drivers/usb/usbohci/hcd_controller.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/drivers/usb/u…
==============================================================================
--- branches/usb-bringup-trunk/drivers/usb/usbohci/hcd_controller.cpp [iso-8859-1]
(original)
+++ branches/usb-bringup-trunk/drivers/usb/usbohci/hcd_controller.cpp [iso-8859-1] Fri Feb
3 23:34:21 2012
@@ -534,11 +534,36 @@
}
break;
}
+ case IRP_MN_QUERY_REMOVE_DEVICE:
+ case IRP_MN_QUERY_STOP_DEVICE:
+ {
+ //
+ // sure
+ //
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+
+ //
+ // forward irp to next device object
+ //
+ IoSkipCurrentIrpStackLocation(Irp);
+ return IoCallDriver(m_NextDeviceObject, Irp);
+ }
case IRP_MN_REMOVE_DEVICE:
{
DPRINT1("CHCDController::HandlePnp IRP_MN_REMOVE_DEVICE FDO\n");
//
+ // delete the symbolic link
+ //
+ SetSymbolicLink(FALSE);
+
+ //
+ // forward irp to next device object
+ //
+ IoSkipCurrentIrpStackLocation(Irp);
+ IoCallDriver(m_NextDeviceObject, Irp);
+
+ //
// detach device from device stack
//
IoDetachDevice(m_NextDeviceObject);
@@ -548,8 +573,7 @@
//
IoDeleteDevice(m_FunctionalDeviceObject);
- Status = STATUS_SUCCESS;
- break;
+ return STATUS_SUCCESS;
}
default:
{
Modified: branches/usb-bringup-trunk/ntoskrnl/io/pnpmgr/plugplay.c
URL:
http://svn.reactos.org/svn/reactos/branches/usb-bringup-trunk/ntoskrnl/io/p…
==============================================================================
--- branches/usb-bringup-trunk/ntoskrnl/io/pnpmgr/plugplay.c [iso-8859-1] (original)
+++ branches/usb-bringup-trunk/ntoskrnl/io/pnpmgr/plugplay.c [iso-8859-1] Fri Feb 3
23:34:21 2012
@@ -549,26 +549,42 @@
if (DeviceObject == NULL)
return STATUS_NO_SUCH_DEVICE;
+ /* Get the device node */
DeviceNode = IopGetDeviceNode(DeviceObject);
-#if 0
- /* Remove the device */
- if (DeviceNode->Flags & DNF_ENUMERATED)
- {
+ /* Check if an FDO has been added to the stack */
+ if (DeviceNode->Flags & DNF_ADDED)
+ {
+ /* Remove the device node */
Status = IopRemoveDevice(DeviceNode);
if (!NT_SUCCESS(Status))
{
DPRINT1("WARNING: Ignoring failed IopRemoveDevice() for %wZ (likely a
driver bug)\n", &DeviceNode->InstancePath);
}
- }
-#endif
-
- /* Reenumerate the device and its children */
- DeviceNode->Flags &= ~DNF_DISABLED;
- Status = IopActionConfigureChildServices(DeviceNode, DeviceNode->Parent);
-
- if (NT_SUCCESS(Status))
- Status = IopActionInitChildServices(DeviceNode, DeviceNode->Parent);
+
+ /* Invalidate device relations for the parent to reenumerate the device */
+ Status =
IoSynchronousInvalidateDeviceRelations(DeviceNode->Parent->PhysicalDeviceObject,
BusRelations);
+
+ DPRINT1("Reset PDO with FDO present: 0x%x\n", Status);
+ }
+ else
+ {
+ /* FIXME: We might clear some important flags */
+ ASSERT(DeviceNode->Flags & DNF_ENUMERATED);
+ ASSERT(DeviceNode->Flags & DNF_PROCESSED);
+ DeviceNode->Flags = DNF_ENUMERATED | DNF_PROCESSED;
+
+ /* Load service data from the registry */
+ Status = IopActionConfigureChildServices(DeviceNode, DeviceNode->Parent);
+
+ if (NT_SUCCESS(Status))
+ {
+ /* Start the service and begin PnP initialization of the device again */
+ Status = IopActionInitChildServices(DeviceNode, DeviceNode->Parent);
+ }
+
+ DPRINT1("Reset PDO with no FDO present: 0x%x\n", Status);
+ }
ObDereferenceObject(DeviceObject);