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