mirror of
https://github.com/reactos/reactos.git
synced 2024-11-20 14:30:57 +00:00
- Filter dispatch is optional, handle it when creating new filters
svn path=/trunk/; revision=42622
This commit is contained in:
parent
15900e1f91
commit
555a242381
1 changed files with 27 additions and 12 deletions
|
@ -443,6 +443,13 @@ IKsFilter_DispatchClose(
|
|||
/* free object header */
|
||||
KsFreeObjectHeader(This->ObjectHeader);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* complete and forget */
|
||||
Irp->IoStatus.Status = Status;
|
||||
/* complete irp */
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
}
|
||||
|
||||
/* done */
|
||||
return Status;
|
||||
|
@ -1085,21 +1092,29 @@ KspCreateFilter(
|
|||
return Status;
|
||||
}
|
||||
|
||||
/* now let driver initialize the filter instance */
|
||||
Status = Factory->FilterDescriptor->Dispatch->Create(&This->Filter, Irp);
|
||||
|
||||
if (!NT_SUCCESS(Status) && Status != STATUS_PENDING)
|
||||
/* does the filter have a filter dispatch */
|
||||
if (Factory->FilterDescriptor->Dispatch)
|
||||
{
|
||||
/* driver failed to initialize */
|
||||
DPRINT1("Driver: Status %x\n", Status);
|
||||
/* 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);
|
||||
|
||||
/* remove filter instance from filter factory */
|
||||
iface->lpVtbl->RemoveFilterInstance(iface, (IKsFilter*)&This->lpVtbl);
|
||||
if (!NT_SUCCESS(Status) && Status != STATUS_PENDING)
|
||||
{
|
||||
/* driver failed to initialize */
|
||||
DPRINT1("Driver: Status %x\n", Status);
|
||||
|
||||
/* free filter instance */
|
||||
FreeItem(This);
|
||||
FreeItem(CreateItem);
|
||||
return 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 */
|
||||
|
|
Loading…
Reference in a new issue