Author: janderwald
Date: Tue Aug 11 17:22:06 2009
New Revision: 42622
URL:
http://svn.reactos.org/svn/reactos?rev=42622&view=rev
Log:
- Filter dispatch is optional, handle it when creating new filters
Modified:
trunk/reactos/drivers/ksfilter/ks/filter.c
Modified: trunk/reactos/drivers/ksfilter/ks/filter.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/filter…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/filter.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/filter.c [iso-8859-1] Tue Aug 11 17:22:06 2009
@@ -442,6 +442,13 @@
/* free object header */
KsFreeObjectHeader(This->ObjectHeader);
+ }
+ else
+ {
+ /* complete and forget */
+ Irp->IoStatus.Status = Status;
+ /* complete irp */
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
}
/* done */
@@ -1085,21 +1092,29 @@
return Status;
}
- /* now let driver initialize the filter instance */
- Status = Factory->FilterDescriptor->Dispatch->Create(&This->Filter,
Irp);
-
- if (!NT_SUCCESS(Status) && Status != STATUS_PENDING)
- {
- /* driver failed to initialize */
- DPRINT1("Driver: Status %x\n", Status);
-
- /* remove filter instance from filter factory */
- iface->lpVtbl->RemoveFilterInstance(iface,
(IKsFilter*)&This->lpVtbl);
-
- /* free filter instance */
- FreeItem(This);
- FreeItem(CreateItem);
- return Status;
+ /* does the filter have a filter dispatch */
+ if (Factory->FilterDescriptor->Dispatch)
+ {
+ /* does it have a create routine */
+ if (Factory->FilterDescriptor->Dispatch->Create)
+ {
+ /* now let driver initialize the filter instance */
+ Status =
Factory->FilterDescriptor->Dispatch->Create(&This->Filter, Irp);
+
+ if (!NT_SUCCESS(Status) && Status != STATUS_PENDING)
+ {
+ /* driver failed to initialize */
+ DPRINT1("Driver: Status %x\n", Status);
+
+ /* remove filter instance from filter factory */
+ iface->lpVtbl->RemoveFilterInstance(iface,
(IKsFilter*)&This->lpVtbl);
+
+ /* free filter instance */
+ FreeItem(This);
+ FreeItem(CreateItem);
+ return Status;
+ }
+ }
}
/* now allocate the object header */