Author: janderwald
Date: Fri Apr 15 14:58:50 2011
New Revision: 51350

URL: http://svn.reactos.org/svn/reactos?rev=51350&view=rev
Log:
[USBEHCI_NEW]
- Fix IOCTL_GET_HCD_DRIVERKEY_NAME implementation
- Now needs IOCTL_USB_GET_ROOT_HUB_NAME to get further in usbview
- Tested in Windows XP SP2

Modified:
    branches/usb-bringup/drivers/usb/usbehci_new/hcd_controller.cpp

Modified: branches/usb-bringup/drivers/usb/usbehci_new/hcd_controller.cpp
URL: 
http://svn.reactos.org/svn/reactos/branches/usb-bringup/drivers/usb/usbehci_new/hcd_controller.cpp?rev=51350&r1=51349&r2=51350&view=diff
==============================================================================
--- branches/usb-bringup/drivers/usb/usbehci_new/hcd_controller.cpp 
[iso-8859-1] (original)
+++ branches/usb-bringup/drivers/usb/usbehci_new/hcd_controller.cpp 
[iso-8859-1] Fri Apr 15 14:58:50 2011
@@ -241,7 +241,7 @@
     DeviceExtension = (PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
 
 
-    DPRINT1("HandleDeviceControl>Type: FDO %u IoCtl %x InputBufferLength %lu 
OutputBufferLength %lu NOT IMPLEMENTED\n",
+    DPRINT1("HandleDeviceControl>Type: FDO %u IoCtl %x InputBufferLength %lu 
OutputBufferLength %lu\n",
         DeviceExtension->IsFDO,
         IoStack->Parameters.DeviceIoControl.IoControlCode,
         IoStack->Parameters.DeviceIoControl.InputBufferLength,
@@ -282,21 +282,23 @@
                         //
                         // it does
                         //
-                        Status = IoGetDeviceProperty(m_PhysicalDeviceObject, 
DevicePropertyDriverKeyName, 
IoStack->Parameters.DeviceIoControl.OutputBufferLength, 
DriverKey->DriverKeyName, &ResultLength);
-
-                        //DPRINT1("Result %S\n", DriverKey->DriverKeyName);
+                        Status = IoGetDeviceProperty(m_PhysicalDeviceObject, 
DevicePropertyDriverKeyName, 
IoStack->Parameters.DeviceIoControl.OutputBufferLength - sizeof(ULONG), 
DriverKey->DriverKeyName, &ResultLength);
+
+                        if (NT_SUCCESS(Status))
+                        {
+                            //
+                            // informal debug print
+                            //
+                            DPRINT1("Result %S\n", DriverKey->DriverKeyName);
+                        }
                     }
 
-                                       //
-                                       // FIXME
-                                       //
-
                     //
                     // store result
                     //
-                    DriverKey->ActualLength = ResultLength;
+                    DriverKey->ActualLength = ResultLength + 
FIELD_OFFSET(USB_HCD_DRIVERKEY_NAME, DriverKeyName) + sizeof(WCHAR);
                     Irp->IoStatus.Information = 
IoStack->Parameters.DeviceIoControl.OutputBufferLength;
-                    Status = STATUS_BUFFER_OVERFLOW;
+                    Status = STATUS_SUCCESS;
                 }
             }
             else
@@ -308,13 +310,28 @@
                 Irp->IoStatus.Information = sizeof(USB_HCD_DRIVERKEY_NAME);
             }
         }
-    }
-
-//
-
+        else if (IoStack->Parameters.DeviceIoControl.IoControlCode == 
IOCTL_USB_GET_ROOT_HUB_NAME)
+        {
+            DPRINT1("IOCTL_USB_GET_ROOT_HUB_NAME is not implemented yet\n");
+        }
+    }
+    else
+    {
+        //
+        // the PDO does not support any device IOCTLs
+        //
+        Status = STATUS_SUCCESS;
+    }
+
+    //
+    // complete the request
+    //
     Irp->IoStatus.Status = Status;
     IoCompleteRequest(Irp, IO_NO_INCREMENT);
 
+    //
+    // done
+    //
     return Status;
 }
 


Reply via email to