- Fix debugging flood
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Wed, 14 Oct 2009 18:09:28 +0000 (18:09 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Wed, 14 Oct 2009 18:09:28 +0000 (18:09 +0000)
- Pass correct flags to KsProbeStreamIrp
- Remove dead code

svn path=/trunk/; revision=43463

reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp
reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp
reactos/drivers/wdm/audio/backpln/portcls/port.hpp [deleted file]
reactos/drivers/wdm/audio/backpln/portcls/port_factory.cpp [deleted file]

index e96c89e..358d1ea 100644 (file)
@@ -118,7 +118,10 @@ CIrpQueue::AddMapping(
         // ioctl from KsStudio
         // Wdmaud already probes buffers, therefore no need to probe it again
         // probe the stream irp
         // ioctl from KsStudio
         // Wdmaud already probes buffers, therefore no need to probe it again
         // probe the stream irp
-        Status = KsProbeStreamIrp(Irp, KSSTREAM_READ | KSPROBE_ALLOCATEMDL | KSPROBE_PROBEANDLOCK | KSPROBE_ALLOWFORMATCHANGE | KSPROBE_SYSTEMADDRESS, 0);
+        if (IoStack->Parameters.DeviceIoControl.IoControlCode == IOCTL_KS_WRITE_STREAM)
+            Status = KsProbeStreamIrp(Irp, KSSTREAM_WRITE | KSPROBE_ALLOCATEMDL | KSPROBE_PROBEANDLOCK | KSPROBE_ALLOWFORMATCHANGE | KSPROBE_SYSTEMADDRESS, 0);
+        else
+            Status = KsProbeStreamIrp(Irp, KSSTREAM_READ| KSPROBE_ALLOCATEMDL | KSPROBE_PROBEANDLOCK | KSPROBE_ALLOWFORMATCHANGE | KSPROBE_SYSTEMADDRESS, 0);
 
         // check for success
         if (!NT_SUCCESS(Status))
 
         // check for success
         if (!NT_SUCCESS(Status))
@@ -200,8 +203,7 @@ CIrpQueue::GetMapping(
 
     if (!Irp)
     {
 
     if (!Irp)
     {
-        DPRINT1("NoIrp\n");
-        return STATUS_UNSUCCESSFUL;
+        DPRINT("NoIrp\n");
         // no irp available, use silence buffer
         *Buffer = (PUCHAR)m_SilenceBuffer;
         *BufferSize = m_MaxFrameSize;
         // no irp available, use silence buffer
         *Buffer = (PUCHAR)m_SilenceBuffer;
         *BufferSize = m_MaxFrameSize;
index 84f3277..9b93765 100644 (file)
@@ -614,7 +614,7 @@ CPortPinWaveCyclic::RequestService()
     }
 
     Status = m_Stream->GetPosition(&Position);
     }
 
     Status = m_Stream->GetPosition(&Position);
-    DPRINT1("Position %u Buffer %p BufferSize %u ActiveIrpOffset %u Capture %u\n", Position, Buffer, m_CommonBufferSize, BufferSize, m_Capture);
+    DPRINT("Position %u Buffer %p BufferSize %u ActiveIrpOffset %u Capture %u\n", Position, Buffer, m_CommonBufferSize, BufferSize, m_Capture);
 
     if (Position < m_CommonBufferOffset)
     {
 
     if (Position < m_CommonBufferOffset)
     {
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/port.hpp b/reactos/drivers/wdm/audio/backpln/portcls/port.hpp
deleted file mode 100644 (file)
index c10e479..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * COPYRIGHT:       See COPYING in the top level directory
- * PROJECT:         ReactOS
- * FILE:            drivers/multimedia/portcls/port/port.h
- * PURPOSE:         Port Class driver / Private header for IPort
- * PROGRAMMER:      Andrew Greenwood
- *
- * HISTORY:
- *                  27 Jan 07   Created
- */
-
-
-/*
-    Private header for Port implementations
-*/
-
-#ifndef PORT_PRIVATE_H
-#define PORT_PRIVATE_H
-
-#include "private.h"
-#include <stdunk.h>
-#include <portcls.h>
-
-#if 0
-typedef struct CPort
-{
-    union
-    {
-        IUnknown IUnknown;
-        IPort IPort;
-    };
-
-    LONG m_ref_count;
-    PUNKNOWN m_outer_unknown;
-} CPort;
-#endif
-
-#endif
diff --git a/reactos/drivers/wdm/audio/backpln/portcls/port_factory.cpp b/reactos/drivers/wdm/audio/backpln/portcls/port_factory.cpp
deleted file mode 100644 (file)
index 23def6b..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
-    ReactOS Operating System
-    Port Class API / Port Factory
-
-    by Andrew Greenwood
-*/
-
-#define INITGUID
-
-#include "private.h"
-#include <portcls.h>
-#include <ks.h>
-#include <kcom.h>
-#include "port.h"
-
-/*
- * @unimplemented
- */
-PORTCLASSAPI NTSTATUS NTAPI
-PcNewPort(
-    OUT PPORT* OutPort,
-    IN  REFCLSID ClassId)
-{
-    /*
-        ClassId can be one of the following:
-        CLSID_PortDMus -> IPortDMus (dmusicks.h)    -- TODO
-        CLSID_PortMidi -> IPortMidi
-        CLSID_PortTopology -> IPortTopology
-        CLSID_PortWaveCyclic -> IPortWaveCyclic
-        CLSID_PortWavePci -> IPortWavePci
-
-        TODO: What about PortWavePciStream?
-    */
-
-    PPORT new_port = NULL;
-    NTSTATUS status = STATUS_UNSUCCESSFUL;
-
-    if ( ! OutPort )
-    {
-        DPRINT("PcNewPort was supplied a NULL OutPort parameter\n");
-        return STATUS_INVALID_PARAMETER;
-    }
-
-    if ( ( IsEqualGUIDAligned(ClassId, &CLSID_PortMidi)         ) ||
-         ( IsEqualGUIDAligned(ClassId, &CLSID_PortTopology)     ) ||
-         ( IsEqualGUIDAligned(ClassId, &CLSID_PortWaveCyclic)   ) ||
-         ( IsEqualGUIDAligned(ClassId, &CLSID_PortWavePci)      ) )
-    {
-        DPRINT("Calling KoCreateInstance\n");
-        /* Call KS.SYS's Kernel-mode COM function */
-        status = KoCreateInstance(ClassId, NULL, CLSCTX_KERNEL_SERVER, &IID_IPort, (PVOID*)&new_port);
-    }
-    else
-    {
-
-        DPRINT("PcNewPort received a CLSID it does not deal with\n");
-        status = STATUS_NOT_SUPPORTED;
-    }
-
-    /* If an unsupported CLSID was handed to us, or the creation failed, we fail */
-    if ( status != STATUS_SUCCESS )
-    {
-        return status;
-    }
-
-    /* Fill the caller's PPORT* to point to the new port */
-    *OutPort = new_port;
-
-    DPRINT("PcNewPort succeeded\n");
-
-    return STATUS_SUCCESS;
-}