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