2014-01-29 10:59:06 +00:00
|
|
|
#include "precomp.h"
|
allocators.c
- Implement IKsAllocator interface and use it in new implemented KsCreateAllocator, KsCreateDefaultAllocatorEx, KsValidateAllocatorFramingEx
api.c
- Implement KsSetDevicePnpAndBaseObject, KsQueryDevicePnpObject, KsSetTargetState, KsSetTargetDeviceObject, KsSetPowerDispatch, KsFreeDeviceHeader, KsFreeObjectHeader, KsAllocateObjectCreateItem, KsFreeObjectCreateItem, KsFreeObjectCreateItemsByContext, KsCreateDefaultSecurity
clocks.c
- Implement KsCreateClock, KsCreateDefaultClock, partly implement KsAllocateDefaultClockEx, KsFreeDefaultClock, KsGetDefaultClockState, KsSetDefaultClockState, KsGetDefaultClockTime, KsSetDefaultClockTime
device.c
- Partly implement IKsDevice interface in order to let AVStream client devices initialize
- Implement KsInitializeDevice
- Implement registering of device interface for AVStream drivers
driver.c
- Implement KsGetDeviceForDeviceObject
- Set device flags for ks
- Store Address for client drivers device extension
filter.c
- Implement IKsFilter & IKsControl interface
- Handle KSPROPERTY requests
filterfactory.c
- Implement IKsFilterFactory interface
- Implement KsCreateFilterFactory, KsFilterFactorySetDeviceClassesState, KsFilterFactoryGetSymbolicLink, KsFilterFactoryAddCreateItem
- Add KsFilterFactoryUpdateCacheData
image.c
- Implement KsLoadResource
irp.c
- Implement KsDispatchQuerySecurity, KsDispatchSetSecurity, KsWriteFile, KsDefaultIoCompletion
svn path=/trunk/; revision=42109
2009-07-20 23:26:57 +00:00
|
|
|
|
2014-01-02 11:34:12 +00:00
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
|
allocators.c
- Implement IKsAllocator interface and use it in new implemented KsCreateAllocator, KsCreateDefaultAllocatorEx, KsValidateAllocatorFramingEx
api.c
- Implement KsSetDevicePnpAndBaseObject, KsQueryDevicePnpObject, KsSetTargetState, KsSetTargetDeviceObject, KsSetPowerDispatch, KsFreeDeviceHeader, KsFreeObjectHeader, KsAllocateObjectCreateItem, KsFreeObjectCreateItem, KsFreeObjectCreateItemsByContext, KsCreateDefaultSecurity
clocks.c
- Implement KsCreateClock, KsCreateDefaultClock, partly implement KsAllocateDefaultClockEx, KsFreeDefaultClock, KsGetDefaultClockState, KsSetDefaultClockState, KsGetDefaultClockTime, KsSetDefaultClockTime
device.c
- Partly implement IKsDevice interface in order to let AVStream client devices initialize
- Implement KsInitializeDevice
- Implement registering of device interface for AVStream drivers
driver.c
- Implement KsGetDeviceForDeviceObject
- Set device flags for ks
- Store Address for client drivers device extension
filter.c
- Implement IKsFilter & IKsControl interface
- Handle KSPROPERTY requests
filterfactory.c
- Implement IKsFilterFactory interface
- Implement KsCreateFilterFactory, KsFilterFactorySetDeviceClassesState, KsFilterFactoryGetSymbolicLink, KsFilterFactoryAddCreateItem
- Add KsFilterFactoryUpdateCacheData
image.c
- Implement KsLoadResource
irp.c
- Implement KsDispatchQuerySecurity, KsDispatchSetSecurity, KsWriteFile, KsDefaultIoCompletion
svn path=/trunk/; revision=42109
2009-07-20 23:26:57 +00:00
|
|
|
NTSTATUS
|
|
|
|
KspSetDeviceInterfacesState(
|
|
|
|
IN PLIST_ENTRY ListHead,
|
|
|
|
IN BOOL Enable)
|
|
|
|
{
|
|
|
|
NTSTATUS Status = STATUS_SUCCESS;
|
|
|
|
PLIST_ENTRY Entry;
|
|
|
|
PSYMBOLIC_LINK_ENTRY SymEntry;
|
|
|
|
|
|
|
|
|
|
|
|
Entry = ListHead->Flink;
|
|
|
|
while(Entry != ListHead)
|
|
|
|
{
|
|
|
|
/* fetch symbolic link entry */
|
|
|
|
SymEntry = (PSYMBOLIC_LINK_ENTRY)CONTAINING_RECORD(Entry, SYMBOLIC_LINK_ENTRY, Entry);
|
|
|
|
/* set device interface state */
|
|
|
|
Status = IoSetDeviceInterfaceState(&SymEntry->SymbolicLink, Enable);
|
2010-03-31 17:33:49 +00:00
|
|
|
|
2010-04-01 03:14:45 +00:00
|
|
|
DPRINT("KspSetDeviceInterfacesState SymbolicLink '%S' Status %lx\n", SymEntry->SymbolicLink.Buffer, Status, Enable);
|
2010-03-31 17:33:49 +00:00
|
|
|
|
allocators.c
- Implement IKsAllocator interface and use it in new implemented KsCreateAllocator, KsCreateDefaultAllocatorEx, KsValidateAllocatorFramingEx
api.c
- Implement KsSetDevicePnpAndBaseObject, KsQueryDevicePnpObject, KsSetTargetState, KsSetTargetDeviceObject, KsSetPowerDispatch, KsFreeDeviceHeader, KsFreeObjectHeader, KsAllocateObjectCreateItem, KsFreeObjectCreateItem, KsFreeObjectCreateItemsByContext, KsCreateDefaultSecurity
clocks.c
- Implement KsCreateClock, KsCreateDefaultClock, partly implement KsAllocateDefaultClockEx, KsFreeDefaultClock, KsGetDefaultClockState, KsSetDefaultClockState, KsGetDefaultClockTime, KsSetDefaultClockTime
device.c
- Partly implement IKsDevice interface in order to let AVStream client devices initialize
- Implement KsInitializeDevice
- Implement registering of device interface for AVStream drivers
driver.c
- Implement KsGetDeviceForDeviceObject
- Set device flags for ks
- Store Address for client drivers device extension
filter.c
- Implement IKsFilter & IKsControl interface
- Handle KSPROPERTY requests
filterfactory.c
- Implement IKsFilterFactory interface
- Implement KsCreateFilterFactory, KsFilterFactorySetDeviceClassesState, KsFilterFactoryGetSymbolicLink, KsFilterFactoryAddCreateItem
- Add KsFilterFactoryUpdateCacheData
image.c
- Implement KsLoadResource
irp.c
- Implement KsDispatchQuerySecurity, KsDispatchSetSecurity, KsWriteFile, KsDefaultIoCompletion
svn path=/trunk/; revision=42109
2009-07-20 23:26:57 +00:00
|
|
|
/* check for success */
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
return Status;
|
|
|
|
/* get next entry */
|
|
|
|
Entry = Entry->Flink;
|
|
|
|
}
|
|
|
|
/* return result */
|
|
|
|
return Status;
|
|
|
|
}
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
KspFreeDeviceInterfaces(
|
|
|
|
IN PLIST_ENTRY ListHead)
|
|
|
|
{
|
|
|
|
PLIST_ENTRY Entry;
|
|
|
|
PSYMBOLIC_LINK_ENTRY SymEntry;
|
|
|
|
|
|
|
|
while(!IsListEmpty(ListHead))
|
|
|
|
{
|
|
|
|
/* remove first entry */
|
|
|
|
Entry = RemoveHeadList(ListHead);
|
|
|
|
|
|
|
|
/* fetch symbolic link entry */
|
|
|
|
SymEntry = (PSYMBOLIC_LINK_ENTRY)CONTAINING_RECORD(Entry, SYMBOLIC_LINK_ENTRY, Entry);
|
|
|
|
|
|
|
|
/* free device interface string */
|
|
|
|
RtlFreeUnicodeString(&SymEntry->SymbolicLink);
|
|
|
|
/* free entry item */
|
|
|
|
FreeItem(Entry);
|
|
|
|
}
|
|
|
|
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
KspRegisterDeviceInterfaces(
|
|
|
|
IN PDEVICE_OBJECT PhysicalDeviceObject,
|
|
|
|
IN ULONG CategoriesCount,
|
|
|
|
IN GUID const*Categories,
|
|
|
|
IN PUNICODE_STRING ReferenceString,
|
|
|
|
OUT PLIST_ENTRY SymbolicLinkList)
|
|
|
|
{
|
|
|
|
ULONG Index;
|
|
|
|
NTSTATUS Status = STATUS_SUCCESS;
|
|
|
|
PSYMBOLIC_LINK_ENTRY SymEntry;
|
|
|
|
|
|
|
|
for(Index = 0; Index < CategoriesCount; Index++)
|
|
|
|
{
|
|
|
|
/* allocate a symbolic link entry */
|
|
|
|
SymEntry = AllocateItem(NonPagedPool, sizeof(SYMBOLIC_LINK_ENTRY));
|
|
|
|
/* check for success */
|
|
|
|
if (!SymEntry)
|
|
|
|
return STATUS_INSUFFICIENT_RESOURCES;
|
|
|
|
|
|
|
|
/* now register device interface */
|
2021-06-11 12:29:21 +00:00
|
|
|
Status = IoRegisterDeviceInterface(PhysicalDeviceObject,
|
allocators.c
- Implement IKsAllocator interface and use it in new implemented KsCreateAllocator, KsCreateDefaultAllocatorEx, KsValidateAllocatorFramingEx
api.c
- Implement KsSetDevicePnpAndBaseObject, KsQueryDevicePnpObject, KsSetTargetState, KsSetTargetDeviceObject, KsSetPowerDispatch, KsFreeDeviceHeader, KsFreeObjectHeader, KsAllocateObjectCreateItem, KsFreeObjectCreateItem, KsFreeObjectCreateItemsByContext, KsCreateDefaultSecurity
clocks.c
- Implement KsCreateClock, KsCreateDefaultClock, partly implement KsAllocateDefaultClockEx, KsFreeDefaultClock, KsGetDefaultClockState, KsSetDefaultClockState, KsGetDefaultClockTime, KsSetDefaultClockTime
device.c
- Partly implement IKsDevice interface in order to let AVStream client devices initialize
- Implement KsInitializeDevice
- Implement registering of device interface for AVStream drivers
driver.c
- Implement KsGetDeviceForDeviceObject
- Set device flags for ks
- Store Address for client drivers device extension
filter.c
- Implement IKsFilter & IKsControl interface
- Handle KSPROPERTY requests
filterfactory.c
- Implement IKsFilterFactory interface
- Implement KsCreateFilterFactory, KsFilterFactorySetDeviceClassesState, KsFilterFactoryGetSymbolicLink, KsFilterFactoryAddCreateItem
- Add KsFilterFactoryUpdateCacheData
image.c
- Implement KsLoadResource
irp.c
- Implement KsDispatchQuerySecurity, KsDispatchSetSecurity, KsWriteFile, KsDefaultIoCompletion
svn path=/trunk/; revision=42109
2009-07-20 23:26:57 +00:00
|
|
|
&Categories[Index],
|
2009-08-21 10:06:29 +00:00
|
|
|
ReferenceString,
|
allocators.c
- Implement IKsAllocator interface and use it in new implemented KsCreateAllocator, KsCreateDefaultAllocatorEx, KsValidateAllocatorFramingEx
api.c
- Implement KsSetDevicePnpAndBaseObject, KsQueryDevicePnpObject, KsSetTargetState, KsSetTargetDeviceObject, KsSetPowerDispatch, KsFreeDeviceHeader, KsFreeObjectHeader, KsAllocateObjectCreateItem, KsFreeObjectCreateItem, KsFreeObjectCreateItemsByContext, KsCreateDefaultSecurity
clocks.c
- Implement KsCreateClock, KsCreateDefaultClock, partly implement KsAllocateDefaultClockEx, KsFreeDefaultClock, KsGetDefaultClockState, KsSetDefaultClockState, KsGetDefaultClockTime, KsSetDefaultClockTime
device.c
- Partly implement IKsDevice interface in order to let AVStream client devices initialize
- Implement KsInitializeDevice
- Implement registering of device interface for AVStream drivers
driver.c
- Implement KsGetDeviceForDeviceObject
- Set device flags for ks
- Store Address for client drivers device extension
filter.c
- Implement IKsFilter & IKsControl interface
- Handle KSPROPERTY requests
filterfactory.c
- Implement IKsFilterFactory interface
- Implement KsCreateFilterFactory, KsFilterFactorySetDeviceClassesState, KsFilterFactoryGetSymbolicLink, KsFilterFactoryAddCreateItem
- Add KsFilterFactoryUpdateCacheData
image.c
- Implement KsLoadResource
irp.c
- Implement KsDispatchQuerySecurity, KsDispatchSetSecurity, KsWriteFile, KsDefaultIoCompletion
svn path=/trunk/; revision=42109
2009-07-20 23:26:57 +00:00
|
|
|
&SymEntry->SymbolicLink);
|
|
|
|
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
DPRINT1("Failed to register device interface %x\n", Status);
|
|
|
|
|
|
|
|
/* free entry */
|
|
|
|
FreeItem(SymEntry);
|
|
|
|
|
|
|
|
/* return result */
|
|
|
|
return Status;
|
|
|
|
}
|
2010-04-07 21:45:25 +00:00
|
|
|
|
|
|
|
/* copy device class */
|
|
|
|
RtlMoveMemory(&SymEntry->DeviceInterfaceClass, &Categories[Index], sizeof(CLSID));
|
|
|
|
|
allocators.c
- Implement IKsAllocator interface and use it in new implemented KsCreateAllocator, KsCreateDefaultAllocatorEx, KsValidateAllocatorFramingEx
api.c
- Implement KsSetDevicePnpAndBaseObject, KsQueryDevicePnpObject, KsSetTargetState, KsSetTargetDeviceObject, KsSetPowerDispatch, KsFreeDeviceHeader, KsFreeObjectHeader, KsAllocateObjectCreateItem, KsFreeObjectCreateItem, KsFreeObjectCreateItemsByContext, KsCreateDefaultSecurity
clocks.c
- Implement KsCreateClock, KsCreateDefaultClock, partly implement KsAllocateDefaultClockEx, KsFreeDefaultClock, KsGetDefaultClockState, KsSetDefaultClockState, KsGetDefaultClockTime, KsSetDefaultClockTime
device.c
- Partly implement IKsDevice interface in order to let AVStream client devices initialize
- Implement KsInitializeDevice
- Implement registering of device interface for AVStream drivers
driver.c
- Implement KsGetDeviceForDeviceObject
- Set device flags for ks
- Store Address for client drivers device extension
filter.c
- Implement IKsFilter & IKsControl interface
- Handle KSPROPERTY requests
filterfactory.c
- Implement IKsFilterFactory interface
- Implement KsCreateFilterFactory, KsFilterFactorySetDeviceClassesState, KsFilterFactoryGetSymbolicLink, KsFilterFactoryAddCreateItem
- Add KsFilterFactoryUpdateCacheData
image.c
- Implement KsLoadResource
irp.c
- Implement KsDispatchQuerySecurity, KsDispatchSetSecurity, KsWriteFile, KsDefaultIoCompletion
svn path=/trunk/; revision=42109
2009-07-20 23:26:57 +00:00
|
|
|
/* insert symbolic link entry */
|
|
|
|
InsertTailList(SymbolicLinkList, &SymEntry->Entry);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* return result */
|
|
|
|
return Status;
|
|
|
|
}
|
|
|
|
|
2010-03-31 17:33:49 +00:00
|
|
|
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);
|
allocators.c
- Implement IKsAllocator interface and use it in new implemented KsCreateAllocator, KsCreateDefaultAllocatorEx, KsValidateAllocatorFramingEx
api.c
- Implement KsSetDevicePnpAndBaseObject, KsQueryDevicePnpObject, KsSetTargetState, KsSetTargetDeviceObject, KsSetPowerDispatch, KsFreeDeviceHeader, KsFreeObjectHeader, KsAllocateObjectCreateItem, KsFreeObjectCreateItem, KsFreeObjectCreateItemsByContext, KsCreateDefaultSecurity
clocks.c
- Implement KsCreateClock, KsCreateDefaultClock, partly implement KsAllocateDefaultClockEx, KsFreeDefaultClock, KsGetDefaultClockState, KsSetDefaultClockState, KsGetDefaultClockTime, KsSetDefaultClockTime
device.c
- Partly implement IKsDevice interface in order to let AVStream client devices initialize
- Implement KsInitializeDevice
- Implement registering of device interface for AVStream drivers
driver.c
- Implement KsGetDeviceForDeviceObject
- Set device flags for ks
- Store Address for client drivers device extension
filter.c
- Implement IKsFilter & IKsControl interface
- Handle KSPROPERTY requests
filterfactory.c
- Implement IKsFilterFactory interface
- Implement KsCreateFilterFactory, KsFilterFactorySetDeviceClassesState, KsFilterFactoryGetSymbolicLink, KsFilterFactoryAddCreateItem
- Add KsFilterFactoryUpdateCacheData
image.c
- Implement KsLoadResource
irp.c
- Implement KsDispatchQuerySecurity, KsDispatchSetSecurity, KsWriteFile, KsDefaultIoCompletion
svn path=/trunk/; revision=42109
2009-07-20 23:26:57 +00:00
|
|
|
|
2010-03-31 17:33:49 +00:00
|
|
|
if (CreateEntry->CreateItem->Create == IKsFilterFactory_Create)
|
|
|
|
{
|
|
|
|
/* found our own filterfactory */
|
|
|
|
Status = KsFilterFactorySetDeviceClassesState((PKSFILTERFACTORY)CreateEntry->CreateItem->Context, NewState);
|
|
|
|
}
|
|
|
|
|
|
|
|
Entry = Entry->Flink;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* store result */
|
|
|
|
return Status;
|
|
|
|
}
|