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