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