Author: janderwald
Date: Thu Jul 2 11:58:06 2009
New Revision: 41738
URL:
http://svn.reactos.org/svn/reactos?rev=41738&view=rev
Log:
- Register a device interface for each stream
Modified:
trunk/reactos/drivers/wdm/audio/legacy/stream/filter.c
Modified: trunk/reactos/drivers/wdm/audio/legacy/stream/filter.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/legacy/s…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/legacy/stream/filter.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/legacy/stream/filter.c [iso-8859-1] Thu Jul 2
11:58:06 2009
@@ -90,6 +90,45 @@
NULL,
NULL
};
+
+VOID
+RegisterDeviceInterfaces(
+ IN PSTREAM_DEVICE_EXTENSION DeviceExtension)
+{
+ ULONG Index;
+ PHW_STREAM_INFORMATION StreamInformation;
+ UNICODE_STRING SymbolicLink;
+ NTSTATUS Status;
+
+ /* Sanity check */
+ ASSERT(DeviceExtension->StreamDescriptor);
+ ASSERT(DeviceExtension->StreamDescriptorSize);
+
+ /* Loop all stream descriptors and register device interfaces */
+ StreamInformation =
(PHW_STREAM_INFORMATION)&DeviceExtension->StreamDescriptor->StreamInfo;
+
+ for(Index = 0; DeviceExtension->StreamDescriptor->StreamHeader.NumberOfStreams;
Index++)
+ {
+ if (StreamInformation->Category)
+ {
+ /* Register device interface */
+ Status = IoRegisterDeviceInterface(DeviceExtension->PhysicalDeviceObject,
+ StreamInformation->Category,
+ NULL, /* see bug 4566 */
+ &SymbolicLink);
+
+ if (NT_SUCCESS(Status))
+ {
+ /* Activate device interface */
+ IoSetDeviceInterfaceState(&SymbolicLink, TRUE);
+ /* Release Symbolic Link */
+ RtlFreeUnicodeString(&SymbolicLink);
+ }
+ }
+ StreamInformation = (PHW_STREAM_INFORMATION) (ULONG_PTR)StreamInformation +
DeviceExtension->StreamDescriptor->StreamHeader.SizeOfHwStreamInformation;
+ }
+
+}
NTSTATUS
InitializeFilterWithKs(
@@ -189,6 +228,10 @@
/* Increment total instance count */
InterlockedIncrement(&DeviceExtension->InstanceCount);
+
+ /* Register device stream interfaces */
+ RegisterDeviceInterfaces(DeviceExtension);
+
/* Return result */
return Status;