ReactOS 0.4.15-dev-7093-g01a8288
filter_topology.cpp
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Kernel Streaming
4 * FILE: drivers/wdm/audio/backpln/portcls/filter_topology.c
5 * PURPOSE: portcls topology filter
6 * PROGRAMMER: Johannes Anderwald
7 */
8
9#include "private.hpp"
10
11#define NDEBUG
12#include <debug.h>
13
14class CPortFilterTopology : public CUnknownImpl<IPortFilterTopology>
15{
16public:
18
22
23protected:
24 IPortTopology * m_Port;
26 ISubdevice * m_SubDevice;
27};
28
32 IN REFIID refiid,
34{
35
36 if (IsEqualGUIDAligned(refiid, IID_IIrpTarget) ||
38 {
39 *Output = PVOID(PUNKNOWN(this));
40 PUNKNOWN(*Output)->AddRef();
41 return STATUS_SUCCESS;
42 }
43 else if (IsEqualGUIDAligned(refiid, IID_IPort))
44 {
46 PUNKNOWN(*Output)->AddRef();
47 return STATUS_SUCCESS;
48 }
49
51}
52
55CPortFilterTopology::NewIrpTarget(
56 OUT struct IIrpTarget **OutTarget,
61 IN PIRP Irp,
62 IN KSOBJECT_CREATE *CreateObject)
63{
64 DPRINT("CPortFilterTopology::NewIrpTarget entered\n");
65
67}
68
71CPortFilterTopology::DeviceIoControl(
73 IN PIRP Irp)
74{
75 PIO_STACK_LOCATION IoStack;
77
79
80 if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY)
81 {
82 DPRINT("Unhandled function %lx Length %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode, IoStack->Parameters.DeviceIoControl.InputBufferLength);
83
84 Irp->IoStatus.Status = STATUS_SUCCESS;
85
87 return STATUS_SUCCESS;
88 }
89
92 {
93 Irp->IoStatus.Status = Status;
94 DPRINT("Result %x Length %u\n", Status, Irp->IoStatus.Information);
96 }
97 return Status;
98
99}
100
102NTAPI
103CPortFilterTopology::Read(
105 IN PIRP Irp)
106{
108}
109
111NTAPI
112CPortFilterTopology::Write(
114 IN PIRP Irp)
115{
117}
118
120NTAPI
121CPortFilterTopology::Flush(
123 IN PIRP Irp)
124{
126}
127
129NTAPI
130CPortFilterTopology::Close(
132 IN PIRP Irp)
133{
135
136 // FIXME handle DirectSound
137
138#if 0
139//FIXME
140 if (m_ref == 1)
141 {
142 // release reference to port
143 This->SubDevice->lpVtbl->Release(This->SubDevice);
144
145 // time to shutdown the audio system
146 Status = This->SubDevice->lpVtbl->ReleaseChildren(This->SubDevice);
147 }
148#endif
149
150 Irp->IoStatus.Status = Status;
151 Irp->IoStatus.Information = 0;
153
154 return STATUS_SUCCESS;
155}
156
158NTAPI
159CPortFilterTopology::QuerySecurity(
161 IN PIRP Irp)
162{
164}
165
167NTAPI
168CPortFilterTopology::SetSecurity(
170 IN PIRP Irp)
171{
173}
174
176NTAPI
177CPortFilterTopology::FastDeviceIoControl(
185 OUT PIO_STATUS_BLOCK StatusBlock,
187{
188 return FALSE;
189}
190
192NTAPI
193CPortFilterTopology::FastRead(
200 OUT PIO_STATUS_BLOCK StatusBlock,
202{
203 return FALSE;
204}
205
207NTAPI
208CPortFilterTopology::FastWrite(
215 OUT PIO_STATUS_BLOCK StatusBlock,
217{
218 return FALSE;
219}
220
222NTAPI
223CPortFilterTopology::Init(
224 IN IPortTopology* Port)
225{
226 ISubdevice * ISubDevice;
229
230 // get our private interface
231 Status = Port->QueryInterface(IID_ISubdevice, (PVOID*)&ISubDevice);
232 if (!NT_SUCCESS(Status))
233 return STATUS_UNSUCCESSFUL;
234
235 // get the subdevice descriptor
236 Status = ISubDevice->GetDescriptor(&Descriptor);
237
238 // store subdevice interface
239 m_SubDevice = ISubDevice;
240
241 if (!NT_SUCCESS(Status))
242 return STATUS_UNSUCCESSFUL;
243
244 // save descriptor
246
247 // store port object
248 m_Port = Port;
249
250 return STATUS_SUCCESS;
251}
252
255 OUT IPortFilterTopology ** OutFilter)
256{
258
260 if (!This)
262
263 This->AddRef();
264
265 // return result
266 *OutFilter = (CPortFilterTopology*)This;
267
268 return STATUS_SUCCESS;
269}
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define STDMETHODIMP
Definition: basetyps.h:43
const GUID IID_IUnknown
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:160
Definition: bufpool.h:45
virtual ~CPortFilterTopology()
CPortFilterTopology(IUnknown *OuterUnknown)
SUBDEVICE_DESCRIPTOR * m_Descriptor
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
ISubdevice * m_SubDevice
IPortTopology * m_Port
IUnknown * PUNKNOWN
Definition: com_apitest.h:45
_In_ PIRP Irp
Definition: csq.h:116
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
KSDDKAPI NTSTATUS NTAPI KsDispatchInvalidDeviceRequest(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1189
#define NonPagedPool
Definition: env_spec_w32.h:307
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG LockKey
Definition: fatprocs.h:2665
NTSTATUS NewPortFilterTopology(OUT IPortFilterTopology **OutFilter)
Status
Definition: gdiplustypes.h:25
CPPORT Port[4]
Definition: headless.c:35
@ Unknown
Definition: i8042prt.h:114
ULONG AddRef()
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define IoCompleteRequest
Definition: irp.c:1240
#define STATUS_PENDING
Definition: ntstatus.h:82
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
#define TAG_PORTCLASS
Definition: private.hpp:24
NTSTATUS NTAPI PcHandlePropertyWithTable(IN PIRP Irp, IN ULONG PropertySetCount, IN PKSPROPERTY_SET PropertySet, IN PSUBDEVICE_DESCRIPTOR Descriptor)
Definition: undoc.cpp:78
#define REFIID
Definition: guiddef.h:118
@ Output
Definition: arc.h:85
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:71
PKSPROPERTY_SET FilterPropertySet
Definition: interfaces.hpp:210
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:3128
const uint16_t * PCWSTR
Definition: typedefs.h:57
INT POOL_TYPE
Definition: typedefs.h:78
#define NTAPI
Definition: typedefs.h:36
void * PVOID
Definition: typedefs.h:50
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3815
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
_In_ WDFREQUEST _In_ size_t _In_ size_t _In_ ULONG IoControlCode
Definition: wdfio.h:325
_In_ WDFREQUEST _In_ size_t OutputBufferLength
Definition: wdfio.h:320
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
Definition: wdfio.h:322
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
Definition: wdfiotarget.h:863
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
Definition: wdfiotarget.h:953
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:342
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:235
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
#define IO_NO_INCREMENT
Definition: iotypes.h:598
* PFILE_OBJECT
Definition: iotypes.h:1998