[ros-diffs] [janderwald] 41512: - Don't release object which drivers should release - Fixes a few crashes when starting another audio stream

janderwald at svn.reactos.org janderwald at svn.reactos.org
Sun Jun 21 12:48:10 CEST 2009


Author: janderwald
Date: Sun Jun 21 14:48:09 2009
New Revision: 41512

URL: http://svn.reactos.org/svn/reactos?rev=41512&view=rev
Log:
- Don't release object which drivers should release
- Fixes a few crashes when starting another audio stream

Modified:
    trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c
    trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.c
    trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavert.c

Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.c?rev=41512&r1=41511&r2=41512&view=diff
==============================================================================
--- 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 Jun 21 14:48:09 2009
@@ -692,8 +692,6 @@
     }
 
     This->ServiceGroup->lpVtbl->RemoveMember(This->ServiceGroup, (PSERVICESINK)&This->lpVtblServiceSink);
-    This->ServiceGroup->lpVtbl->Release(This->ServiceGroup);
-    This->DmaChannel->lpVtbl->Release(This->DmaChannel);
 
     Status = This->Port->lpVtbl->QueryInterface(This->Port, &IID_ISubdevice, (PVOID*)&ISubDevice);
     if (NT_SUCCESS(Status))
@@ -735,7 +733,6 @@
         This->Filter->lpVtbl->FreePin(This->Filter, (IPortPinWaveCyclic*)This);
         DPRINT1("Closing stream at Irql %u\n", KeGetCurrentIrql());
         Stream->lpVtbl->Release(Stream);
-        /* this line is never reached */
     }
 }
 
@@ -1064,8 +1061,8 @@
     Status = This->Stream->lpVtbl->SetNotificationFreq(This->Stream, 10, &This->FrameSize);
 
     //This->Stream->lpVtbl->SetFormat(This->Stream, (PKSDATAFORMAT)This->Format);
-	DPRINT1("Setting state to acquire %x\n", This->Stream->lpVtbl->SetState(This->Stream, KSSTATE_ACQUIRE));
-	DPRINT1("Setting state to pause %x\n", This->Stream->lpVtbl->SetState(This->Stream, KSSTATE_PAUSE));
+    DPRINT1("Setting state to acquire %x\n", This->Stream->lpVtbl->SetState(This->Stream, KSSTATE_ACQUIRE));
+    DPRINT1("Setting state to pause %x\n", This->Stream->lpVtbl->SetState(This->Stream, KSSTATE_PAUSE));
     This->State = KSSTATE_PAUSE;
 
 

Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.c?rev=41512&r1=41511&r2=41512&view=diff
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.c [iso-8859-1] Sun Jun 21 14:48:09 2009
@@ -391,14 +391,12 @@
         if (This->State != KSSTATE_STOP)
         {
             This->Stream->lpVtbl->SetState(This->Stream, KSSTATE_STOP);
-            KeStallExecutionProcessor(10);
         }
     }
 
     if (This->ServiceGroup)
     {
         This->ServiceGroup->lpVtbl->RemoveMember(This->ServiceGroup, (PSERVICESINK)&This->lpVtblServiceSink);
-        This->ServiceGroup->lpVtbl->Release(This->ServiceGroup);
     }
 
     Status = This->Port->lpVtbl->QueryInterface(This->Port, &IID_ISubdevice, (PVOID*)&ISubDevice);
@@ -407,20 +405,15 @@
         Status = ISubDevice->lpVtbl->GetDescriptor(ISubDevice, &Descriptor);
         if (NT_SUCCESS(Status))
         {
-            ISubDevice->lpVtbl->Release(ISubDevice);
             Descriptor->Factory.Instances[This->ConnectDetails->PinId].CurrentPinInstanceCount--;
         }
+        ISubDevice->lpVtbl->Release(ISubDevice);
     }
 
     if (This->Format)
     {
         ExFreePool(This->Format);
         This->Format = NULL;
-    }
-
-    if (This->WaveStream)
-    {
-        This->WaveStream->lpVtbl->Release(This->WaveStream);
     }
 
     /* complete the irp */
@@ -440,7 +433,6 @@
         This->Stream = NULL;
         DPRINT1("Closing stream at Irql %u\n", KeGetCurrentIrql());
         Stream->lpVtbl->Release(Stream);
-        /* this line is never reached */
     }
 }
 

Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavert.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavert.c?rev=41512&r1=41511&r2=41512&view=diff
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavert.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavert.c [iso-8859-1] Sun Jun 21 14:48:09 2009
@@ -702,9 +702,9 @@
         Status = ISubDevice->lpVtbl->GetDescriptor(ISubDevice, &Descriptor);
         if (NT_SUCCESS(Status))
         {
-            ISubDevice->lpVtbl->Release(ISubDevice);
             Descriptor->Factory.Instances[This->ConnectDetails->PinId].CurrentPinInstanceCount--;
         }
+        ISubDevice->lpVtbl->Release(ISubDevice);
     }
 
     if (This->Format)
@@ -735,7 +735,6 @@
         This->Stream = NULL;
         DPRINT1("Closing stream at Irql %u\n", KeGetCurrentIrql());
         Stream->lpVtbl->Release(Stream);
-        /* this line is never reached */
     }
 }
 



More information about the Ros-diffs mailing list