[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 #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 ULONG NameLength;
300 WCHAR Name[1];
301 } KEY_NAME_INFORMATION, *PKEY_NAME_INFORMATION;
302
303
304 typedef struct _KEY_NODE_INFORMATION
305 {
306 LARGE_INTEGER LastWriteTime;
307 ULONG TitleIndex;
308 ULONG ClassOffset;
309 ULONG ClassLength;
310 ULONG NameLength;
311 WCHAR Name[1];
312 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
313
314 typedef struct _KEY_VALUE_ENTRY
315 {
316 PUNICODE_STRING ValueName;
317 ULONG DataLength;
318 ULONG DataOffset;
319 ULONG Type;
320 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
321
322 typedef struct _KEY_VALUE_PARTIAL_INFORMATION
323 {
324 ULONG TitleIndex;
325 ULONG Type;
326 ULONG DataLength;
327 UCHAR Data[1];
328 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
329
330 typedef struct _KEY_VALUE_PARTIAL_INFORMATION_ALIGN64
331 {
332 ULONG Type;
333 ULONG DataLength;
334 UCHAR Data[1];
335 } KEY_VALUE_PARTIAL_INFORMATION_ALIGN64, *PKEY_VALUE_PARTIAL_INFORMATION_ALIGN64;
336
337 typedef struct _KEY_VALUE_BASIC_INFORMATION
338 {
339 ULONG TitleIndex;
340 ULONG Type;
341 ULONG NameLength;
342 WCHAR Name[1];
343 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
344
345 typedef struct _KEY_VALUE_FULL_INFORMATION
346 {
347 ULONG TitleIndex;
348 ULONG Type;
349 ULONG DataOffset;
350 ULONG DataLength;
351 ULONG NameLength;
352 WCHAR Name[1];
353 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
354
355 typedef struct _KEY_BASIC_INFORMATION
356 {
357 LARGE_INTEGER LastWriteTime;
358 ULONG TitleIndex;
359 ULONG NameLength;
360 WCHAR Name[1];
361 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
362
363 #endif
364
365 //
366 // Plug and Play Event Block
367 //
368 typedef struct _PLUGPLAY_EVENT_BLOCK
369 {
370 GUID EventGuid;
371 PLUGPLAY_EVENT_CATEGORY EventCategory;
372 PULONG Result;
373 ULONG Flags;
374 ULONG TotalSize;
375 PVOID DeviceObject;
376 union
377 {
378 struct
379 {
380 GUID ClassGuid;
381 WCHAR SymbolicLinkName[ANYSIZE_ARRAY];
382 } DeviceClass;
383 struct
384 {
385 WCHAR DeviceIds[ANYSIZE_ARRAY];
386 } TargetDevice;
387 struct
388 {
389 WCHAR DeviceId[ANYSIZE_ARRAY];
390 } InstallDevice;
391 struct
392 {
393 PVOID NotificationStructure;
394 WCHAR DeviceIds[ANYSIZE_ARRAY];
395 } CustomNotification;
396 struct
397 {
398 PVOID Notification;
399 } ProfileNotification;
400 struct
401 {
402 ULONG NotificationCode;
403 ULONG NotificationData;
404 } PowerNotification;
405 struct
406 {
407 PNP_VETO_TYPE VetoType;
408 WCHAR DeviceIdVetoNameBuffer[ANYSIZE_ARRAY];
409 } VetoNotification;
410 struct
411 {
412 GUID BlockedDriverGuid;
413 } BlockedDriverNotification;
414 };
415 } PLUGPLAY_EVENT_BLOCK, *PPLUGPLAY_EVENT_BLOCK;
416
417 //
418 // Plug and Play Control Classes
419 //
420
421 //Class 0x0A
422 typedef struct _PLUGPLAY_CONTROL_PROPERTY_DATA
423 {
424 UNICODE_STRING DeviceInstance;
425 ULONG Property;
426 PVOID Buffer;
427 ULONG BufferSize;
428 } PLUGPLAY_CONTROL_PROPERTY_DATA, *PPLUGPLAY_CONTROL_PROPERTY_DATA;
429
430 // Class 0x0C
431 typedef struct _PLUGPLAY_CONTROL_RELATED_DEVICE_DATA
432 {
433 UNICODE_STRING TargetDeviceInstance;
434 ULONG Relation;
435 PWCHAR RelatedDeviceInstance;
436 ULONG RelatedDeviceInstanceLength;
437 } PLUGPLAY_CONTROL_RELATED_DEVICE_DATA, *PPLUGPLAY_CONTROL_RELATED_DEVICE_DATA;
438
439 // Class 0x0E
440 typedef struct _PLUGPLAY_CONTOL_STATUS_DATA
441 {
442 UNICODE_STRING DeviceInstance;
443 ULONG Operation;
444 ULONG DeviceStatus;
445 ULONG DeviceProblem;
446 } PLUGPLAY_CONTROL_STATUS_DATA, *PPLUGPLAY_CONTROL_STATUS_DATA;
447
448 // Class 0x0F
449 typedef struct _PLUGPLAY_CONTROL_DEPTH_DATA
450 {
451 UNICODE_STRING DeviceInstance;
452 ULONG Depth;
453 } PLUGPLAY_CONTROL_DEPTH_DATA, *PPLUGPLAY_CONTROL_DEPTH_DATA;
454
455 // Class 0x14
456 typedef struct _PLUGPLAY_CONTROL_RESET_DEVICE_DATA
457 {
458 UNICODE_STRING DeviceInstance;
459 } PLUGPLAY_CONTROL_RESET_DEVICE_DATA, *PPLUGPLAY_CONTROL_RESET_DEVICE_DATA;
460
461 //
462 // Plug and Play Bus Type Definition
463 //
464 typedef struct _PLUGPLAY_BUS_TYPE
465 {
466 PLUGPLAY_BUS_CLASS BusClass;
467 union
468 {
469 INTERFACE_TYPE SystemBusType;
470 PLUGPLAY_VIRTUAL_BUS_TYPE PlugPlayVirtualBusType;
471 };
472 } PLUGPLAY_BUS_TYPE, *PPLUGPLAY_BUS_TYPE;
473
474 //
475 // Plug and Play Bus Instance Definition
476 //
477 typedef struct _PLUGPLAY_BUS_INSTANCE
478 {
479 PLUGPLAY_BUS_TYPE BusType;
480 ULONG BusNumber;
481 WCHAR BusName[MAX_BUS_NAME];
482 } PLUGPLAY_BUS_INSTANCE, *PPLUGPLAY_BUS_INSTANCE;
483
484 #ifdef NTOS_MODE_USER
485
486 //
487 // Partial Resource Descriptor and List for Hardware
488 //
489 #include <pshpack1.h>
490 typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR
491 {
492 UCHAR Type;
493 UCHAR ShareDisposition;
494 USHORT Flags;
495 union
496 {
497 struct
498 {
499 PHYSICAL_ADDRESS Start;
500 ULONG Length;
501 } Generic;
502 struct
503 {
504 PHYSICAL_ADDRESS Start;
505 ULONG Length;
506 } Port;
507 struct
508 {
509 ULONG Level;
510 ULONG Vector;
511 KAFFINITY Affinity;
512 } Interrupt;
513 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
514 struct
515 {
516 union
517 {
518 struct
519 {
520 USHORT Reserved;
521 USHORT MessageCount;
522 ULONG Vector;
523 KAFFINITY Affinity;
524 } Raw;
525 struct
526 {
527 ULONG Level;
528 ULONG Vector;
529 KAFFINITY Affinity;
530 } Translated;
531 };
532 } MessageInterrupt;
533 #endif
534 struct
535 {
536 PHYSICAL_ADDRESS Start;
537 ULONG Length;
538 } Memory;
539 struct
540 {
541 ULONG Channel;
542 ULONG Port;
543 ULONG Reserved1;
544 } Dma;
545 struct
546 {
547 ULONG Data[3];
548 } DevicePrivate;
549 struct
550 {
551 ULONG Start;
552 ULONG Length;
553 ULONG Reserved;
554 } BusNumber;
555 struct
556 {
557 ULONG DataSize;
558 ULONG Reserved1;
559 ULONG Reserved2;
560 } DeviceSpecificData;
561 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
562 struct
563 {
564 PHYSICAL_ADDRESS Start;
565 ULONG Length40;
566 } Memory40;
567 struct
568 {
569 PHYSICAL_ADDRESS Start;
570 ULONG Length48;
571 } Memory48;
572 struct
573 {
574 PHYSICAL_ADDRESS Start;
575 ULONG Length64;
576 } Memory64;
577 #endif
578 } u;
579 } CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR;
580
581 typedef struct _CM_PARTIAL_RESOURCE_LIST
582 {
583 USHORT Version;
584 USHORT Revision;
585 ULONG Count;
586 CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1];
587 } CM_PARTIAL_RESOURCE_LIST, *PCM_PARTIAL_RESOURCE_LIST;
588
589 //
590 // Full Resource Descriptor and List for Hardware
591 //
592 typedef struct _CM_FULL_RESOURCE_DESCRIPTOR
593 {
594 INTERFACE_TYPE InterfaceType;
595 ULONG BusNumber;
596 CM_PARTIAL_RESOURCE_LIST PartialResourceList;
597 } CM_FULL_RESOURCE_DESCRIPTOR, *PCM_FULL_RESOURCE_DESCRIPTOR;
598
599 typedef struct _CM_RESOURCE_LIST
600 {
601 ULONG Count;
602 CM_FULL_RESOURCE_DESCRIPTOR List[1];
603 } CM_RESOURCE_LIST, *PCM_RESOURCE_LIST;
604
605 //
606 // ROM Block Structure
607 //
608 typedef struct _CM_ROM_BLOCK
609 {
610 ULONG Address;
611 ULONG Size;
612 } CM_ROM_BLOCK, *PCM_ROM_BLOCK;
613
614 //
615 // Disk/INT13 Structures
616 //
617 typedef struct _CM_INT13_DRIVE_PARAMETER
618 {
619 USHORT DriveSelect;
620 ULONG MaxCylinders;
621 USHORT SectorsPerTrack;
622 USHORT MaxHeads;
623 USHORT NumberDrives;
624 } CM_INT13_DRIVE_PARAMETER, *PCM_INT13_DRIVE_PARAMETER;
625
626 typedef struct _CM_DISK_GEOMETRY_DEVICE_DATA
627 {
628 ULONG BytesPerSector;
629 ULONG NumberOfCylinders;
630 ULONG SectorsPerTrack;
631 ULONG NumberOfHeads;
632 } CM_DISK_GEOMETRY_DEVICE_DATA, *PCM_DISK_GEOMETRY_DEVICE_DATA;
633
634 #include <poppack.h>
635
636 #endif // _!NTOS_MODE_USER
637
638 #endif // _CMTYPES_H
639
640
641