xref: /reactos/drivers/ksfilter/ks/ksiface.h (revision 40462c92)
1 #pragma once
2 
3 #if !defined(DEFINE_ABSTRACT_UNKNOWN)
4 
5 #define DEFINE_ABSTRACT_UNKNOWN()                               \
6     STDMETHOD_(NTSTATUS, QueryInterface)(THIS_                  \
7         REFIID InterfaceId,                                     \
8         PVOID* Interface)PURE;                                  \
9     STDMETHOD_(ULONG,AddRef)(THIS) PURE;                        \
10     STDMETHOD_(ULONG,Release)(THIS) PURE;
11 #endif
12 
13 typedef struct
14 {
15     LIST_ENTRY Entry;
16     LIST_ENTRY ObjectList;
17     PRKMUTEX BagMutex;
18     PVOID DeviceHeader;
19 }KSIOBJECT_BAG, *PKSIOBJECT_BAG;
20 
21 
22 /*****************************************************************************
23  * IKsAllocator
24  *****************************************************************************
25  */
26 
27 #undef INTERFACE
28 #define INTERFACE IKsAllocator
29 
30 DECLARE_INTERFACE_(IKsAllocator, IUnknown)
31 {
32     DEFINE_ABSTRACT_UNKNOWN()
33 
34     STDMETHOD_(NTSTATUS, DispatchDeviceIoControl)(THIS_
35         IN PDEVICE_OBJECT DeviceObject,
36         IN PIRP Irp) PURE;
37 
38     STDMETHOD_(NTSTATUS, Close)(THIS) PURE;
39 
40     STDMETHOD_(NTSTATUS, AllocateFrame)(THIS_
41         IN PVOID * OutFrame) PURE;
42 
43     STDMETHOD_(VOID, FreeFrame)(THIS_
44         IN PVOID OutFrame) PURE;
45 };
46 
47 
48 /*****************************************************************************
49  * IKsPin
50  *****************************************************************************
51  */
52 
53 #undef INTERFACE
54 #define INTERFACE IKsClock
55 
56 DECLARE_INTERFACE_(IKsClock, IUnknown)
57 {
58     DEFINE_ABSTRACT_UNKNOWN()
59 };
60 
61 /*****************************************************************************
62  * IKsTransport
63  *****************************************************************************
64  */
65 
66 #undef INTERFACE
67 #define INTERFACE IKsTransport
68 
69 DECLARE_INTERFACE_(IKsTransport, IUnknown)
70 {
71     DEFINE_ABSTRACT_UNKNOWN()
72 };
73 
74 
75 /*****************************************************************************
76  * IKsPin
77  *****************************************************************************
78  */
79 
80 #undef INTERFACE
81 #define INTERFACE IKsPin
82 
83 struct KSPTRANSPORTCONFIG;
84 
85 DECLARE_INTERFACE_(IKsPin, IUnknown)
86 {
87     DEFINE_ABSTRACT_UNKNOWN()
88 
89     STDMETHOD_(NTSTATUS, TransferKsIrp)(THIS_
90         IN PIRP Irp,
91         IN IKsTransport **OutTransport) PURE;
92 
93     STDMETHOD_(VOID, DiscardKsIrp)(THIS_
94         IN PIRP Irp,
95         IN IKsTransport * *OutTransport) PURE;
96 
97     STDMETHOD_(NTSTATUS, Connect)(THIS_
98         IN IKsTransport * TransportIn,
99         OUT IKsTransport ** OutTransportIn,
100         OUT IKsTransport * *OutTransportOut,
101         IN KSPIN_DATAFLOW DataFlow) PURE;
102 
103     STDMETHOD_(NTSTATUS, SetDeviceState)(THIS_
104         IN KSSTATE OldState,
105         IN KSSTATE NewState,
106         IN IKsTransport * *OutTransport) PURE;
107 
108     STDMETHOD_(VOID, SetResetState)(THIS_
109         IN KSRESET ResetState,
110         OUT IKsTransport * * OutTransportOut) PURE;
111 
112     STDMETHOD_(NTSTATUS, GetTransportConfig)(THIS_
113         IN struct KSPTRANSPORTCONFIG * TransportConfig,
114         OUT IKsTransport ** OutTransportIn,
115         OUT IKsTransport ** OutTransportOut) PURE;
116 
117     STDMETHOD_(NTSTATUS, SetTransportConfig)(THIS_
118         IN struct KSPTRANSPORTCONFIG const * TransportConfig,
119         OUT IKsTransport ** OutTransportIn,
120         OUT IKsTransport ** OutTransportOut) PURE;
121 
122     STDMETHOD_(NTSTATUS, ResetTransportConfig)(THIS_
123         OUT IKsTransport ** OutTransportIn,
124         OUT IKsTransport ** OutTransportOut) PURE;
125 
126     STDMETHOD_(PKSPIN, GetStruct)(THIS) PURE;
127     STDMETHOD_(PKSPROCESSPIN, GetProcessPin)(THIS) PURE;
128     STDMETHOD_(NTSTATUS, AttemptBypass)(THIS) PURE;
129     STDMETHOD_(NTSTATUS, AttemptUnbypass)(THIS) PURE;
130 
131     STDMETHOD_(VOID, GenerateConnectionEvents)(THIS_
132         IN ULONG EventMask) PURE;
133 
134     STDMETHOD_(NTSTATUS, ClientSetDeviceState)(THIS_
135         IN KSSTATE StateIn,
136         IN KSSTATE StateOut) PURE;
137 };
138 
139 /*****************************************************************************
140  * IKsQueue
141  *****************************************************************************
142  */
143 
144 #undef INTERFACE
145 #define INTERFACE IKsQueue
146 
147 DECLARE_INTERFACE_(IKsQueue, IUnknown)
148 {
149     DEFINE_ABSTRACT_UNKNOWN()
150 
151 };
152 
153 /*****************************************************************************
154  * IKsFilterFactory
155  *****************************************************************************
156  */
157 
158 #undef INTERFACE
159 #define INTERFACE IKsFilter
160 
161 struct KSPROCESSPIPESECTION;
162 
163 
164 DECLARE_INTERFACE_(IKsFilter, IUnknown)
165 {
166     DEFINE_ABSTRACT_UNKNOWN()
167 
168     STDMETHOD_(PKSFILTER, GetStruct)(THIS) PURE;
169 
170     STDMETHOD_(BOOL, DoAllNecessaryPinsExist)(THIS) PURE;
171 
172     STDMETHOD_(NTSTATUS, CreateNode)(THIS_
173         IN PIRP Irp,
174         IN IKsPin * Pin,
175         IN PLIST_ENTRY ListEntry) PURE;
176 
177     STDMETHOD_(NTSTATUS, BindProcessPinsToPipeSection)(THIS_
178         IN struct KSPROCESSPIPESECTION *Section,
179         IN PVOID Create,
180         IN PKSPIN KsPin,
181         OUT IKsPin **Pin,
182         OUT PKSGATE *OutGate) PURE;
183 
184     STDMETHOD_(NTSTATUS, UnbindProcessPinsFromPipeSection)(THIS_
185         IN struct KSPROCESSPIPESECTION *Section) PURE;
186 
187     STDMETHOD_(NTSTATUS, AddProcessPin)(THIS_
188         IN PKSPROCESSPIN ProcessPin) PURE;
189 
190     STDMETHOD_(NTSTATUS, RemoveProcessPin)(THIS_
191         IN PKSPROCESSPIN ProcessPin) PURE;
192 
193     STDMETHOD_(BOOL, ReprepareProcessPipeSection)(THIS_
194         IN struct KSPROCESSPIPESECTION *PipeSection,
195         IN PULONG Data) PURE;
196 
197     STDMETHOD_(VOID, DeliverResetState)(THIS_
198         IN struct KSPROCESSPIPESECTION *PipeSection,
199         IN KSRESET ResetState) PURE;
200 
201     STDMETHOD_(BOOL, IsFrameHolding)(THIS);
202 
203     STDMETHOD_(VOID, RegisterForCopyCallbacks)(THIS_
204         IKsQueue * Queue,
205         IN BOOL Enable) PURE;
206 
207     STDMETHOD_(PKSPROCESSPIN_INDEXENTRY, GetProcessDispatch)(THIS);
208 };
209 
210 /*****************************************************************************
211  * IKsFilterFactory
212  *****************************************************************************
213  */
214 
215 #undef INTERFACE
216 #define INTERFACE IKsFilterFactory
217 
218 DECLARE_INTERFACE_(IKsFilterFactory, IUnknown)
219 {
220     DEFINE_ABSTRACT_UNKNOWN()
221 
222     STDMETHOD_(KSFILTERFACTORY*, GetStruct)(THIS) PURE;
223 
224     STDMETHOD_(NTSTATUS, SetDeviceClassesState)(THIS_
225         IN BOOLEAN Enable)PURE;
226 
227     STDMETHOD_(NTSTATUS, Initialize)(THIS_
228         IN PDEVICE_OBJECT  DeviceObject,
229         IN const KSFILTER_DESCRIPTOR  *Descriptor,
230         IN PWSTR  RefString OPTIONAL,
231         IN PSECURITY_DESCRIPTOR  SecurityDescriptor OPTIONAL,
232         IN ULONG  CreateItemFlags,
233         IN PFNKSFILTERFACTORYPOWER  SleepCallback OPTIONAL,
234         IN PFNKSFILTERFACTORYPOWER  WakeCallback OPTIONAL,
235         OUT PKSFILTERFACTORY  *FilterFactory OPTIONAL)PURE;
236 };
237 
238 
239 /*****************************************************************************
240  * IKsPowerNotify
241  *****************************************************************************
242  */
243 
244 #undef INTERFACE
245 #define INTERFACE IKsPowerNotify
246 
247 DECLARE_INTERFACE_(IKsPowerNotify, IUnknown)
248 {
249     DEFINE_ABSTRACT_UNKNOWN()
250 
251     STDMETHOD_(VOID,Sleep)(THIS_
252         IN DEVICE_POWER_STATE State) PURE;
253 
254     STDMETHOD_(VOID,Wake)(THIS) PURE;
255 };
256 
257 
258 /*****************************************************************************
259  * IKsDevice
260  *****************************************************************************
261  */
262 
263 #undef INTERFACE
264 #define INTERFACE IKsDevice
265 
266 struct KSPOWER_ENTRY;
267 
268 DECLARE_INTERFACE_(IKsDevice, IUnknown)
269 {
270     DEFINE_ABSTRACT_UNKNOWN()
271 
272     STDMETHOD_(KSDEVICE*,GetStruct)(THIS) PURE;
273 
274     STDMETHOD_(NTSTATUS, InitializeObjectBag)(THIS_
275         IN PKSIOBJECT_BAG Bag,
276         IN PRKMUTEX Mutex) PURE;
277 
278     STDMETHOD_(NTSTATUS,AcquireDevice)(THIS) PURE;
279     STDMETHOD_(NTSTATUS,ReleaseDevice)(THIS) PURE;
280 
281     STDMETHOD_(NTSTATUS, GetAdapterObject)(THIS_
282         IN PADAPTER_OBJECT * Object,
283         IN PULONG MaxMappingsByteCount,
284         IN PULONG MappingTableStride) PURE;
285 
286     STDMETHOD_(NTSTATUS, AddPowerEntry)(THIS_
287         IN struct KSPOWER_ENTRY * Entry,
288         IN IKsPowerNotify* Notify)PURE;
289 
290     STDMETHOD_(NTSTATUS, RemovePowerEntry)(THIS_
291         IN struct KSPOWER_ENTRY * Entry)PURE;
292 
293     STDMETHOD_(NTSTATUS, PinStateChange)(THIS_
294         IN KSPIN Pin,
295         IN PIRP Irp,
296         IN KSSTATE OldState,
297         IN KSSTATE NewState)PURE;
298 
299     STDMETHOD_(NTSTATUS, ArbitrateAdapterChannel)(THIS_
300         IN ULONG NumberOfMapRegisters,
301         IN PDRIVER_CONTROL ExecutionRoutine,
302         IN PVOID Context)PURE;
303 
304     STDMETHOD_(NTSTATUS, CheckIoCapability)(THIS_
305         IN ULONG Unknown)PURE;
306 };
307 
308 #undef INTERFACE
309 
310 
311 /*****************************************************************************
312  * IKsProcessingObject
313  *****************************************************************************
314  */
315 
316 #undef INTERFACE
317 #define INTERFACE IKsProcessingObject
318 
319 DECLARE_INTERFACE_(IKsProcessingObject, IUnknown)
320 {
321     DEFINE_ABSTRACT_UNKNOWN()
322 
323     STDMETHOD_(VOID, ProcessingObjectWork)(THIS) PURE;
324 
325     STDMETHOD_(PKSGATE, GetAndGate)(THIS) PURE;
326 
327     STDMETHOD_(VOID, Process)(THIS_
328         IN BOOLEAN Asynchronous)PURE;
329 
330     STDMETHOD_(VOID, Reset)(THIS) PURE;
331 
332     STDMETHOD_(VOID, TriggerNotification)(THIS) PURE;
333 
334 };
335 
336 #undef INTERFACE
337 
338