From a5e2945149f7bda796fdfa22b6b6cbf89e40f04f Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Wed, 1 Jul 2015 07:39:35 +0000 Subject: [PATCH] [PORTCLS] - check if there are enough irp stack locations svn path=/trunk/; revision=68328 --- reactos/drivers/wdm/audio/backpln/portcls/irp.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reactos/drivers/wdm/audio/backpln/portcls/irp.cpp b/reactos/drivers/wdm/audio/backpln/portcls/irp.cpp index 2cd09818ff7..bb535ed204c 100644 --- a/reactos/drivers/wdm/audio/backpln/portcls/irp.cpp +++ b/reactos/drivers/wdm/audio/backpln/portcls/irp.cpp @@ -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);