Synchronize with trunk revision 59636 (just before Alex's CreateProcess revamp).
[reactos.git] / drivers / ksfilter / ks / kstypes.h
1 #pragma once
2
3 #include <ntddk.h>
4 #include <ks.h>
5
6 typedef struct
7 {
8 KoCreateObjectHandler CreateObjectHandler;
9 }KO_DRIVER_EXTENSION, *PKO_DRIVER_EXTENSION;
10
11 typedef struct
12 {
13 const KSDEVICE_DESCRIPTOR *Descriptor;
14 }KS_DRIVER_EXTENSION, *PKS_DRIVER_EXTENSION;
15
16 typedef struct
17 {
18 KSOBJECT_HEADER ObjectHeader;
19 KSOBJECT_CREATE_ITEM CreateItem;
20 }KO_OBJECT_HEADER, *PKO_OBJECT_HEADER;
21
22
23 typedef struct
24 {
25 KSDISPATCH_TABLE DispatchTable;
26 KSOBJECTTYPE Type;
27
28 LONG ItemListCount;
29 LIST_ENTRY ItemList;
30
31 UNICODE_STRING ObjectClass;
32 PUNKNOWN Unknown;
33 PVOID ObjectType;
34
35 PDEVICE_OBJECT TargetDevice;
36 LIST_ENTRY TargetDeviceListEntry;
37
38 PDEVICE_OBJECT ParentDeviceObject;
39
40 PFNKSCONTEXT_DISPATCH PowerDispatch;
41 PVOID PowerContext;
42 LIST_ENTRY PowerDispatchEntry;
43 PKSOBJECT_CREATE_ITEM OriginalCreateItem;
44 ACCESS_MASK AccessMask;
45
46 }KSIOBJECT_HEADER, *PKSIOBJECT_HEADER;
47
48 typedef struct
49 {
50 LIST_ENTRY Entry;
51 PKSOBJECT_CREATE_ITEM CreateItem;
52 PFNKSITEMFREECALLBACK ItemFreeCallback;
53 LONG ReferenceCount;
54 LIST_ENTRY ObjectItemList;
55 }CREATE_ITEM_ENTRY, *PCREATE_ITEM_ENTRY;
56
57 typedef struct
58 {
59 KSOBJECTTYPE Type;
60 PKSDEVICE KsDevice;
61 PRKMUTEX ControlMutex;
62 LIST_ENTRY EventList;
63 KSPIN_LOCK EventListLock;
64 PUNKNOWN ClientAggregate;
65 PUNKNOWN OuterUnknown;
66 union
67 {
68 PKSDEVICE KsDevice;
69 PKSFILTERFACTORY KsFilterFactory;
70 PKSFILTER KsFilter;
71 }Parent;
72
73 union
74 {
75 PKSFILTERFACTORY FilterFactory;
76 PKSFILTER Filter;
77 PKSPIN Pin;
78 }Next;
79
80 union
81 {
82 PKSFILTERFACTORY FilterFactory;
83 PKSFILTER Filter;
84 }FirstChild;
85
86 }KSBASIC_HEADER, *PKSBASIC_HEADER;
87
88 typedef struct
89 {
90 KSBASIC_HEADER BasicHeader;
91 KSDEVICE KsDevice;
92
93 LONG ref;
94 ERESOURCE SecurityLock;
95
96 LONG ItemListCount;
97 LIST_ENTRY ItemList;
98
99 ULONG DeviceIndex;
100 PDEVICE_OBJECT PnpDeviceObject;
101 PDEVICE_OBJECT BaseDevice;
102
103 KSTARGET_STATE TargetState;
104 LIST_ENTRY TargetDeviceList;
105
106 KMUTEX DeviceMutex;
107 KMUTEX BagMutex;
108
109 LIST_ENTRY PowerDispatchList;
110 LIST_ENTRY ObjectBags;
111
112 PADAPTER_OBJECT AdapterObject;
113 ULONG MaxMappingsByteCount;
114 ULONG MappingTableStride;
115
116 }KSIDEVICE_HEADER, *PKSIDEVICE_HEADER;
117
118 typedef struct
119 {
120 PKSIDEVICE_HEADER DeviceHeader;
121
122 }DEVICE_EXTENSION, *PDEVICE_EXTENSION;
123
124 typedef struct
125 {
126 LIST_ENTRY Entry;
127 UNICODE_STRING SymbolicLink;
128 CLSID DeviceInterfaceClass;
129 }SYMBOLIC_LINK_ENTRY, *PSYMBOLIC_LINK_ENTRY;
130
131 typedef struct
132 {
133 PKSIDEVICE_HEADER DeviceHeader;
134 PIO_WORKITEM WorkItem;
135 }PNP_POSTSTART_CONTEXT, *PPNP_POSTSTART_CONTEXT;
136
137 typedef struct
138 {
139 PLIST_ENTRY List;
140 PFILE_OBJECT FileObject;
141 PKSEVENT_ENTRY EventEntry;
142 PIRP Irp;
143 }KSEVENT_CTX, *PKSEVENT_CTX;
144
145 typedef BOOLEAN (NTAPI *PKSEVENT_SYNCHRONIZED_ROUTINE)(PKSEVENT_CTX Context);
146
147 struct __BUS_ENUM_DEVICE_EXTENSION__;
148 struct __BUS_DEVICE_ENTRY__;
149
150 typedef struct
151 {
152 LIST_ENTRY Entry;
153 ULONG IsBus;
154 union
155 {
156 PDEVICE_OBJECT DeviceObject;
157 ULONG DeviceReferenceCount;
158 };
159 union
160 {
161 struct __BUS_DEVICE_ENTRY__* DeviceEntry;
162 ULONG Dummy1;
163 };
164 struct __BUS_ENUM_DEVICE_EXTENSION__ *BusDeviceExtension;
165 ULONG DeviceObjectReferenceCount;
166 }COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION;
167
168 typedef struct
169 {
170 PCOMMON_DEVICE_EXTENSION Ext;
171 }DEV_EXTENSION, *PDEV_EXTENSION;
172
173 typedef struct
174 {
175 LIST_ENTRY Entry;
176 GUID InterfaceGuid;
177 UNICODE_STRING SymbolicLink;
178 }BUS_INSTANCE_ENTRY, *PBUS_INSTANCE_ENTRY;
179
180
181
182 typedef enum
183 {
184 NotStarted = 0, // Not started yet
185 Started, // Device has received the START_DEVICE IRP
186 StopPending, // Device has received the QUERY_STOP IRP
187 Stopped, // Device has received the STOP_DEVICE IRP
188 RemovePending, // Device has received the QUERY_REMOVE IRP
189 SurpriseRemovePending, // Device has received the SURPRISE_REMOVE IRP
190 Deleted
191 }DEVICE_STATE;
192
193
194 typedef struct __BUS_DEVICE_ENTRY__
195 {
196 LIST_ENTRY Entry;
197 LIST_ENTRY DeviceInterfaceList;
198 LIST_ENTRY IrpPendingList;
199 PDEVICE_OBJECT PDO;
200 DEVICE_STATE DeviceState;
201 GUID DeviceGuid;
202 LPWSTR PDODeviceName;
203 LPWSTR DeviceName;
204 LPWSTR BusId;
205 LARGE_INTEGER TimeCreated;
206 LARGE_INTEGER TimeExpired;
207 LPWSTR Instance;
208 }BUS_DEVICE_ENTRY, *PBUS_DEVICE_ENTRY;
209
210 typedef struct __BUS_ENUM_DEVICE_EXTENSION__
211 {
212 COMMON_DEVICE_EXTENSION Common;
213 KSPIN_LOCK Lock;
214 KEVENT Event;
215 UNICODE_STRING DeviceInterfaceLink;
216 PDEVICE_OBJECT PhysicalDeviceObject;
217 PDEVICE_OBJECT PnpDeviceObject;
218 PDEVICE_OBJECT BusDeviceObject;
219 ULONG PdoCreated;
220 KTIMER Timer;
221 KDPC Dpc;
222 WORK_QUEUE_ITEM WorkItem;
223 ULONG DeviceAttached;
224 UNICODE_STRING ServicePath;
225
226 WCHAR BusIdentifier[1];
227 }BUS_ENUM_DEVICE_EXTENSION, *PBUS_ENUM_DEVICE_EXTENSION;
228
229 typedef struct
230 {
231 PIRP Irp;
232 PBUS_ENUM_DEVICE_EXTENSION BusDeviceExtension;
233 KEVENT Event;
234 NTSTATUS Status;
235 WORK_QUEUE_ITEM WorkItem;
236 }BUS_INSTALL_ENUM_CONTEXT, *PBUS_INSTALL_ENUM_CONTEXT;
237
238 typedef struct
239 {
240 PUCHAR FilterData;
241 ULONG FilterLength;
242 ULONG FilterOffset;
243
244 PUCHAR DataCache;
245 ULONG DataLength;
246 ULONG DataOffset;
247
248 }KSPCACHE_DESCRIPTOR, *PKSPCACHE_DESCRIPTOR;
249
250 typedef struct
251 {
252 DWORD dwVersion;
253 DWORD dwMerit;
254 DWORD dwPins;
255 DWORD dwUnused;
256 }KSPCACHE_FILTER_HEADER, *PKSPCACHE_FILTER_HEADER;
257
258 typedef struct
259 {
260 ULONG Signature;
261 ULONG Flags;
262 ULONG Instances;
263 ULONG MediaTypes;
264 ULONG Mediums;
265 DWORD Category;
266 }KSPCACHE_PIN_HEADER, *PKSPCACHE_PIN_HEADER;
267
268
269 typedef struct
270 {
271 ULONG Signature;
272 ULONG dwUnused;
273 ULONG OffsetMajor;
274 ULONG OffsetMinor;
275 }KSPCACHE_DATARANGE, *PKSPCACHE_DATARANGE;
276
277
278 typedef struct
279 {
280 CLSID Medium;
281 ULONG dw1;
282 ULONG dw2;
283 }KSPCACHE_MEDIUM;
284