[ros-diffs] [janderwald] 49593: [PORTCLS] - Implement support for IPinCount interface - Add informal debug print

janderwald at svn.reactos.org janderwald at svn.reactos.org
Mon Nov 15 09:09:42 UTC 2010


Author: janderwald
Date: Mon Nov 15 09:09:42 2010
New Revision: 49593

URL: http://svn.reactos.org/svn/reactos?rev=49593&view=rev
Log:
[PORTCLS]
- Implement support for IPinCount interface
- Add informal debug print

Modified:
    branches/audio-bringup/drivers/wdm/audio/backpln/portcls/propertyhandler.cpp
    branches/audio-bringup/drivers/wdm/audio/backpln/portcls/undoc.cpp

Modified: branches/audio-bringup/drivers/wdm/audio/backpln/portcls/propertyhandler.cpp
URL: http://svn.reactos.org/svn/reactos/branches/audio-bringup/drivers/wdm/audio/backpln/portcls/propertyhandler.cpp?rev=49593&r1=49592&r2=49593&view=diff
==============================================================================
--- branches/audio-bringup/drivers/wdm/audio/backpln/portcls/propertyhandler.cpp [iso-8859-1] (original)
+++ branches/audio-bringup/drivers/wdm/audio/backpln/portcls/propertyhandler.cpp [iso-8859-1] Mon Nov 15 09:09:42 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: branches/audio-bringup/drivers/wdm/audio/backpln/portcls/undoc.cpp
URL: http://svn.reactos.org/svn/reactos/branches/audio-bringup/drivers/wdm/audio/backpln/portcls/undoc.cpp?rev=49593&r1=49592&r2=49593&view=diff
==============================================================================
--- branches/audio-bringup/drivers/wdm/audio/backpln/portcls/undoc.cpp [iso-8859-1] (original)
+++ branches/audio-bringup/drivers/wdm/audio/backpln/portcls/undoc.cpp [iso-8859-1] Mon Nov 15 09:09:42 2010
@@ -280,6 +280,7 @@
                 PropertyRequest->PropertyItem->Handler, PropertyRequest, PropertyRequest->PropertyItem->Flags, PropertyRequest->PropertyItem->Id);
 #if 1
         Status = PropertyRequest->PropertyItem->Handler(PropertyRequest);
+        DPRINT1("Status %lx ValueSize %lu Information %lu\n", Status, PropertyRequest->ValueSize, Irp->IoStatus.Information);
 #else
         Status = STATUS_NOT_FOUND;
 #endif




More information about the Ros-diffs mailing list