diff --git a/reactos/drivers/usb/cromwell/uhci/cleanup.c b/reactos/drivers/usb/cromwell/uhci/cleanup.c
new file mode 100644
index 00000000000..634296eb359
--- /dev/null
+++ b/reactos/drivers/usb/cromwell/uhci/cleanup.c
@@ -0,0 +1,24 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS UHCI controller driver (Cromwell type)
+ * FILE: drivers/usb/cromwell/uhci/cleanup.c
+ * PURPOSE: IRP_MJ_CLEANUP operations
+ *
+ * PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.com)
+ */
+
+#define NDEBUG
+#include "uhci.h"
+
+NTSTATUS STDCALL
+UhciCleanup(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp)
+{
+ DPRINT("UHCI: IRP_MJ_CLEANUP\n");
+
+ Irp->IoStatus.Information = 0;
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_SUCCESS;
+}
diff --git a/reactos/drivers/usb/cromwell/uhci/uhci.c b/reactos/drivers/usb/cromwell/uhci/uhci.c
index dd16dbc80b4..3613155ddd7 100644
--- a/reactos/drivers/usb/cromwell/uhci/uhci.c
+++ b/reactos/drivers/usb/cromwell/uhci/uhci.c
@@ -244,6 +244,15 @@ DispatchClose(PDEVICE_OBJECT DeviceObject, PIRP Irp)
return IrpStub(DeviceObject, Irp);
}
+static NTSTATUS STDCALL
+DispatchCleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp)
+{
+ if (((POHCI_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->IsFDO)
+ return UhciCleanup(DeviceObject, Irp);
+ else
+ return IrpStub(DeviceObject, Irp);
+}
+
static NTSTATUS STDCALL
DispatchDeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
@@ -289,6 +298,7 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegPath)
DriverObject->MajorFunction[IRP_MJ_CREATE] = DispatchCreate;
DriverObject->MajorFunction[IRP_MJ_CLOSE] = DispatchClose;
+ DriverObject->MajorFunction[IRP_MJ_CLEANUP] = DispatchCleanup;
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = DispatchDeviceControl;
DriverObject->MajorFunction[IRP_MJ_PNP] = DispatchPnp;
DriverObject->MajorFunction[IRP_MJ_POWER] = DispatchPower;
diff --git a/reactos/drivers/usb/cromwell/uhci/uhci.h b/reactos/drivers/usb/cromwell/uhci/uhci.h
index a9227189f52..331fab8ad6e 100644
--- a/reactos/drivers/usb/cromwell/uhci/uhci.h
+++ b/reactos/drivers/usb/cromwell/uhci/uhci.h
@@ -12,9 +12,9 @@
#define USB_UHCI_TAG TAG('u','s','b','u')
-/* create.c */
+/* cleanup.c */
NTSTATUS STDCALL
-UhciCreate(
+UhciCleanup(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
@@ -24,6 +24,12 @@ UhciClose(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
+/* create.c */
+NTSTATUS STDCALL
+UhciCreate(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp);
+
/* fdo.c */
NTSTATUS STDCALL
UhciPnpFdo(
diff --git a/reactos/drivers/usb/cromwell/uhci/uhci.xml b/reactos/drivers/usb/cromwell/uhci/uhci.xml
index 0bb83f5a290..21f857c09c6 100644
--- a/reactos/drivers/usb/cromwell/uhci/uhci.xml
+++ b/reactos/drivers/usb/cromwell/uhci/uhci.xml
@@ -7,6 +7,7 @@
ntoskrnl
hal
usbcore
+ cleanup.c
close.c
create.c
fdo.c