Author: janderwald
Date: Wed Mar 31 19:33:49 2010
New Revision: 46625
URL:
http://svn.reactos.org/svn/reactos?rev=46625&view=rev
Log:
[KS]
- Enable registered device interfaces when device successfully initializes
- Fix totally broken KsFilterFactorySetDeviceClassesState implementation
Modified:
trunk/reactos/drivers/ksfilter/ks/device.c
trunk/reactos/drivers/ksfilter/ks/deviceinterface.c
trunk/reactos/drivers/ksfilter/ks/filterfactory.c
trunk/reactos/drivers/ksfilter/ks/ksfunc.h
Modified: trunk/reactos/drivers/ksfilter/ks/device.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/device…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/device.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/device.c [iso-8859-1] Wed Mar 31 19:33:49 2010
@@ -231,6 +231,7 @@
{
/* set state to enabled */
Ctx->DeviceHeader->TargetState = KSTARGET_STATE_ENABLED;
+ Status = KspSetFilterFactoriesState(Ctx->DeviceHeader, TRUE);
}
/* free work item */
@@ -376,6 +377,7 @@
{
/* set state to enabled, IRP_MJ_CREATE request may now succeed */
DeviceHeader->TargetState = KSTARGET_STATE_ENABLED;
+ Status = KspSetFilterFactoriesState(DeviceHeader, TRUE);
}
}
}
Modified: trunk/reactos/drivers/ksfilter/ks/deviceinterface.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/device…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/deviceinterface.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/deviceinterface.c [iso-8859-1] Wed Mar 31 19:33:49
2010
@@ -17,6 +17,9 @@
SymEntry = (PSYMBOLIC_LINK_ENTRY)CONTAINING_RECORD(Entry, SYMBOLIC_LINK_ENTRY,
Entry);
/* set device interface state */
Status = IoSetDeviceInterfaceState(&SymEntry->SymbolicLink, Enable);
+
+ DPRINT("KspSetDeviceInterfacesState SymbolicLink %S Status %lx\n",
SymEntry->SymbolicLink.Buffer, Status, Enable);
+
/* check for success */
if (!NT_SUCCESS(Status))
return Status;
@@ -95,4 +98,34 @@
return Status;
}
+NTSTATUS
+KspSetFilterFactoriesState(
+ IN PKSIDEVICE_HEADER DeviceHeader,
+ IN BOOLEAN NewState)
+{
+ PCREATE_ITEM_ENTRY CreateEntry;
+ PLIST_ENTRY Entry;
+ NTSTATUS Status = STATUS_SUCCESS;
+ /* grab first device interface */
+ Entry = DeviceHeader->ItemList.Flink;
+ while(Entry != &DeviceHeader->ItemList && Status == STATUS_SUCCESS)
+ {
+ /* grab create entry */
+ CreateEntry = CONTAINING_RECORD(Entry, CREATE_ITEM_ENTRY, Entry);
+
+ /* sanity check */
+ ASSERT(CreateEntry->CreateItem);
+
+ if (CreateEntry->CreateItem->Create == IKsFilterFactory_Create)
+ {
+ /* found our own filterfactory */
+ Status =
KsFilterFactorySetDeviceClassesState((PKSFILTERFACTORY)CreateEntry->CreateItem->Context,
NewState);
+ }
+
+ Entry = Entry->Flink;
+ }
+
+ /* store result */
+ return Status;
+}
Modified: trunk/reactos/drivers/ksfilter/ks/filterfactory.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/filter…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/filterfactory.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/filterfactory.c [iso-8859-1] Wed Mar 31 19:33:49
2010
@@ -398,8 +398,10 @@
IN PKSFILTERFACTORY FilterFactory,
IN BOOLEAN NewState)
{
- IKsFilterFactory * Factory = (IKsFilterFactory*)CONTAINING_RECORD(FilterFactory,
IKsFilterFactoryImpl, FilterFactory);
-
+ IKsFilterFactory * Factory;
+ IKsFilterFactoryImpl * This = (IKsFilterFactoryImpl*)CONTAINING_RECORD(FilterFactory,
IKsFilterFactoryImpl, FilterFactory);
+
+ Factory = (IKsFilterFactory*)&This->lpVtbl;
return Factory->lpVtbl->SetDeviceClassesState(Factory, NewState);
}
Modified: trunk/reactos/drivers/ksfilter/ks/ksfunc.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/ksfilter/ks/ksfunc…
==============================================================================
--- trunk/reactos/drivers/ksfilter/ks/ksfunc.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/ksfilter/ks/ksfunc.h [iso-8859-1] Wed Mar 31 19:33:49 2010
@@ -144,3 +144,15 @@
IN const KSPROPERTY_SET* PropertySet,
IN PFNKSALLOCATOR Allocator OPTIONAL,
IN ULONG PropertyItemSize OPTIONAL);
+
+NTSTATUS
+NTAPI
+IKsFilterFactory_Create(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp);
+
+NTSTATUS
+KspSetFilterFactoriesState(
+ IN PKSIDEVICE_HEADER DeviceHeader,
+ IN BOOLEAN NewState);
+