Author: janderwald
Date: Tue Dec 7 17:23:09 2010
New Revision: 49974
URL:
http://svn.reactos.org/svn/reactos?rev=49974&view=rev
Log:
[PORTCLS]
- Merge from the audio branch
- Fix node property handler
- Take advantage of IPinCount interface
Modified:
trunk/reactos/drivers/wdm/audio/backpln/portcls/ (props changed)
trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/undoc.cpp
Propchange: trunk/reactos/drivers/wdm/audio/backpln/portcls/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Dec 7 17:23:09 2010
@@ -1,0 +1,1 @@
+/branches/audio-bringup/drivers/wdm/audio/backpln/portcls:49194-49973
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.cpp [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.cpp [iso-8859-1] Tue
Dec 7 17:23:09 2010
@@ -14,10 +14,13 @@
IN PKSIDENTIFIER Request,
IN OUT PVOID Data,
IN PSUBDEVICE_DESCRIPTOR Descriptor,
- IN BOOL Global)
+ IN BOOL Global,
+ IN ISubdevice *SubDevice)
{
KSPIN_CINSTANCES * Instances;
KSP_PIN * Pin = (KSP_PIN*)Request;
+ ULONG FilterNecessary, FilterCurrent, FilterPossible, GlobalCurrent, GlobalPossible;
+ NTSTATUS Status;
if (Pin->PinId >= Descriptor->Factory.PinDescriptorCount)
{
@@ -28,12 +31,31 @@
Instances = (KSPIN_CINSTANCES*)Data;
- if (Global)
- Instances->PossibleCount =
Descriptor->Factory.Instances[Pin->PinId].MaxGlobalInstanceCount;
+ // check if the miniport supports the IPinCount interface
+ Status = SubDevice->PinCount(Pin->PinId, &FilterNecessary,
&FilterCurrent, &FilterPossible, &GlobalCurrent, &GlobalPossible);
+
+ if (NT_SUCCESS(Status))
+ {
+ if (Global)
+ {
+ Instances->PossibleCount = GlobalPossible;
+ Instances->CurrentCount = GlobalCurrent;
+ }
+ else
+ {
+ Instances->PossibleCount = FilterPossible;
+ Instances->CurrentCount = FilterCurrent;
+ }
+ }
else
- Instances->PossibleCount =
Descriptor->Factory.Instances[Pin->PinId].MaxFilterInstanceCount;
-
- Instances->CurrentCount =
Descriptor->Factory.Instances[Pin->PinId].CurrentPinInstanceCount;
+ {
+ if (Global)
+ Instances->PossibleCount =
Descriptor->Factory.Instances[Pin->PinId].MaxGlobalInstanceCount;
+ else
+ Instances->PossibleCount =
Descriptor->Factory.Instances[Pin->PinId].MaxFilterInstanceCount;
+
+ Instances->CurrentCount =
Descriptor->Factory.Instances[Pin->PinId].CurrentPinInstanceCount;
+ }
IoStatus->Information = sizeof(KSPIN_CINSTANCES);
IoStatus->Status = STATUS_SUCCESS;
@@ -45,10 +67,13 @@
IN PIO_STATUS_BLOCK IoStatus,
IN PKSIDENTIFIER Request,
IN OUT PVOID Data,
- IN PSUBDEVICE_DESCRIPTOR Descriptor)
+ IN PSUBDEVICE_DESCRIPTOR Descriptor,
+ IN ISubdevice *SubDevice)
{
PULONG Result;
KSP_PIN * Pin = (KSP_PIN*)Request;
+ ULONG FilterNecessary, FilterCurrent, FilterPossible, GlobalCurrent, GlobalPossible;
+ NTSTATUS Status;
if (Pin->PinId >= Descriptor->Factory.PinDescriptorCount)
{
@@ -58,7 +83,19 @@
}
Result = (PULONG)Data;
- *Result = Descriptor->Factory.Instances[Pin->PinId].MinFilterInstanceCount;
+
+
+ // check if the miniport supports the IPinCount interface
+ Status = SubDevice->PinCount(Pin->PinId, &FilterNecessary,
&FilterCurrent, &FilterPossible, &GlobalCurrent, &GlobalPossible);
+
+ if (NT_SUCCESS(Status))
+ {
+ *Result = FilterNecessary;
+ }
+ else
+ {
+ *Result =
Descriptor->Factory.Instances[Pin->PinId].MinFilterInstanceCount;
+ }
IoStatus->Information = sizeof(ULONG);
IoStatus->Status = STATUS_SUCCESS;
@@ -236,13 +273,13 @@
Status = KsPinPropertyHandler(Irp, Request, Data,
Descriptor->Factory.PinDescriptorCount, Descriptor->Factory.KsPinDescriptor);
break;
case KSPROPERTY_PIN_GLOBALCINSTANCES:
- Status = HandlePropertyInstances(&Irp->IoStatus, Request, Data,
Descriptor, TRUE);
+ Status = HandlePropertyInstances(&Irp->IoStatus, Request, Data,
Descriptor, TRUE, SubDevice);
break;
case KSPROPERTY_PIN_CINSTANCES:
- Status = HandlePropertyInstances(&Irp->IoStatus, Request, Data,
Descriptor, FALSE);
+ Status = HandlePropertyInstances(&Irp->IoStatus, Request, Data,
Descriptor, FALSE, SubDevice);
break;
case KSPROPERTY_PIN_NECESSARYINSTANCES:
- Status = HandleNecessaryPropertyInstances(&Irp->IoStatus, Request,
Data, Descriptor);
+ Status = HandleNecessaryPropertyInstances(&Irp->IoStatus, Request,
Data, Descriptor, SubDevice);
break;
case KSPROPERTY_PIN_DATAINTERSECTION:
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/undoc.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/undoc.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/undoc.cpp [iso-8859-1] Tue Dec 7
17:23:09 2010
@@ -165,7 +165,7 @@
// get instance / value size
InstanceSize = IoStack->Parameters.DeviceIoControl.InputBufferLength;
- Instance = Data;
+ Instance = Request;
ValueSize = IoStack->Parameters.DeviceIoControl.OutputBufferLength;
// initialize property request
@@ -273,17 +273,15 @@
if (PropertyRequest->PropertyItem &&
PropertyRequest->PropertyItem->Handler)
{
// now call the handler
- UNICODE_STRING GuidBuffer;
- RtlStringFromGUID(Property->Set, &GuidBuffer);
- DPRINT1("Calling Node %lu MajorTarget %p MinorTarget %p PropertySet %S
PropertyId %lu PropertyFlags %lx InstanceSize %lu ValueSize %lu Handler %p PropertyRequest
%p\n",
- PropertyRequest->Node, PropertyRequest->MajorTarget,
PropertyRequest->MinorTarget, GuidBuffer.Buffer, Property->Id, Property->Flags,
PropertyRequest->InstanceSize, PropertyRequest->ValueSize,
- PropertyRequest->PropertyItem->Handler, PropertyRequest);
-#if 0
+ //UNICODE_STRING GuidBuffer;
+ //RtlStringFromGUID(Property->Set, &GuidBuffer);
+ //DPRINT("Calling Node %lu MajorTarget %p MinorTarget %p PropertySet %S
PropertyId %lu PropertyFlags %lx InstanceSize %lu ValueSize %lu Handler %p PropertyRequest
%p PropertyItemFlags %lx PropertyItemId %lu\n",
+ // PropertyRequest->Node, PropertyRequest->MajorTarget,
PropertyRequest->MinorTarget, GuidBuffer.Buffer, Property->Id, Property->Flags,
PropertyRequest->InstanceSize, PropertyRequest->ValueSize,
+ // PropertyRequest->PropertyItem->Handler, PropertyRequest,
PropertyRequest->PropertyItem->Flags, PropertyRequest->PropertyItem->Id);
+
Status = PropertyRequest->PropertyItem->Handler(PropertyRequest);
-#else
- Status = STATUS_NOT_FOUND;
-#endif
- Irp->IoStatus.Information = PropertyRequest->ValueSize;
+ //DPRINT("Status %lx ValueSize %lu Information %lu\n", Status,
PropertyRequest->ValueSize, Irp->IoStatus.Information);
+ Irp->IoStatus.Information = PropertyRequest->ValueSize;
if (Status != STATUS_PENDING)
{