xref: /reactos/sdk/include/ndk/cmtypes.h (revision 53221834)
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_PROPERTY_DATA.Properties
33 //
34 #define PNP_PROPERTY_UI_NUMBER                        0
35 #define PNP_PROPERTY_PHYSICAL_DEVICE_OBJECT_NAME      1
36 #define PNP_PROPERTY_BUSTYPEGUID                      2
37 #define PNP_PROPERTY_LEGACYBUSTYPE                    3
38 #define PNP_PROPERTY_BUSNUMBER                        4
39 #define PNP_PROPERTY_POWER_DATA                       5
40 #define PNP_PROPERTY_REMOVAL_POLICY                   6
41 #define PNP_PROPERTY_REMOVAL_POLICY_OVERRIDE          7
42 #define PNP_PROPERTY_ADDRESS                          8
43 #define PNP_PROPERTY_ENUMERATOR_NAME                  9
44 #define PNP_PROPERTY_REMOVAL_POLICY_HARDWARE_DEFAULT 10
45 #define PNP_PROPERTY_INSTALL_STATE                   11
46 #define PNP_PROPERTY_LOCATION_PATHS                  12
47 #define PNP_PROPERTY_CONTAINERID                     13
48 
49 //
50 // PLUGPLAY_CONTROL_RELATED_DEVICE_DATA.Relations
51 //
52 #define PNP_GET_PARENT_DEVICE           1
53 #define PNP_GET_CHILD_DEVICE            2
54 #define PNP_GET_SIBLING_DEVICE          3
55 
56 //
57 // PLUGPLAY_CONTROL_STATUS_DATA.Operation
58 //
59 #define PNP_GET_DEVICE_STATUS           0
60 #define PNP_SET_DEVICE_STATUS           1
61 #define PNP_CLEAR_DEVICE_STATUS         2
62 
63 //
64 // PLUGPLAY_CONTROL_DEVICE_RELATIONS_DATA.Relations
65 //
66 #define PNP_EJECT_RELATIONS             0
67 #define PNP_REMOVAL_RELATIONS           1
68 #define PNP_POWER_RELATIONS             2
69 #define PNP_BUS_RELATIONS               3
70 
71 
72 #ifdef NTOS_MODE_USER
73 
74 //
75 // Resource Type
76 //
77 #define CmResourceTypeNull                      0
78 #define CmResourceTypePort                      1
79 #define CmResourceTypeInterrupt                 2
80 #define CmResourceTypeMemory                    3
81 #define CmResourceTypeDma                       4
82 #define CmResourceTypeDeviceSpecific            5
83 #define CmResourceTypeBusNumber                 6
84 #define CmResourceTypeMemoryLarge               7
85 #define CmResourceTypeNonArbitrated             128
86 #define CmResourceTypeConfigData                128
87 #define CmResourceTypeDevicePrivate             129
88 #define CmResourceTypePcCardConfig              130
89 #define CmResourceTypeMfCardConfig              131
90 
91 
92 //
93 // Resource Descriptor Share Dispositions
94 //
95 typedef enum _CM_SHARE_DISPOSITION
96 {
97     CmResourceShareUndetermined,
98     CmResourceShareDeviceExclusive,
99     CmResourceShareDriverExclusive,
100     CmResourceShareShared
101 } CM_SHARE_DISPOSITION;
102 
103 #endif
104 
105 //
106 // Port Resource Descriptor Flags
107 //
108 #define CM_RESOURCE_PORT_MEMORY                 0x0000
109 #define CM_RESOURCE_PORT_IO                     0x0001
110 #define CM_RESOURCE_PORT_10_BIT_DECODE          0x0004
111 #define CM_RESOURCE_PORT_12_BIT_DECODE          0x0008
112 #define CM_RESOURCE_PORT_16_BIT_DECODE          0x0010
113 #define CM_RESOURCE_PORT_POSITIVE_DECODE        0x0020
114 #define CM_RESOURCE_PORT_PASSIVE_DECODE         0x0040
115 #define CM_RESOURCE_PORT_WINDOW_DECODE          0x0080
116 
117 //
118 // Memory Resource Descriptor Flags
119 //
120 #define CM_RESOURCE_MEMORY_READ_WRITE     0x0000
121 #define CM_RESOURCE_MEMORY_READ_ONLY      0x0001
122 #define CM_RESOURCE_MEMORY_WRITE_ONLY     0x0002
123 #define CM_RESOURCE_MEMORY_PREFETCHABLE   0x0004
124 #define CM_RESOURCE_MEMORY_COMBINEDWRITE  0x0008
125 #define CM_RESOURCE_MEMORY_24             0x0010
126 #define CM_RESOURCE_MEMORY_CACHEABLE      0x0020
127 
128 //
129 // DMA Resource Descriptor Flags
130 //
131 #define CM_RESOURCE_DMA_8                 0x0000
132 #define CM_RESOURCE_DMA_16                0x0001
133 #define CM_RESOURCE_DMA_32                0x0002
134 #define CM_RESOURCE_DMA_8_AND_16          0x0004
135 #define CM_RESOURCE_DMA_BUS_MASTER        0x0008
136 #define CM_RESOURCE_DMA_TYPE_A            0x0010
137 #define CM_RESOURCE_DMA_TYPE_B            0x0020
138 #define CM_RESOURCE_DMA_TYPE_F            0x0040
139 
140 //
141 // Interrupt Resource Descriptor Flags
142 //
143 #define CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE 0x0000
144 #define CM_RESOURCE_INTERRUPT_LATCHED         0x0001
145 #define CM_RESOURCE_INTERRUPT_MESSAGE         0x0002
146 #define CM_RESOURCE_INTERRUPT_POLICY_INCLUDED 0x0004
147 #define CM_RESOURCE_INTERRUPT_ALLOW_RESERVED_IDT    0x0008
148 #define CM_RESOURCE_INTERRUPT_SECONDARY_INTERRUPT   0x0010
149 #define CM_RESOURCE_INTERRUPT_WAKE_HINT             0x0020
150 
151 #define CM_RESOURCE_INTERRUPT_LEVEL_LATCHED_BITS 0x0001
152 
153 #define CM_RESOURCE_INTERRUPT_MESSAGE_TOKEN   ((ULONG)-2)
154 
155 //
156 // NtInitializeRegistry Flags
157 //
158 #define CM_BOOT_FLAG_SMSS                 0x0000
159 #define CM_BOOT_FLAG_SETUP                0x0001
160 #define CM_BOOT_FLAG_ACCEPTED             0x0002
161 #define CM_BOOT_FLAG_MAX                  (CM_BOOT_FLAG_ACCEPTED + 999)
162 
163 #ifdef NTOS_MODE_USER
164 
165 //
166 // Information Classes for NtQueryKey
167 //
168 typedef enum _KEY_INFORMATION_CLASS
169 {
170     KeyBasicInformation,
171     KeyNodeInformation,
172     KeyFullInformation,
173     KeyNameInformation,
174     KeyCachedInformation,
175     KeyFlagsInformation,
176     KeyVirtualizationInformation,
177     KeyHandleTagsInformation,
178     MaxKeyInfoClass
179 } KEY_INFORMATION_CLASS;
180 
181 typedef enum _KEY_VALUE_INFORMATION_CLASS
182 {
183     KeyValueBasicInformation,
184     KeyValueFullInformation,
185     KeyValuePartialInformation,
186     KeyValueFullInformationAlign64,
187     KeyValuePartialInformationAlign64,
188     MaxKeyValueInfoClass
189 } KEY_VALUE_INFORMATION_CLASS;
190 
191 typedef enum _KEY_SET_INFORMATION_CLASS
192 {
193     KeyWriteTimeInformation,
194     KeyWow64FlagsInformation,
195     KeyControlFlagsInformation,
196     KeySetVirtualizationInformation,
197     KeySetDebugInformation,
198     KeySetHandleTagsInformation,
199     MaxKeySetInfoClass
200 } KEY_SET_INFORMATION_CLASS;
201 
202 #endif
203 
204 //
205 // Plag and Play Classes
206 //
207 typedef enum _PLUGPLAY_CONTROL_CLASS
208 {
209     PlugPlayControlEnumerateDevice,
210     PlugPlayControlRegisterNewDevice,
211     PlugPlayControlDeregisterDevice,
212     PlugPlayControlInitializeDevice,
213     PlugPlayControlStartDevice,
214     PlugPlayControlUnlockDevice,
215     PlugPlayControlQueryAndRemoveDevice,
216     PlugPlayControlUserResponse,
217     PlugPlayControlGenerateLegacyDevice,
218     PlugPlayControlGetInterfaceDeviceList,
219     PlugPlayControlProperty,
220     PlugPlayControlDeviceClassAssociation,
221     PlugPlayControlGetRelatedDevice,
222     PlugPlayControlGetInterfaceDeviceAlias,
223     PlugPlayControlDeviceStatus,
224     PlugPlayControlGetDeviceDepth,
225     PlugPlayControlQueryDeviceRelations,
226     PlugPlayControlTargetDeviceRelation,
227     PlugPlayControlQueryConflictList,
228     PlugPlayControlRetrieveDock,
229     PlugPlayControlResetDevice,
230     PlugPlayControlHaltDevice,
231     PlugPlayControlGetBlockedDriverList,
232     MaxPlugPlayControl
233 } PLUGPLAY_CONTROL_CLASS;
234 
235 typedef enum _PLUGPLAY_BUS_CLASS
236 {
237     SystemBus,
238     PlugPlayVirtualBus,
239     MaxPlugPlayBusClass
240 } PLUGPLAY_BUS_CLASS, *PPLUGPLAY_BUS_CLASS;
241 
242 //
243 // Plag and Play Bus Types
244 //
245 typedef enum _PLUGPLAY_VIRTUAL_BUS_TYPE
246 {
247     Root,
248     MaxPlugPlayVirtualBusType
249 } PLUGPLAY_VIRTUAL_BUS_TYPE, *PPLUGPLAY_VIRTUAL_BUS_TYPE;
250 
251 //
252 // Plag and Play Event Categories
253 //
254 typedef enum _PLUGPLAY_EVENT_CATEGORY
255 {
256     HardwareProfileChangeEvent,
257     TargetDeviceChangeEvent,
258     DeviceClassChangeEvent,
259     CustomDeviceEvent,
260     DeviceInstallEvent,
261     DeviceArrivalEvent,
262     PowerEvent,
263     VetoEvent,
264     BlockedDriverEvent,
265     MaxPlugEventCategory
266 } PLUGPLAY_EVENT_CATEGORY;
267 
268 #ifdef NTOS_MODE_USER
269 
270 //
271 // Information Structures for NtQueryKeyInformation
272 //
273 typedef struct _KEY_WRITE_TIME_INFORMATION
274 {
275     LARGE_INTEGER LastWriteTime;
276 } KEY_WRITE_TIME_INFORMATION, *PKEY_WRITE_TIME_INFORMATION;
277 
278 typedef struct _KEY_WOW64_FLAGS_INFORMATION
279 {
280     ULONG UserFlags;
281 } KEY_WOW64_FLAGS_INFORMATION, *PKEY_WOW64_FLAGS_INFORMATION;
282 
283 typedef struct _KEY_USER_FLAGS_INFORMATION
284 {
285     ULONG UserFlags;
286 } KEY_USER_FLAGS_INFORMATION, *PKEY_USER_FLAGS_INFORMATION;
287 
288 typedef struct _KEY_HANDLE_TAGS_INFORMATION
289 {
290     ULONG HandleTags;
291 } KEY_HANDLE_TAGS_INFORMATION, *PKEY_HANDLE_TAGS_INFORMATION;
292 
293 typedef struct _KEY_CONTROL_FLAGS_INFORMATION
294 {
295     ULONG ControlFlags;
296 } KEY_CONTROL_FLAGS_INFORMATION, *PKEY_CONTROL_FLAGS_INFORMATION;
297 
298 typedef struct _KEY_VIRTUALIZATION_INFORMATION
299 {
300     ULONG VirtualizationCandidate:1;
301     ULONG VirtualizationEnabled:1;
302     ULONG VirtualTarget:1;
303     ULONG VirtualStore:1;
304     ULONG VirtualSource:1;
305     ULONG Reserved:27;
306 } KEY_VIRTUALIZATION_INFORMATION, *PKEY_VIRTUALIZATION_INFORMATION;
307 
308 typedef struct _KEY_SET_VIRTUALIZATION_INFORMATION
309 {
310     ULONG VirtualTarget:1;
311     ULONG VirtualStore:1;
312     ULONG VirtualSource:1;
313     ULONG Reserved:29;
314 } KEY_SET_VIRTUALIZATION_INFORMATION, *PKEY_SET_VIRTUALIZATION_INFORMATION;
315 
316 
317 typedef struct _KEY_FULL_INFORMATION
318 {
319     LARGE_INTEGER LastWriteTime;
320     ULONG TitleIndex;
321     ULONG ClassOffset;
322     ULONG ClassLength;
323     ULONG SubKeys;
324     ULONG MaxNameLen;
325     ULONG MaxClassLen;
326     ULONG Values;
327     ULONG MaxValueNameLen;
328     ULONG MaxValueDataLen;
329     WCHAR Class[1];
330 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
331 
332 typedef struct _KEY_NAME_INFORMATION
333 {
334     ULONG NameLength;
335     WCHAR Name[1];
336 } KEY_NAME_INFORMATION, *PKEY_NAME_INFORMATION;
337 
338 
339 typedef struct _KEY_NODE_INFORMATION
340 {
341     LARGE_INTEGER LastWriteTime;
342     ULONG TitleIndex;
343     ULONG ClassOffset;
344     ULONG ClassLength;
345     ULONG NameLength;
346     WCHAR Name[1];
347 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
348 
349 typedef struct _KEY_VALUE_ENTRY
350 {
351     PUNICODE_STRING ValueName;
352     ULONG DataLength;
353     ULONG DataOffset;
354     ULONG Type;
355 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
356 
357 typedef struct _KEY_VALUE_PARTIAL_INFORMATION
358 {
359     ULONG TitleIndex;
360     ULONG Type;
361     ULONG DataLength;
362     UCHAR Data[1];
363 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
364 
365 typedef struct _KEY_VALUE_PARTIAL_INFORMATION_ALIGN64
366 {
367     ULONG Type;
368     ULONG DataLength;
369     UCHAR Data[1];
370 } KEY_VALUE_PARTIAL_INFORMATION_ALIGN64, *PKEY_VALUE_PARTIAL_INFORMATION_ALIGN64;
371 
372 typedef struct _KEY_VALUE_BASIC_INFORMATION
373 {
374     ULONG TitleIndex;
375     ULONG Type;
376     ULONG NameLength;
377     WCHAR Name[1];
378 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
379 
380 typedef struct _KEY_VALUE_FULL_INFORMATION
381 {
382     ULONG TitleIndex;
383     ULONG Type;
384     ULONG DataOffset;
385     ULONG DataLength;
386     ULONG NameLength;
387     WCHAR Name[1];
388 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
389 
390 typedef struct _KEY_BASIC_INFORMATION
391 {
392     LARGE_INTEGER LastWriteTime;
393     ULONG TitleIndex;
394     ULONG NameLength;
395     WCHAR Name[1];
396 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
397 
398 #endif
399 
400 //
401 // Plug and Play Event Block
402 //
403 typedef struct _PLUGPLAY_EVENT_BLOCK
404 {
405     GUID EventGuid;
406     PLUGPLAY_EVENT_CATEGORY EventCategory;
407     PULONG Result;
408     ULONG Flags;
409     ULONG TotalSize;
410     PVOID DeviceObject;
411     union
412     {
413         struct
414         {
415             GUID ClassGuid;
416             WCHAR SymbolicLinkName[ANYSIZE_ARRAY];
417         } DeviceClass;
418         struct
419         {
420             WCHAR DeviceIds[ANYSIZE_ARRAY];
421         } TargetDevice;
422         struct
423         {
424             WCHAR DeviceId[ANYSIZE_ARRAY];
425         } InstallDevice;
426         struct
427         {
428             PVOID NotificationStructure;
429             WCHAR DeviceIds[ANYSIZE_ARRAY];
430         } CustomNotification;
431         struct
432         {
433             PVOID Notification;
434         } ProfileNotification;
435         struct
436         {
437             ULONG NotificationCode;
438             ULONG NotificationData;
439         } PowerNotification;
440         struct
441         {
442             PNP_VETO_TYPE VetoType;
443             WCHAR DeviceIdVetoNameBuffer[ANYSIZE_ARRAY];
444         } VetoNotification;
445         struct
446         {
447             GUID BlockedDriverGuid;
448         } BlockedDriverNotification;
449     };
450 } PLUGPLAY_EVENT_BLOCK, *PPLUGPLAY_EVENT_BLOCK;
451 
452 //
453 // Plug and Play Control Classes
454 //
455 
456 // PlugPlayControlEnumerateDevice (0x00)
457 typedef struct _PLUGPLAY_CONTROL_ENUMERATE_DEVICE_DATA
458 {
459     UNICODE_STRING DeviceInstance;
460     ULONG Flags;
461 } PLUGPLAY_CONTROL_ENUMERATE_DEVICE_DATA, *PPLUGPLAY_CONTROL_ENUMERATE_DEVICE_DATA;
462 
463 // PlugPlayControlRegisterNewDevice (0x1)
464 // PlugPlayControlDeregisterDevice (0x2)
465 // PlugPlayControlInitializeDevice (0x3)
466 // PlugPlayControlStartDevice (0x4)
467 // PlugPlayControlUnlockDevice (0x5)
468 // PlugPlayControlResetDevice (0x14)
469 // PlugPlayControlHaltDevice (0x15)
470 typedef struct _PLUGPLAY_CONTROL_DEVICE_CONTROL_DATA
471 {
472     UNICODE_STRING DeviceInstance;
473 } PLUGPLAY_CONTROL_DEVICE_CONTROL_DATA, *PPLUGPLAY_CONTROL_DEVICE_CONTROL_DATA;
474 
475 // PlugPlayControlQueryAndRemoveDevice (0x06)
476 typedef struct _PLUGPLAY_CONTROL_QUERY_REMOVE_DATA
477 {
478     UNICODE_STRING DeviceInstance;
479     ULONG Flags;
480     PNP_VETO_TYPE VetoType;
481     LPWSTR VetoName;
482     ULONG NameLength;
483 } PLUGPLAY_CONTROL_QUERY_REMOVE_DATA, *PPLUGPLAY_CONTROL_QUERY_REMOVE_DATA;
484 
485 // PlugPlayControlUserResponse (0x07)
486 typedef struct _PLUGPLAY_CONTROL_USER_RESPONSE_DATA
487 {
488     ULONG Unknown1;
489     ULONG Unknown2;
490     ULONG Unknown3;
491     ULONG Unknown4;
492 } PLUGPLAY_CONTROL_USER_RESPONSE_DATA, *PPLUGPLAY_CONTROL_USER_RESPONSE_DATA;
493 
494 // PlugPlayControlGetInterfaceDeviceList (0x09)
495 typedef struct _PLUGPLAY_CONTROL_INTERFACE_DEVICE_LIST_DATA
496 {
497     UNICODE_STRING DeviceInstance;
498     LPGUID FilterGuid;
499     ULONG Flags;
500     PVOID Buffer;
501     ULONG BufferSize;
502 } PLUGPLAY_CONTROL_INTERFACE_DEVICE_LIST_DATA, *PPLUGPLAY_CONTROL_INTERFACE_DEVICE_LIST_DATA;
503 
504 // PlugPlayControlProperty (0x0A)
505 typedef struct _PLUGPLAY_CONTROL_PROPERTY_DATA
506 {
507     UNICODE_STRING DeviceInstance;
508     ULONG Property;
509     PVOID Buffer;
510     ULONG BufferSize;
511 } PLUGPLAY_CONTROL_PROPERTY_DATA, *PPLUGPLAY_CONTROL_PROPERTY_DATA;
512 
513 // PlugPlayControlGetRelatedDevice (0x0C)
514 typedef struct _PLUGPLAY_CONTROL_RELATED_DEVICE_DATA
515 {
516     UNICODE_STRING TargetDeviceInstance;
517     ULONG Relation;
518     PWCHAR RelatedDeviceInstance;
519     ULONG RelatedDeviceInstanceLength;
520 } PLUGPLAY_CONTROL_RELATED_DEVICE_DATA, *PPLUGPLAY_CONTROL_RELATED_DEVICE_DATA;
521 
522 // PlugPlayControlDeviceStatus (0x0E)
523 typedef struct _PLUGPLAY_CONTOL_STATUS_DATA
524 {
525     UNICODE_STRING DeviceInstance;
526     ULONG Operation;
527     ULONG DeviceStatus;
528     ULONG DeviceProblem;
529 } PLUGPLAY_CONTROL_STATUS_DATA, *PPLUGPLAY_CONTROL_STATUS_DATA;
530 
531 // PlugPlayControlGetDeviceDepth (0x0F)
532 typedef struct _PLUGPLAY_CONTROL_DEPTH_DATA
533 {
534     UNICODE_STRING DeviceInstance;
535     ULONG Depth;
536 } PLUGPLAY_CONTROL_DEPTH_DATA, *PPLUGPLAY_CONTROL_DEPTH_DATA;
537 
538 // PlugPlayControlQueryDeviceRelations (0x10)
539 typedef struct _PLUGPLAY_CONTROL_DEVICE_RELATIONS_DATA
540 {
541     UNICODE_STRING DeviceInstance;
542     ULONG Relations;
543     ULONG BufferSize;
544     PWCHAR Buffer;
545 } PLUGPLAY_CONTROL_DEVICE_RELATIONS_DATA, *PPLUGPLAY_CONTROL_DEVICE_RELATIONS_DATA;
546 
547 // PlugPlayControlRetrieveDock (0x13)
548 typedef struct _PLUGPLAY_CONTROL_RETRIEVE_DOCK_DATA
549 {
550     ULONG DeviceInstanceLength;
551     PWSTR DeviceInstance;
552 } PLUGPLAY_CONTROL_RETRIEVE_DOCK_DATA, *PPLUGPLAY_CONTROL_RETRIEVE_DOCK_DATA;
553 
554 //
555 // Plug and Play Bus Type Definition
556 //
557 typedef struct _PLUGPLAY_BUS_TYPE
558 {
559     PLUGPLAY_BUS_CLASS BusClass;
560     union
561     {
562         INTERFACE_TYPE SystemBusType;
563         PLUGPLAY_VIRTUAL_BUS_TYPE PlugPlayVirtualBusType;
564     };
565 } PLUGPLAY_BUS_TYPE, *PPLUGPLAY_BUS_TYPE;
566 
567 //
568 // Plug and Play Bus Instance Definition
569 //
570 typedef struct _PLUGPLAY_BUS_INSTANCE
571 {
572     PLUGPLAY_BUS_TYPE BusType;
573     ULONG BusNumber;
574     WCHAR BusName[MAX_BUS_NAME];
575 } PLUGPLAY_BUS_INSTANCE, *PPLUGPLAY_BUS_INSTANCE;
576 
577 #ifdef NTOS_MODE_USER
578 
579 //
580 // Partial Resource Descriptor and List for Hardware
581 //
582 #include <pshpack1.h>
583 typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR
584 {
585     UCHAR Type;
586     UCHAR ShareDisposition;
587     USHORT Flags;
588     union
589     {
590         struct
591         {
592             PHYSICAL_ADDRESS Start;
593             ULONG Length;
594         } Generic;
595         struct
596         {
597             PHYSICAL_ADDRESS Start;
598             ULONG Length;
599         } Port;
600         struct
601         {
602             ULONG Level;
603             ULONG Vector;
604             KAFFINITY Affinity;
605         } Interrupt;
606 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
607         struct
608         {
609             union
610             {
611                 struct
612                 {
613                     USHORT Reserved;
614                     USHORT MessageCount;
615                     ULONG Vector;
616                     KAFFINITY Affinity;
617                 } Raw;
618                 struct
619                 {
620                     ULONG Level;
621                     ULONG Vector;
622                     KAFFINITY Affinity;
623                 } Translated;
624             };
625         } MessageInterrupt;
626 #endif
627         struct
628         {
629             PHYSICAL_ADDRESS Start;
630             ULONG Length;
631         } Memory;
632         struct
633         {
634             ULONG Channel;
635             ULONG Port;
636             ULONG Reserved1;
637         } Dma;
638         struct
639         {
640             ULONG Data[3];
641         } DevicePrivate;
642         struct
643         {
644             ULONG Start;
645             ULONG Length;
646             ULONG Reserved;
647         } BusNumber;
648         struct
649         {
650             ULONG DataSize;
651             ULONG Reserved1;
652             ULONG Reserved2;
653         } DeviceSpecificData;
654 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
655         struct
656         {
657             PHYSICAL_ADDRESS Start;
658             ULONG Length40;
659         } Memory40;
660         struct
661         {
662             PHYSICAL_ADDRESS Start;
663             ULONG Length48;
664         } Memory48;
665         struct
666         {
667             PHYSICAL_ADDRESS Start;
668             ULONG Length64;
669         } Memory64;
670 #endif
671     } u;
672 } CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR;
673 
674 typedef struct _CM_PARTIAL_RESOURCE_LIST
675 {
676     USHORT Version;
677     USHORT Revision;
678     ULONG Count;
679     CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1];
680 } CM_PARTIAL_RESOURCE_LIST, *PCM_PARTIAL_RESOURCE_LIST;
681 
682 //
683 // Full Resource Descriptor and List for Hardware
684 //
685 typedef struct _CM_FULL_RESOURCE_DESCRIPTOR
686 {
687     INTERFACE_TYPE InterfaceType;
688     ULONG BusNumber;
689     CM_PARTIAL_RESOURCE_LIST PartialResourceList;
690 } CM_FULL_RESOURCE_DESCRIPTOR, *PCM_FULL_RESOURCE_DESCRIPTOR;
691 
692 typedef struct _CM_RESOURCE_LIST
693 {
694     ULONG Count;
695     CM_FULL_RESOURCE_DESCRIPTOR List[1];
696 } CM_RESOURCE_LIST, *PCM_RESOURCE_LIST;
697 
698 //
699 // ROM Block Structure
700 //
701 typedef struct _CM_ROM_BLOCK
702 {
703     ULONG Address;
704     ULONG Size;
705 } CM_ROM_BLOCK, *PCM_ROM_BLOCK;
706 
707 //
708 // Disk/INT13 Structures
709 //
710 typedef struct _CM_INT13_DRIVE_PARAMETER
711 {
712     USHORT DriveSelect;
713     ULONG MaxCylinders;
714     USHORT SectorsPerTrack;
715     USHORT MaxHeads;
716     USHORT NumberDrives;
717 } CM_INT13_DRIVE_PARAMETER, *PCM_INT13_DRIVE_PARAMETER;
718 
719 typedef struct _CM_DISK_GEOMETRY_DEVICE_DATA
720 {
721     ULONG BytesPerSector;
722     ULONG NumberOfCylinders;
723     ULONG SectorsPerTrack;
724     ULONG NumberOfHeads;
725 } CM_DISK_GEOMETRY_DEVICE_DATA, *PCM_DISK_GEOMETRY_DEVICE_DATA;
726 
727 #include <poppack.h>
728 
729 #endif // _!NTOS_MODE_USER
730 
731 #endif // _CMTYPES_H
732 
733 
734 
735