Author: janderwald
Date: Sat Apr 4 20:04:25 2009
New Revision: 40360
URL:
http://svn.reactos.org/svn/reactos?rev=40360&view=rev
Log:
- Re-use WorkItem
- Fixes leaking a workitem for each pin creation request
Modified:
trunk/reactos/drivers/wdm/audio/backpln/portcls/adapter.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/adapter.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/adapter.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/adapter.c [iso-8859-1] Sat Apr 4
20:04:25 2009
@@ -10,9 +10,6 @@
*/
#include "private.h"
-#include <devguid.h>
-#include <initguid.h>
-#include <ksmedia.h>
/*
This is called from DriverEntry so that PortCls can take care of some
@@ -152,6 +149,9 @@
/* clear initializing flag */
fdo->Flags &= ~ DO_DEVICE_INITIALIZING;
+ /* allocate work item */
+ portcls_ext->WorkItem = IoAllocateWorkItem(fdo);
+
/* allocate the device header */
status = KsAllocateDeviceHeader(&portcls_ext->KsDeviceHeader, MaxObjects,
portcls_ext->CreateItems);
/* did we succeed */
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c [iso-8859-1] Sat Apr
4 20:04:25 2009
@@ -500,7 +500,6 @@
IIrpTarget *Filter;
PKSOBJECT_CREATE_ITEM CreateItem;
PPIN_WORKER_CONTEXT Context;
- PIO_WORKITEM WorkItem;
DPRINT("PcCreateItemDispatch called DeviceObject %p\n", DeviceObject);
@@ -599,20 +598,11 @@
Context->Filter = Filter;
Context->Irp = Irp;
- WorkItem = IoAllocateWorkItem(DeviceObject);
- if (!WorkItem)
- {
- Irp->IoStatus.Information = 0;
- Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
- FreeItem(Context, TAG_PORTCLASS);
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
- return STATUS_INSUFFICIENT_RESOURCES;
- }
DPRINT("Queueing IRP %p Irql %u\n", Irp, KeGetCurrentIrql());
Irp->IoStatus.Information = 0;
Irp->IoStatus.Status = STATUS_PENDING;
IoMarkIrpPending(Irp);
- IoQueueWorkItem(WorkItem, CreatePinWorkerRoutine, DelayedWorkQueue,
(PVOID)Context);
+ IoQueueWorkItem(DeviceExt->WorkItem, CreatePinWorkerRoutine,
DelayedWorkQueue, (PVOID)Context);
return STATUS_PENDING;
}
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h [iso-8859-1] Sat Apr 4
20:04:25 2009
@@ -156,7 +156,7 @@
ULONG MaxSubDevices;
KSOBJECT_CREATE_ITEM * CreateItems;
-
+ PIO_WORKITEM WorkItem;
IResourceList* resources;
LIST_ENTRY SubDeviceList;
LIST_ENTRY PhysicalConnectionList;