[ros-diffs] [janderwald] 47711: [PORTCLS] - Check if resource list has been allocated

janderwald at svn.reactos.org janderwald at svn.reactos.org
Wed Jun 9 14:27:26 CET 2010


Author: janderwald
Date: Wed Jun  9 13:27:19 2010
New Revision: 47711

URL: http://svn.reactos.org/svn/reactos?rev=47711&view=rev
Log:
[PORTCLS]
- Check if resource list has been allocated

Modified:
    trunk/reactos/drivers/wdm/audio/backpln/portcls/irp.cpp

Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/irp.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/portcls/irp.cpp?rev=47711&r1=47710&r2=47711&view=diff
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/irp.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/irp.cpp [iso-8859-1] Wed Jun  9 13:27:19 2010
@@ -118,11 +118,22 @@
             // Clean up
             DPRINT("IRP_MN_REMOVE_DEVICE\n");
 
-            DeviceExt->resources->Release();
-            IoDeleteDevice(DeviceObject);
+            // sanity check
+            PC_ASSERT(DeviceExt);
+
+            // FIXME more cleanup */
+            if (DeviceExt->resources)
+            {
+                // free resource list */
+                DeviceExt->resources->Release();
+
+                // set to null
+                DeviceExt->resources = NULL;
+            }
 
             // Forward request
             Status = PcForwardIrpSynchronous(DeviceObject, Irp);
+
             return PcCompleteIrp(DeviceObject, Irp, Status);
 
         case IRP_MN_QUERY_INTERFACE:




More information about the Ros-diffs mailing list