Author: janderwald
Date: Thu Feb 23 00:34:36 2012
New Revision: 55823

URL: http://svn.reactos.org/svn/reactos?rev=55823&view=rev
Log:
[HIDCLASS]
- Silence traces
- Signal event when last pending transfer is done
- Reject new transfers when stop is in progress

Modified:
    trunk/reactos/drivers/hid/hidclass/hidclass.c

Modified: trunk/reactos/drivers/hid/hidclass/hidclass.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/hid/hidclass/hidclass.c?rev=55823&r1=55822&r2=55823&view=diff
==============================================================================
--- trunk/reactos/drivers/hid/hidclass/hidclass.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/hid/hidclass/hidclass.c [iso-8859-1] Thu Feb 23 
00:34:36 2012
@@ -402,13 +402,13 @@
     //
     IrpContext = (PHIDCLASS_IRP_CONTEXT)Ctx;
 
-    DPRINT1("HidClass_ReadCompleteIrp Irql %lu\n", KeGetCurrentIrql());
-    DPRINT1("HidClass_ReadCompleteIrp Status %lx\n", Irp->IoStatus.Status);
-    DPRINT1("HidClass_ReadCompleteIrp Length %lu\n", 
Irp->IoStatus.Information);
-    DPRINT1("HidClass_ReadCompleteIrp Irp %p\n", Irp);
-    DPRINT1("HidClass_ReadCompleteIrp InputReportBuffer %p\n", 
IrpContext->InputReportBuffer);
-    DPRINT1("HidClass_ReadCompleteIrp InputReportBufferLength %li\n", 
IrpContext->InputReportBufferLength);
-    DPRINT1("HidClass_ReadCompleteIrp OriginalIrp %p\n", 
IrpContext->OriginalIrp);
+    DPRINT("HidClass_ReadCompleteIrp Irql %lu\n", KeGetCurrentIrql());
+    DPRINT("HidClass_ReadCompleteIrp Status %lx\n", Irp->IoStatus.Status);
+    DPRINT("HidClass_ReadCompleteIrp Length %lu\n", Irp->IoStatus.Information);
+    DPRINT("HidClass_ReadCompleteIrp Irp %p\n", Irp);
+    DPRINT("HidClass_ReadCompleteIrp InputReportBuffer %p\n", 
IrpContext->InputReportBuffer);
+    DPRINT("HidClass_ReadCompleteIrp InputReportBufferLength %li\n", 
IrpContext->InputReportBufferLength);
+    DPRINT("HidClass_ReadCompleteIrp OriginalIrp %p\n", 
IrpContext->OriginalIrp);
 
     //
     // copy result
@@ -506,6 +506,15 @@
         KeSetEvent(&IrpContext->FileOp->IrpReadComplete, 0, FALSE);
     }
 
+    if (IrpContext->FileOp->StopInProgress && IsEmpty)
+    {
+        //
+        // last pending irp
+        //
+        DPRINT1("[HIDCLASS] LastPendingTransfer Signalling\n");
+        KeSetEvent(&IrpContext->FileOp->IrpReadComplete, 0, FALSE);
+    }
+
     //
     // free irp context
     //
@@ -642,6 +651,19 @@
     // sanity check
     //
     ASSERT(CollectionDescription->InputLength >= 
ReportDescription->InputLength);
+
+    if (Context->StopInProgress)
+    {
+         //
+         // stop in progress
+         //
+         DPRINT1("[HIDCLASS] Stop In Progress\n");
+         Irp->IoStatus.Status = STATUS_CANCELLED;
+         IoCompleteRequest(Irp, IO_NO_INCREMENT);
+         return STATUS_CANCELLED;
+
+    }
+
 
     //
     // store report length


Reply via email to