3 Copyright (c) Alex Ionescu. All rights reserved.
11 Type definitions for the Configuration Manager.
15 Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
29 #define MAX_BUS_NAME 24
32 // PLUGPLAY_CONTROL_RELATED_DEVICE_DATA.Relations
34 #define PNP_GET_PARENT_DEVICE 1
35 #define PNP_GET_CHILD_DEVICE 2
36 #define PNP_GET_SIBLING_DEVICE 3
39 // PLUGPLAY_CONTROL_STATUS_DATA Operations
41 #define PNP_GET_DEVICE_STATUS 0
42 #define PNP_SET_DEVICE_STATUS 1
43 #define PNP_CLEAR_DEVICE_STATUS 2
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
66 // Resource Descriptor Share Dispositions
68 typedef enum _CM_SHARE_DISPOSITION
70 CmResourceShareUndetermined
,
71 CmResourceShareDeviceExclusive
,
72 CmResourceShareDriverExclusive
,
74 } CM_SHARE_DISPOSITION
;
79 // Port Resource Descriptor Flags
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
91 // Memory Resource Descriptor Flags
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
102 // DMA Resource Descriptor Flags
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
114 // Interrupt Resource Descriptor Flags
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
122 // NtInitializeRegistry Flags
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
129 #ifdef NTOS_MODE_USER
132 // Information Classes for NtQueryKey
134 typedef enum _KEY_INFORMATION_CLASS
140 KeyCachedInformation
,
142 KeyVirtualizationInformation
,
143 KeyHandleTagsInformation
,
145 } KEY_INFORMATION_CLASS
;
147 typedef enum _KEY_VALUE_INFORMATION_CLASS
149 KeyValueBasicInformation
,
150 KeyValueFullInformation
,
151 KeyValuePartialInformation
,
152 KeyValueFullInformationAlign64
,
153 KeyValuePartialInformationAlign64
,
155 } KEY_VALUE_INFORMATION_CLASS
;
157 typedef enum _KEY_SET_INFORMATION_CLASS
{
158 KeyWriteTimeInformation
,
159 KeyWow64FlagsInformation
,
160 KeyControlFlagsInformation
,
161 KeySetVirtualizationInformation
,
162 KeySetDebugInformation
,
163 KeySetHandleTagsInformation
,
165 } KEY_SET_INFORMATION_CLASS
;
170 // Plag and Play Classes
172 typedef enum _PLUGPLAY_CONTROL_CLASS
174 PlugPlayControlUserResponse
= 0x07,
175 PlugPlayControlProperty
= 0x0A,
176 PlugPlayControlGetRelatedDevice
= 0x0C,
177 PlugPlayControlDeviceStatus
= 0x0E,
178 PlugPlayControlGetDeviceDepth
,
179 PlugPlayControlResetDevice
= 0x14
180 } PLUGPLAY_CONTROL_CLASS
;
182 typedef enum _PLUGPLAY_BUS_CLASS
187 } PLUGPLAY_BUS_CLASS
, *PPLUGPLAY_BUS_CLASS
;
190 // Plag and Play Bus Types
192 typedef enum _PLUGPLAY_VIRTUAL_BUS_TYPE
195 MaxPlugPlayVirtualBusType
196 } PLUGPLAY_VIRTUAL_BUS_TYPE
, *PPLUGPLAY_VIRTUAL_BUS_TYPE
;
199 // Plag and Play Event Categories
201 typedef enum _PLUGPLAY_EVENT_CATEGORY
203 HardwareProfileChangeEvent
,
204 TargetDeviceChangeEvent
,
205 DeviceClassChangeEvent
,
213 } PLUGPLAY_EVENT_CATEGORY
;
215 #ifdef NTOS_MODE_USER
218 // Information Structures for NtQueryKeyInformation
220 typedef struct _KEY_WRITE_TIME_INFORMATION
222 LARGE_INTEGER LastWriteTime
;
223 } KEY_WRITE_TIME_INFORMATION
, *PKEY_WRITE_TIME_INFORMATION
;
225 typedef struct _KEY_WOW64_FLAGS_INFORMATION
228 } KEY_WOW64_FLAGS_INFORMATION
, *PKEY_WOW64_FLAGS_INFORMATION
;
230 typedef struct _KEY_USER_FLAGS_INFORMATION
233 } KEY_USER_FLAGS_INFORMATION
, *PKEY_USER_FLAGS_INFORMATION
;
235 typedef struct _KEY_HANDLE_TAGS_INFORMATION
238 } KEY_HANDLE_TAGS_INFORMATION
, *PKEY_HANDLE_TAGS_INFORMATION
;
240 typedef struct _KEY_CONTROL_FLAGS_INFORMATION
243 } KEY_CONTROL_FLAGS_INFORMATION
, *PKEY_CONTROL_FLAGS_INFORMATION
;
245 typedef struct _KEY_VIRTUALIZATION_INFORMATION
247 ULONG VirtualizationCandidate
:1;
248 ULONG VirtualizationEnabled
:1;
249 ULONG VirtualTarget
:1;
250 ULONG VirtualStore
:1;
251 ULONG VirtualSource
:1;
253 } KEY_VIRTUALIZATION_INFORMATION
, *PKEY_VIRTUALIZATION_INFORMATION
;
255 typedef struct _KEY_SET_VIRTUALIZATION_INFORMATION
257 ULONG VirtualTarget
:1;
258 ULONG VirtualStore
:1;
259 ULONG VirtualSource
:1;
261 } KEY_SET_VIRTUALIZATION_INFORMATION
, *PKEY_SET_VIRTUALIZATION_INFORMATION
;
264 typedef struct _KEY_FULL_INFORMATION
266 LARGE_INTEGER LastWriteTime
;
274 ULONG MaxValueNameLen
;
275 ULONG MaxValueDataLen
;
277 } KEY_FULL_INFORMATION
, *PKEY_FULL_INFORMATION
;
279 typedef struct _KEY_NAME_INFORMATION
282 } KEY_NAME_INFORMATION
, *PKEY_NAME_INFORMATION
;
285 typedef struct _KEY_NODE_INFORMATION
287 LARGE_INTEGER LastWriteTime
;
293 } KEY_NODE_INFORMATION
, *PKEY_NODE_INFORMATION
;
295 typedef struct _KEY_VALUE_ENTRY
297 PUNICODE_STRING ValueName
;
301 } KEY_VALUE_ENTRY
, *PKEY_VALUE_ENTRY
;
303 typedef struct _KEY_VALUE_PARTIAL_INFORMATION
309 } KEY_VALUE_PARTIAL_INFORMATION
, *PKEY_VALUE_PARTIAL_INFORMATION
;
311 typedef struct _KEY_VALUE_PARTIAL_INFORMATION_ALIGN64
316 } KEY_VALUE_PARTIAL_INFORMATION_ALIGN64
, *PKEY_VALUE_PARTIAL_INFORMATION_ALIGN64
;
318 typedef struct _KEY_VALUE_BASIC_INFORMATION
324 } KEY_VALUE_BASIC_INFORMATION
, *PKEY_VALUE_BASIC_INFORMATION
;
326 typedef struct _KEY_VALUE_FULL_INFORMATION
334 } KEY_VALUE_FULL_INFORMATION
, *PKEY_VALUE_FULL_INFORMATION
;
336 typedef struct _KEY_BASIC_INFORMATION
338 LARGE_INTEGER LastWriteTime
;
342 } KEY_BASIC_INFORMATION
, *PKEY_BASIC_INFORMATION
;
347 // Plug and Play Event Block
349 typedef struct _PLUGPLAY_EVENT_BLOCK
352 PLUGPLAY_EVENT_CATEGORY EventCategory
;
362 WCHAR SymbolicLinkName
[ANYSIZE_ARRAY
];
366 WCHAR DeviceIds
[ANYSIZE_ARRAY
];
370 WCHAR DeviceId
[ANYSIZE_ARRAY
];
374 PVOID NotificationStructure
;
375 WCHAR DeviceIds
[ANYSIZE_ARRAY
];
376 } CustomNotification
;
380 } ProfileNotification
;
383 ULONG NotificationCode
;
384 ULONG NotificationData
;
388 PNP_VETO_TYPE VetoType
;
389 WCHAR DeviceIdVetoNameBuffer
[ANYSIZE_ARRAY
];
393 GUID BlockedDriverGuid
;
394 } BlockedDriverNotification
;
396 } PLUGPLAY_EVENT_BLOCK
, *PPLUGPLAY_EVENT_BLOCK
;
399 // Plug and Play Control Classes
403 typedef struct _PLUGPLAY_CONTROL_PROPERTY_DATA
405 UNICODE_STRING DeviceInstance
;
409 } PLUGPLAY_CONTROL_PROPERTY_DATA
, *PPLUGPLAY_CONTROL_PROPERTY_DATA
;
412 typedef struct _PLUGPLAY_CONTROL_RELATED_DEVICE_DATA
414 UNICODE_STRING TargetDeviceInstance
;
416 PWCHAR RelatedDeviceInstance
;
417 ULONG RelatedDeviceInstanceLength
;
418 } PLUGPLAY_CONTROL_RELATED_DEVICE_DATA
, *PPLUGPLAY_CONTROL_RELATED_DEVICE_DATA
;
421 typedef struct _PLUGPLAY_CONTOL_STATUS_DATA
423 UNICODE_STRING DeviceInstance
;
427 } PLUGPLAY_CONTROL_STATUS_DATA
, *PPLUGPLAY_CONTROL_STATUS_DATA
;
430 typedef struct _PLUGPLAY_CONTROL_DEPTH_DATA
432 UNICODE_STRING DeviceInstance
;
434 } PLUGPLAY_CONTROL_DEPTH_DATA
, *PPLUGPLAY_CONTROL_DEPTH_DATA
;
437 typedef struct _PLUGPLAY_CONTROL_RESET_DEVICE_DATA
439 UNICODE_STRING DeviceInstance
;
440 } PLUGPLAY_CONTROL_RESET_DEVICE_DATA
, *PPLUGPLAY_CONTROL_RESET_DEVICE_DATA
;
443 // Plug and Play Bus Type Definition
445 typedef struct _PLUGPLAY_BUS_TYPE
447 PLUGPLAY_BUS_CLASS BusClass
;
450 INTERFACE_TYPE SystemBusType
;
451 PLUGPLAY_VIRTUAL_BUS_TYPE PlugPlayVirtualBusType
;
453 } PLUGPLAY_BUS_TYPE
, *PPLUGPLAY_BUS_TYPE
;
456 // Plug and Play Bus Instance Definition
458 typedef struct _PLUGPLAY_BUS_INSTANCE
460 PLUGPLAY_BUS_TYPE BusType
;
462 WCHAR BusName
[MAX_BUS_NAME
];
463 } PLUGPLAY_BUS_INSTANCE
, *PPLUGPLAY_BUS_INSTANCE
;
465 #ifdef NTOS_MODE_USER
468 // Partial Resource Descriptor and List for Hardware
470 #include <pshpack1.h>
471 typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR
474 UCHAR ShareDisposition
;
480 PHYSICAL_ADDRESS Start
;
485 PHYSICAL_ADDRESS Start
;
494 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
517 PHYSICAL_ADDRESS Start
;
541 } DeviceSpecificData
;
542 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
545 PHYSICAL_ADDRESS Start
;
550 PHYSICAL_ADDRESS Start
;
555 PHYSICAL_ADDRESS Start
;
560 } CM_PARTIAL_RESOURCE_DESCRIPTOR
, *PCM_PARTIAL_RESOURCE_DESCRIPTOR
;
562 typedef struct _CM_PARTIAL_RESOURCE_LIST
567 CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors
[1];
568 } CM_PARTIAL_RESOURCE_LIST
, *PCM_PARTIAL_RESOURCE_LIST
;
571 // Full Resource Descriptor and List for Hardware
573 typedef struct _CM_FULL_RESOURCE_DESCRIPTOR
575 INTERFACE_TYPE InterfaceType
;
577 CM_PARTIAL_RESOURCE_LIST PartialResourceList
;
578 } CM_FULL_RESOURCE_DESCRIPTOR
, *PCM_FULL_RESOURCE_DESCRIPTOR
;
580 typedef struct _CM_RESOURCE_LIST
583 CM_FULL_RESOURCE_DESCRIPTOR List
[1];
584 } CM_RESOURCE_LIST
, *PCM_RESOURCE_LIST
;
587 // ROM Block Structure
589 typedef struct _CM_ROM_BLOCK
593 } CM_ROM_BLOCK
, *PCM_ROM_BLOCK
;
596 // Disk/INT13 Structures
598 typedef struct _CM_INT13_DRIVE_PARAMETER
602 USHORT SectorsPerTrack
;
605 } CM_INT13_DRIVE_PARAMETER
, *PCM_INT13_DRIVE_PARAMETER
;
607 typedef struct _CM_DISK_GEOMETRY_DEVICE_DATA
609 ULONG BytesPerSector
;
610 ULONG NumberOfCylinders
;
611 ULONG SectorsPerTrack
;
613 } CM_DISK_GEOMETRY_DEVICE_DATA
, *PCM_DISK_GEOMETRY_DEVICE_DATA
;
617 #endif // _!NTOS_MODE_USER