[PORTCLS]
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Wed, 1 Jul 2015 07:39:35 +0000 (07:39 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Wed, 1 Jul 2015 07:39:35 +0000 (07:39 +0000)
- check if there are enough irp stack locations

svn path=/trunk/; revision=68328

reactos/drivers/wdm/audio/backpln/portcls/irp.cpp

index 2cd0981..bb535ed 100644 (file)
@@ -548,7 +548,11 @@ PcForwardIrpSynchronous(
     // initialize the notification event
     KeInitializeEvent(&Event, NotificationEvent, FALSE);
 
-    IoCopyCurrentIrpStackLocationToNext(Irp);
+    // are there enough irp stack locations
+    if (Irp->CurrentLocation < Irp->StackCount + 1)
+    {
+        IoCopyCurrentIrpStackLocationToNext(Irp);
+    }
 
     IoSetCompletionRoutine(Irp, CompletionRoutine, (PVOID)&Event, TRUE, TRUE, TRUE);