1*c2c66affSColin Finck /*
2*c2c66affSColin Finck * COPYRIGHT: See COPYING in the top level directory
3*c2c66affSColin Finck * PROJECT: ReactOS Kernel Streaming
4*c2c66affSColin Finck * FILE: drivers/wdm/audio/backpln/portcls/port.cpp
5*c2c66affSColin Finck * PURPOSE: Port construction API
6*c2c66affSColin Finck * PROGRAMMER: Johannes Anderwald
7*c2c66affSColin Finck * Andrew Greenwood
8*c2c66affSColin Finck */
9*c2c66affSColin Finck
10*c2c66affSColin Finck #include "private.hpp"
11*c2c66affSColin Finck
12*c2c66affSColin Finck #define NDEBUG
13*c2c66affSColin Finck #include <debug.h>
14*c2c66affSColin Finck
15*c2c66affSColin Finck NTSTATUS
16*c2c66affSColin Finck NTAPI
PcNewPort(OUT PPORT * OutPort,IN REFCLSID ClassId)17*c2c66affSColin Finck PcNewPort(
18*c2c66affSColin Finck OUT PPORT* OutPort,
19*c2c66affSColin Finck IN REFCLSID ClassId)
20*c2c66affSColin Finck {
21*c2c66affSColin Finck NTSTATUS Status;
22*c2c66affSColin Finck UNICODE_STRING GuidString;
23*c2c66affSColin Finck
24*c2c66affSColin Finck DPRINT("PcNewPort entered\n");
25*c2c66affSColin Finck
26*c2c66affSColin Finck PC_ASSERT_IRQL_EQUAL(PASSIVE_LEVEL);
27*c2c66affSColin Finck
28*c2c66affSColin Finck if (!OutPort)
29*c2c66affSColin Finck {
30*c2c66affSColin Finck DPRINT("PcNewPort was supplied a NULL OutPort parameter\n");
31*c2c66affSColin Finck return STATUS_INVALID_PARAMETER;
32*c2c66affSColin Finck }
33*c2c66affSColin Finck
34*c2c66affSColin Finck if (IsEqualGUIDAligned(ClassId, CLSID_PortMidi))
35*c2c66affSColin Finck Status = NewPortDMus(OutPort);
36*c2c66affSColin Finck else if (IsEqualGUIDAligned(ClassId, CLSID_PortDMus))
37*c2c66affSColin Finck Status = NewPortDMus(OutPort);
38*c2c66affSColin Finck else if (IsEqualGUIDAligned(ClassId, CLSID_PortTopology))
39*c2c66affSColin Finck Status = NewPortTopology(OutPort);
40*c2c66affSColin Finck else if (IsEqualGUIDAligned(ClassId, CLSID_PortWaveCyclic))
41*c2c66affSColin Finck Status = NewPortWaveCyclic(OutPort);
42*c2c66affSColin Finck else if (IsEqualGUIDAligned(ClassId, CLSID_PortWavePci))
43*c2c66affSColin Finck Status = NewPortWavePci(OutPort);
44*c2c66affSColin Finck else if (IsEqualGUIDAligned(ClassId, CLSID_PortWaveRT))
45*c2c66affSColin Finck Status = NewPortWaveRT(OutPort);
46*c2c66affSColin Finck else
47*c2c66affSColin Finck {
48*c2c66affSColin Finck
49*c2c66affSColin Finck if (RtlStringFromGUID(ClassId, &GuidString) == STATUS_SUCCESS)
50*c2c66affSColin Finck {
51*c2c66affSColin Finck DPRINT("unknown interface %S\n", GuidString.Buffer);
52*c2c66affSColin Finck RtlFreeUnicodeString(&GuidString);
53*c2c66affSColin Finck }
54*c2c66affSColin Finck
55*c2c66affSColin Finck Status = STATUS_NOT_SUPPORTED;
56*c2c66affSColin Finck return Status;
57*c2c66affSColin Finck }
58*c2c66affSColin Finck DPRINT("PcNewPort Status %lx\n", Status);
59*c2c66affSColin Finck
60*c2c66affSColin Finck return Status;
61*c2c66affSColin Finck }
62