- Add the real NT Object Callbacks and #ifdef out the ReactOS ones.
[reactos.git] / reactos / include / ndk / cmtypes.h
1 /*++ NDK Version: 0095
2
3 Copyright (c) Alex Ionescu. All rights reserved.
4
5 Header Name:
6
7 cmtypes.h
8
9 Abstract:
10
11 Type definitions for the Configuration Manager.
12
13 Author:
14
15 Alex Ionescu (alex.ionescu@reactos.com) 06-Oct-2004
16
17 --*/
18
19 #ifndef _CMTYPES_H
20 #define _CMTYPES_H
21
22 //
23 // Dependencies
24 //
25 #include <umtypes.h>
26 #include <cfg.h>
27 #include <iotypes.h>
28
29 #define MAX_BUS_NAME 24
30
31 //
32 // PLUGPLAY_CONTROL_RELATED_DEVICE_DATA.Relations
33 //
34 #define PNP_GET_PARENT_DEVICE 1
35 #define PNP_GET_CHILD_DEVICE 2
36 #define PNP_GET_SIBLING_DEVICE 3
37
38 //
39 // PLUGPLAY_CONTROL_STATUS_DATA Operations
40 //
41 #define PNP_GET_DEVICE_STATUS 0
42 #define PNP_SET_DEVICE_STATUS 1
43 #define PNP_CLEAR_DEVICE_STATUS 2
44
45 //
46 // Resource Type
47 //
48 #define CmResourceTypeNull 0
49 #define CmResourceTypePort 1
50 #define CmResourceTypeInterrupt 2
51 #define CmResourceTypeMemory 3
52 #define CmResourceTypeDma 4
53 #define CmResourceTypeDeviceSpecific 5
54 #define CmResourceTypeBusNumber 6
55 #define CmResourceTypeMaximum 7
56 #define CmResourceTypeNonArbitrated 128
57 #define CmResourceTypeConfigData 128
58 #define CmResourceTypeDevicePrivate 129
59 #define CmResourceTypePcCardConfig 130
60 #define CmResourceTypeMfCardConfig 131
61
62 #ifdef NTOS_MODE_USER
63
64 //
65 // Resource Descriptor Share Dispositions
66 //
67 typedef enum _CM_SHARE_DISPOSITION
68 {
69 CmResourceShareUndetermined,
70 CmResourceShareDeviceExclusive,
71 CmResourceShareDriverExclusive,
72 CmResourceShareShared
73 } CM_SHARE_DISPOSITION;
74
75 #endif
76
77 //
78 // Port Resource Descriptor Flags
79 //
80 #define CM_RESOURCE_PORT_MEMORY 0x0000
81 #define CM_RESOURCE_PORT_IO 0x0001
82 #define CM_RESOURCE_PORT_10_BIT_DECODE 0x0004
83 #define CM_RESOURCE_PORT_12_BIT_DECODE 0x0008
84 #define CM_RESOURCE_PORT_16_BIT_DECODE 0x0010
85 #define CM_RESOURCE_PORT_POSITIVE_DECODE 0x0020
86 #define CM_RESOURCE_PORT_PASSIVE_DECODE 0x0040
87 #define CM_RESOURCE_PORT_WINDOW_DECODE 0x0080
88
89 //
90 // Memory Resource Descriptor Flags
91 //
92 #define CM_RESOURCE_MEMORY_READ_WRITE 0x0000
93 #define CM_RESOURCE_MEMORY_READ_ONLY 0x0001
94 #define CM_RESOURCE_MEMORY_WRITE_ONLY 0x0002
95 #define CM_RESOURCE_MEMORY_PREFETCHABLE 0x0004
96 #define CM_RESOURCE_MEMORY_COMBINEDWRITE 0x0008
97 #define CM_RESOURCE_MEMORY_24 0x0010
98 #define CM_RESOURCE_MEMORY_CACHEABLE 0x0020
99
100 //
101 // DMA Resource Descriptor Flags
102 //
103 #define CM_RESOURCE_DMA_8 0x0000
104 #define CM_RESOURCE_DMA_16 0x0001
105 #define CM_RESOURCE_DMA_32 0x0002
106 #define CM_RESOURCE_DMA_8_AND_16 0x0004
107 #define CM_RESOURCE_DMA_BUS_MASTER 0x0008
108 #define CM_RESOURCE_DMA_TYPE_A 0x0010
109 #define CM_RESOURCE_DMA_TYPE_B 0x0020
110 #define CM_RESOURCE_DMA_TYPE_F 0x0040
111
112 #ifdef NTOS_MODE_USER
113
114 //
115 // Information Classes for NtQueryKey
116 //
117 typedef enum _KEY_INFORMATION_CLASS
118 {
119 KeyBasicInformation,
120 KeyNodeInformation,
121 KeyFullInformation,
122 KeyNameInformation,
123 KeyCachedInformation,
124 KeyFlagsInformation
125 } KEY_INFORMATION_CLASS;
126
127 typedef enum _KEY_VALUE_INFORMATION_CLASS
128 {
129 KeyValueBasicInformation,
130 KeyValueFullInformation,
131 KeyValuePartialInformation,
132 KeyValueFullInformationAlign64,
133 KeyValuePartialInformationAlign64
134 } KEY_VALUE_INFORMATION_CLASS;
135
136 typedef enum _KEY_SET_INFORMATION_CLASS
137 {
138 KeyWriteTimeInformation,
139 KeyUserFlagsInformation,
140 MaxKeySetInfoClass
141 } KEY_SET_INFORMATION_CLASS;
142
143 #endif
144
145 //
146 // Plag and Play Classes
147 //
148 typedef enum _PLUGPLAY_CONTROL_CLASS
149 {
150 PlugPlayControlUserResponse = 0x07,
151 PlugPlayControlProperty = 0x0A,
152 PlugPlayControlGetRelatedDevice = 0x0C,
153 PlugPlayControlDeviceStatus = 0x0E,
154 PlugPlayControlGetDeviceDepth,
155 PlugPlayControlResetDevice = 0x14
156 } PLUGPLAY_CONTROL_CLASS;
157
158 typedef enum _PLUGPLAY_BUS_CLASS
159 {
160 SystemBus,
161 PlugPlayVirtualBus,
162 MaxPlugPlayBusClass
163 } PLUGPLAY_BUS_CLASS, *PPLUGPLAY_BUS_CLASS;
164
165 //
166 // Plag and Play Bus Types
167 //
168 typedef enum _PLUGPLAY_VIRTUAL_BUS_TYPE
169 {
170 Root,
171 MaxPlugPlayVirtualBusType
172 } PLUGPLAY_VIRTUAL_BUS_TYPE, *PPLUGPLAY_VIRTUAL_BUS_TYPE;
173
174 //
175 // Plag and Play Event Categories
176 //
177 typedef enum _PLUGPLAY_EVENT_CATEGORY
178 {
179 HardwareProfileChangeEvent,
180 TargetDeviceChangeEvent,
181 DeviceClassChangeEvent,
182 CustomDeviceEvent,
183 DeviceInstallEvent,
184 DeviceArrivalEvent,
185 PowerEvent,
186 VetoEvent,
187 BlockedDriverEvent,
188 MaxPlugEventCategory
189 } PLUGPLAY_EVENT_CATEGORY;
190
191 #ifdef NTOS_MODE_USER
192
193 //
194 // Information Structures for NtQueryKeyInformation
195 //
196 typedef struct _KEY_WRITE_TIME_INFORMATION
197 {
198 LARGE_INTEGER LastWriteTime;
199 } KEY_WRITE_TIME_INFORMATION, *PKEY_WRITE_TIME_INFORMATION;
200
201 typedef struct _KEY_USER_FLAGS_INFORMATION
202 {
203 ULONG UserFlags;
204 } KEY_USER_FLAGS_INFORMATION, *PKEY_USER_FLAGS_INFORMATION;
205
206 typedef struct _KEY_FULL_INFORMATION
207 {
208 LARGE_INTEGER LastWriteTime;
209 ULONG TitleIndex;
210 ULONG ClassOffset;
211 ULONG ClassLength;
212 ULONG SubKeys;
213 ULONG MaxNameLen;
214 ULONG MaxClassLen;
215 ULONG Values;
216 ULONG MaxValueNameLen;
217 ULONG MaxValueDataLen;
218 WCHAR Class[1];
219 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
220
221 typedef struct _KEY_NODE_INFORMATION
222 {
223 LARGE_INTEGER LastWriteTime;
224 ULONG TitleIndex;
225 ULONG ClassOffset;
226 ULONG ClassLength;
227 ULONG NameLength;
228 WCHAR Name[1];
229 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
230
231 typedef struct _KEY_VALUE_ENTRY
232 {
233 PUNICODE_STRING ValueName;
234 ULONG DataLength;
235 ULONG DataOffset;
236 ULONG Type;
237 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
238
239 typedef struct _KEY_VALUE_PARTIAL_INFORMATION
240 {
241 ULONG TitleIndex;
242 ULONG Type;
243 ULONG DataLength;
244 UCHAR Data[1];
245 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
246
247 typedef struct _KEY_VALUE_BASIC_INFORMATION
248 {
249 ULONG TitleIndex;
250 ULONG Type;
251 ULONG NameLength;
252 WCHAR Name[1];
253 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
254
255 typedef struct _KEY_VALUE_FULL_INFORMATION
256 {
257 ULONG TitleIndex;
258 ULONG Type;
259 ULONG DataOffset;
260 ULONG DataLength;
261 ULONG NameLength;
262 WCHAR Name[1];
263 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
264
265 typedef struct _KEY_BASIC_INFORMATION
266 {
267 LARGE_INTEGER LastWriteTime;
268 ULONG TitleIndex;
269 ULONG NameLength;
270 WCHAR Name[1];
271 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
272
273 #endif
274
275 //
276 // Plug and Play Event Block
277 //
278 typedef struct _PLUGPLAY_EVENT_BLOCK
279 {
280 GUID EventGuid;
281 PLUGPLAY_EVENT_CATEGORY EventCategory;
282 PULONG Result;
283 ULONG Flags;
284 ULONG TotalSize;
285 PVOID DeviceObject;
286 union
287 {
288 struct
289 {
290 GUID ClassGuid;
291 WCHAR SymbolicLinkName[ANYSIZE_ARRAY];
292 } DeviceClass;
293 struct
294 {
295 WCHAR DeviceIds[ANYSIZE_ARRAY];
296 } TargetDevice;
297 struct
298 {
299 WCHAR DeviceId[ANYSIZE_ARRAY];
300 } InstallDevice;
301 struct
302 {
303 PVOID NotificationStructure;
304 WCHAR DeviceIds[ANYSIZE_ARRAY];
305 } CustomNotification;
306 struct
307 {
308 PVOID Notification;
309 } ProfileNotification;
310 struct
311 {
312 ULONG NotificationCode;
313 ULONG NotificationData;
314 } PowerNotification;
315 struct
316 {
317 PNP_VETO_TYPE VetoType;
318 WCHAR DeviceIdVetoNameBuffer[ANYSIZE_ARRAY];
319 } VetoNotification;
320 struct
321 {
322 GUID BlockedDriverGuid;
323 } BlockedDriverNotification;
324 };
325 } PLUGPLAY_EVENT_BLOCK, *PPLUGPLAY_EVENT_BLOCK;
326
327 //
328 // Plug and Play Control Classes
329 //
330
331 //Class 0x0A
332 typedef struct _PLUGPLAY_CONTROL_PROPERTY_DATA
333 {
334 UNICODE_STRING DeviceInstance;
335 ULONG Property;
336 PVOID Buffer;
337 ULONG BufferSize;
338 } PLUGPLAY_CONTROL_PROPERTY_DATA, *PPLUGPLAY_CONTROL_PROPERTY_DATA;
339
340 // Class 0x0C
341 typedef struct _PLUGPLAY_CONTROL_RELATED_DEVICE_DATA
342 {
343 UNICODE_STRING TargetDeviceInstance;
344 ULONG Relation;
345 UNICODE_STRING RelatedDeviceInstance;
346 } PLUGPLAY_CONTROL_RELATED_DEVICE_DATA, *PPLUGPLAY_CONTROL_RELATED_DEVICE_DATA;
347
348 // Class 0x0E
349 typedef struct _PLUGPLAY_CONTOL_STATUS_DATA
350 {
351 UNICODE_STRING DeviceInstance;
352 ULONG Operation;
353 ULONG DeviceStatus;
354 ULONG DeviceProblem;
355 } PLUGPLAY_CONTROL_STATUS_DATA, *PPLUGPLAY_CONTROL_STATUS_DATA;
356
357 // Class 0x0F
358 typedef struct _PLUGPLAY_CONTROL_DEPTH_DATA
359 {
360 UNICODE_STRING DeviceInstance;
361 ULONG Depth;
362 } PLUGPLAY_CONTROL_DEPTH_DATA, *PPLUGPLAY_CONTROL_DEPTH_DATA;
363
364 // Class 0x14
365 typedef struct _PLUGPLAY_CONTROL_RESET_DEVICE_DATA
366 {
367 UNICODE_STRING DeviceInstance;
368 } PLUGPLAY_CONTROL_RESET_DEVICE_DATA, *PPLUGPLAY_CONTROL_RESET_DEVICE_DATA;
369
370 //
371 // Plug and Play Bus Type Definition
372 //
373 typedef struct _PLUGPLAY_BUS_TYPE
374 {
375 PLUGPLAY_BUS_CLASS BusClass;
376 union
377 {
378 INTERFACE_TYPE SystemBusType;
379 PLUGPLAY_VIRTUAL_BUS_TYPE PlugPlayVirtualBusType;
380 };
381 } PLUGPLAY_BUS_TYPE, *PPLUGPLAY_BUS_TYPE;
382
383 //
384 // Plug and Play Bus Instance Definition
385 //
386 typedef struct _PLUGPLAY_BUS_INSTANCE
387 {
388 PLUGPLAY_BUS_TYPE BusType;
389 ULONG BusNumber;
390 WCHAR BusName[MAX_BUS_NAME];
391 } PLUGPLAY_BUS_INSTANCE, *PPLUGPLAY_BUS_INSTANCE;
392
393 #ifdef NTOS_MODE_USER
394
395 //
396 // Partial Resource Descriptor and List for Hardware
397 //
398 #include <pshpack1.h>
399 typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR
400 {
401 UCHAR Type;
402 UCHAR ShareDisposition;
403 USHORT Flags;
404 union
405 {
406 struct
407 {
408 PHYSICAL_ADDRESS Start;
409 ULONG Length;
410 } Generic;
411 struct
412 {
413 PHYSICAL_ADDRESS Start;
414 ULONG Length;
415 } Port;
416 struct
417 {
418 ULONG Level;
419 ULONG Vector;
420 ULONG Affinity;
421 } Interrupt;
422 struct
423 {
424 PHYSICAL_ADDRESS Start;
425 ULONG Length;
426 } Memory;
427 struct
428 {
429 ULONG Channel;
430 ULONG Port;
431 ULONG Reserved1;
432 } Dma;
433 struct
434 {
435 ULONG Data[3];
436 } DevicePrivate;
437 struct
438 {
439 ULONG Start;
440 ULONG Length;
441 ULONG Reserved;
442 } BusNumber;
443 struct
444 {
445 ULONG DataSize;
446 ULONG Reserved1;
447 ULONG Reserved2;
448 } DeviceSpecificData;
449 } u;
450 } CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR;
451
452 typedef struct _CM_PARTIAL_RESOURCE_LIST
453 {
454 USHORT Version;
455 USHORT Revision;
456 ULONG Count;
457 CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1];
458 } CM_PARTIAL_RESOURCE_LIST, *PCM_PARTIAL_RESOURCE_LIST;
459
460 //
461 // Full Resource Descriptor and List for Hardware
462 //
463 typedef struct _CM_FULL_RESOURCE_DESCRIPTOR
464 {
465 INTERFACE_TYPE InterfaceType;
466 ULONG BusNumber;
467 CM_PARTIAL_RESOURCE_LIST PartialResourceList;
468 } CM_FULL_RESOURCE_DESCRIPTOR, *PCM_FULL_RESOURCE_DESCRIPTOR;
469
470 typedef struct _CM_RESOURCE_LIST
471 {
472 ULONG Count;
473 CM_FULL_RESOURCE_DESCRIPTOR List[1];
474 } CM_RESOURCE_LIST, *PCM_RESOURCE_LIST;
475
476 //
477 // Disk/INT13 Structures
478 //
479 typedef struct _CM_INT13_DRIVE_PARAMETER
480 {
481 USHORT DriveSelect;
482 ULONG MaxCylinders;
483 USHORT SectorsPerTrack;
484 USHORT MaxHeads;
485 USHORT NumberDrives;
486 } CM_INT13_DRIVE_PARAMETER, *PCM_INT13_DRIVE_PARAMETER;
487
488 typedef struct _CM_DISK_GEOMETRY_DEVICE_DATA
489 {
490 ULONG BytesPerSector;
491 ULONG NumberOfCylinders;
492 ULONG SectorsPerTrack;
493 ULONG NumberOfHeads;
494 } CM_DISK_GEOMETRY_DEVICE_DATA, *PCM_DISK_GEOMETRY_DEVICE_DATA;
495
496 #include <poppack.h>
497
498 #endif // _!NTOS_MODE_USER
499
500 #endif // _CMTYPES_H
501