- Remove obsolete code
[reactos.git] / reactos / drivers / wdm / audio / backpln / portcls / port_wavecyclic.cpp
index 77e1ecd..3262b5f 100644 (file)
@@ -39,10 +39,8 @@ public:
     virtual ~CPortWaveCyclic(){}
 
 protected:
-    BOOL m_bInitialized;
     PDEVICE_OBJECT m_pDeviceObject;
     PMINIPORTWAVECYCLIC m_pMiniport;
-    PRESOURCELIST m_pResourceList;
     PPINCOUNT m_pPinCount;
     PPOWERNOTIFY m_pPowerNotify;
     PPCFILTER_DESCRIPTOR m_pDescriptor;
@@ -59,6 +57,10 @@ GUID KSPROPERTY_SETID_Topology                = {0x720D4AC0L, 0x7533, 0x11D0, {0
 
 static GUID InterfaceGuids[4] = 
 {
+    {
+         //KS_CATEGORY_AUDIO
+        0x6994AD04, 0x93EF, 0x11D0, {0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
+    },
     {
         /// KSCATEGORY_RENDER
         0x65E8773EL, 0x8F56, 0x11D0, {0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
@@ -67,10 +69,6 @@ static GUID InterfaceGuids[4] =
         /// KSCATEGORY_CAPTURE
         0x65E8773DL, 0x8F56, 0x11D0, {0xA3, 0xB9, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
     },
-    {
-         //KS_CATEGORY_AUDIO
-        0x6994AD04, 0x93EF, 0x11D0, {0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
-    },
     {
         ///KSCATEGORY_AUDIO_DEVICE
         0xFBF6F530L, 0x07B9, 0x11D2, {0xA7, 0x1E, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88}
@@ -181,7 +179,7 @@ CPortWaveCyclic::QueryInterface(
 
     if (RtlStringFromGUID(refiid, &GuidString) == STATUS_SUCCESS)
     {
-        DPRINT1("IPortWaveCyclic_fnQueryInterface no interface!!! iface %S\n", GuidString.Buffer);
+        DPRINT("IPortWaveCyclic_fnQueryInterface no interface!!! iface %S\n", GuidString.Buffer);
         RtlFreeUnicodeString(&GuidString);
     }
 
@@ -202,12 +200,6 @@ CPortWaveCyclic::GetDeviceProperty(
 {
     PC_ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
 
-    if (!m_bInitialized)
-    {
-        DPRINT("IPortWaveCyclic_fnNewRegistryKey called w/o initiazed\n");
-        return STATUS_UNSUCCESSFUL;
-    }
-
     return IoGetDeviceProperty(m_pDeviceObject, DeviceRegistryProperty, BufferLength, PropertyBuffer, ReturnLength);
 }
 
@@ -228,12 +220,6 @@ CPortWaveCyclic::Init(
     DPRINT("IPortWaveCyclic_Init entered %p\n", this);
     PC_ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
 
-    if (m_bInitialized)
-    {
-        DPRINT("IPortWaveCyclic_Init called again\n");
-        return STATUS_SUCCESS;
-    }
-
     Status = UnknownMiniport->QueryInterface(IID_IMiniportWaveCyclic, (PVOID*)&Miniport);
     if (!NT_SUCCESS(Status))
     {
@@ -244,22 +230,13 @@ CPortWaveCyclic::Init(
     // Initialize port object
     m_pMiniport = Miniport;
     m_pDeviceObject = DeviceObject;
-    m_bInitialized = TRUE;
-    m_pResourceList = ResourceList;
-
-
-    if (ResourceList)
-    {
-        // increment reference on resource list
-        ResourceList->AddRef();
-    }
 
+    // initialize miniport
     Status = Miniport->Init(UnknownAdapter, ResourceList, this);
     if (!NT_SUCCESS(Status))
     {
         DPRINT("IMiniportWaveCyclic_Init failed with %x\n", Status);
         Miniport->Release();
-        m_bInitialized = FALSE;
         return Status;
     }
 
@@ -268,19 +245,18 @@ CPortWaveCyclic::Init(
     Status = Miniport->GetDescription(&m_pDescriptor);
     if (!NT_SUCCESS(Status))
     {
-        DPRINT1("failed to get description\n");
+        DPRINT("failed to get description\n");
         Miniport->Release();
-        m_bInitialized = FALSE;
         return Status;
     }
 
     // create the subdevice descriptor
-    Status = PcCreateSubdeviceDescriptor(&m_SubDeviceDescriptor, 
+    Status = PcCreateSubdeviceDescriptor(&m_SubDeviceDescriptor,
                                          4,
                                          InterfaceGuids,
-                                         0, 
+                                         0,
                                          NULL,
-                                         2, 
+                                         2,
                                          WaveCyclicPropertySet,
                                          0,
                                          0,
@@ -292,9 +268,8 @@ CPortWaveCyclic::Init(
 
     if (!NT_SUCCESS(Status))
     {
-        DPRINT1("PcCreateSubdeviceDescriptor failed with %x\n", Status);
+        DPRINT("PcCreateSubdeviceDescriptor failed with %x\n", Status);
         Miniport->Release();
-        m_bInitialized = FALSE;
         return Status;
     }
 
@@ -335,12 +310,7 @@ CPortWaveCyclic::NewRegistryKey(
 {
     PC_ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
 
-    if (!m_bInitialized)
-    {
-        DPRINT("IPortWaveCyclic_fnNewRegistryKey called w/o initialized\n");
-        return STATUS_UNSUCCESSFUL;
-    }
-    return PcNewRegistryKey(OutRegistryKey, OuterUnknown, RegistryKeyType, DesiredAccess, m_pDeviceObject, NULL /*FIXME*/, ObjectAttributes, CreateOptions, Disposition);
+    return PcNewRegistryKey(OutRegistryKey, OuterUnknown, RegistryKeyType, DesiredAccess, m_pDeviceObject, (ISubdevice*)this, ObjectAttributes, CreateOptions, Disposition);
 }
 
 
@@ -355,8 +325,8 @@ CPortWaveCyclic::NewMasterDmaChannel(
     IN  PUNKNOWN OuterUnknown,
     IN  PRESOURCELIST ResourceList OPTIONAL,
     IN  ULONG MaximumLength,
-    IN  BOOL Dma32BitAddresses,
-    IN  BOOL Dma64BitAddresses,
+    IN  BOOLEAN Dma32BitAddresses,
+    IN  BOOLEAN Dma64BitAddresses,
     IN  DMA_WIDTH DmaWidth,
     IN  DMA_SPEED DmaSpeed)
 {
@@ -365,12 +335,6 @@ CPortWaveCyclic::NewMasterDmaChannel(
 
     PC_ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
 
-    if (!m_bInitialized)
-    {
-        DPRINT("IPortWaveCyclic_fnNewSlaveDmaChannel called w/o initialized\n");
-        return STATUS_UNSUCCESSFUL;
-    }
-
     Status = PcDmaMasterDescription(ResourceList, (Dma32BitAddresses | Dma64BitAddresses), Dma32BitAddresses, 0, Dma64BitAddresses, DmaWidth, DmaSpeed, MaximumLength, 0, &DeviceDescription);
     if (NT_SUCCESS(Status))
     {
@@ -388,7 +352,7 @@ CPortWaveCyclic::NewSlaveDmaChannel(
     IN  PRESOURCELIST ResourceList OPTIONAL,
     IN  ULONG DmaIndex,
     IN  ULONG MaximumLength,
-    IN  BOOL DemandMode,
+    IN  BOOLEAN DemandMode,
     IN  DMA_SPEED DmaSpeed)
 {
     DEVICE_DESCRIPTION DeviceDescription;
@@ -397,12 +361,6 @@ CPortWaveCyclic::NewSlaveDmaChannel(
 
     PC_ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
 
-    if (!m_bInitialized)
-    {
-        DPRINT("IPortWaveCyclic_fnNewSlaveDmaChannel called w/o initialized\n");
-        return STATUS_UNSUCCESSFUL;
-    }
-
     // FIXME
     // Check for F-Type DMA Support
     //
@@ -437,7 +395,7 @@ NTSTATUS
 NTAPI
 CPortWaveCyclic::NewIrpTarget(
     OUT struct IIrpTarget **OutTarget,
-    IN WCHAR * Name,
+    IN PCWSTR Name,
     IN PUNKNOWN Unknown,
     IN POOL_TYPE PoolType,
     IN PDEVICE_OBJECT DeviceObject,