Author: janderwald
Date: Sun Aug 2 14:38:08 2009
New Revision: 42335
URL:
http://svn.reactos.org/svn/reactos?rev=42335&view=rev
Log:
[KS]
- Acquire Spinlock at dpc level
- Release cancel spinlock at correct level
[PORTCLS]
- Check if current partially processed irp has been cancelled and complete it in that
case
- Silence debug flood
Modified:
trunk/reactos/drivers/ksfilter/ks/irp.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c
Modified: trunk/reactos/drivers/ksfilter/ks/irp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/irp.c?…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/irp.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/irp.c [iso-8859-1] Sun Aug 2 14:38:08 2009
@@ -1287,25 +1287,24 @@
IN PIRP Irp)
{
PKSPIN_LOCK SpinLock;
- KIRQL OldLevel;
/* get internal queue lock */
SpinLock = KSQUEUE_SPINLOCK_IRP_STORAGE(Irp);
/* acquire spinlock */
- KeAcquireSpinLock(SpinLock, &OldLevel);
+ KeAcquireSpinLockAtDpcLevel(SpinLock);
/* sanity check */
ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
/* release cancel spinlock */
- IoReleaseCancelSpinLock(DISPATCH_LEVEL);
+ IoReleaseCancelSpinLock(Irp->CancelIrql);
/* remove the irp from the list */
RemoveEntryList(&Irp->Tail.Overlay.ListEntry);
/* release spinlock */
- KeReleaseSpinLock(SpinLock, OldLevel);
+ KeReleaseSpinLockFromDpcLevel(SpinLock);
/* has the irp already been canceled */
if (Irp->IoStatus.Status != STATUS_CANCELLED)
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.c [iso-8859-1] Sun Aug 2
14:38:08 2009
@@ -165,10 +165,18 @@
if (This->Irp)
{
/* use last irp */
- Irp = This->Irp;
- Offset = This->CurrentOffset;
- /* TODO cancel irp when required */
- ASSERT(Irp->Cancel == FALSE);
+ if (This->Irp->Cancel == FALSE)
+ {
+ Irp = This->Irp;
+ Offset = This->CurrentOffset;
+ }
+ else
+ {
+ /* irp has been cancelled */
+ This->Irp->IoStatus.Status = STATUS_CANCELLED;
+ IoCompleteRequest(This->Irp, IO_NO_INCREMENT);
+ This->Irp = Irp = NULL;
+ }
}
else
{
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c [iso-8859-1] Sun Aug
2 14:38:08 2009
@@ -970,7 +970,7 @@
PrePostRatio = (This->PreCompleted * 100) / This->TotalPackets;
MinData = This->IrpQueue->lpVtbl->NumData(This->IrpQueue);
- DPRINT1("IPortPinWaveCyclic_fnFastWrite entered Total %u Pre %u Post %u State %x
MinData %u Ratio %u\n", This->TotalPackets, This->PreCompleted,
This->PostCompleted, This->State,
This->IrpQueue->lpVtbl->NumData(This->IrpQueue), PrePostRatio);
+ DPRINT("IPortPinWaveCyclic_fnFastWrite entered Total %u Pre %u Post %u State %x
MinData %u Ratio %u\n", This->TotalPackets, This->PreCompleted,
This->PostCompleted, This->State,
This->IrpQueue->lpVtbl->NumData(This->IrpQueue), PrePostRatio);
Packet = (PCONTEXT_WRITE)Buffer;
Irp = Packet->Irp;