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
120 // NtInitializeRegistry Flags
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
127 #ifdef NTOS_MODE_USER
130 // Information Classes for NtQueryKey
132 typedef enum _KEY_INFORMATION_CLASS
138 KeyCachedInformation
,
140 } KEY_INFORMATION_CLASS
;
142 typedef enum _KEY_VALUE_INFORMATION_CLASS
144 KeyValueBasicInformation
,
145 KeyValueFullInformation
,
146 KeyValuePartialInformation
,
147 KeyValueFullInformationAlign64
,
148 KeyValuePartialInformationAlign64
149 } KEY_VALUE_INFORMATION_CLASS
;
151 typedef enum _KEY_SET_INFORMATION_CLASS
{
152 KeyWriteTimeInformation
,
153 KeyWow64FlagsInformation
,
154 KeyControlFlagsInformation
,
155 KeySetVirtualizationInformation
,
156 KeySetDebugInformation
,
157 KeySetHandleTagsInformation
,
159 } KEY_SET_INFORMATION_CLASS
;
164 // Plag and Play Classes
166 typedef enum _PLUGPLAY_CONTROL_CLASS
168 PlugPlayControlUserResponse
= 0x07,
169 PlugPlayControlProperty
= 0x0A,
170 PlugPlayControlGetRelatedDevice
= 0x0C,
171 PlugPlayControlDeviceStatus
= 0x0E,
172 PlugPlayControlGetDeviceDepth
,
173 PlugPlayControlResetDevice
= 0x14
174 } PLUGPLAY_CONTROL_CLASS
;
176 typedef enum _PLUGPLAY_BUS_CLASS
181 } PLUGPLAY_BUS_CLASS
, *PPLUGPLAY_BUS_CLASS
;
184 // Plag and Play Bus Types
186 typedef enum _PLUGPLAY_VIRTUAL_BUS_TYPE
189 MaxPlugPlayVirtualBusType
190 } PLUGPLAY_VIRTUAL_BUS_TYPE
, *PPLUGPLAY_VIRTUAL_BUS_TYPE
;
193 // Plag and Play Event Categories
195 typedef enum _PLUGPLAY_EVENT_CATEGORY
197 HardwareProfileChangeEvent
,
198 TargetDeviceChangeEvent
,
199 DeviceClassChangeEvent
,
207 } PLUGPLAY_EVENT_CATEGORY
;
209 #ifdef NTOS_MODE_USER
212 // Information Structures for NtQueryKeyInformation
214 typedef struct _KEY_WRITE_TIME_INFORMATION
216 LARGE_INTEGER LastWriteTime
;
217 } KEY_WRITE_TIME_INFORMATION
, *PKEY_WRITE_TIME_INFORMATION
;
219 typedef struct _KEY_USER_FLAGS_INFORMATION
222 } KEY_USER_FLAGS_INFORMATION
, *PKEY_USER_FLAGS_INFORMATION
;
224 typedef struct _KEY_FULL_INFORMATION
226 LARGE_INTEGER LastWriteTime
;
234 ULONG MaxValueNameLen
;
235 ULONG MaxValueDataLen
;
237 } KEY_FULL_INFORMATION
, *PKEY_FULL_INFORMATION
;
239 typedef struct _KEY_NAME_INFORMATION
242 } KEY_NAME_INFORMATION
, *PKEY_NAME_INFORMATION
;
245 typedef struct _KEY_NODE_INFORMATION
247 LARGE_INTEGER LastWriteTime
;
253 } KEY_NODE_INFORMATION
, *PKEY_NODE_INFORMATION
;
255 typedef struct _KEY_VALUE_ENTRY
257 PUNICODE_STRING ValueName
;
261 } KEY_VALUE_ENTRY
, *PKEY_VALUE_ENTRY
;
263 typedef struct _KEY_VALUE_PARTIAL_INFORMATION
269 } KEY_VALUE_PARTIAL_INFORMATION
, *PKEY_VALUE_PARTIAL_INFORMATION
;
271 typedef struct _KEY_VALUE_BASIC_INFORMATION
277 } KEY_VALUE_BASIC_INFORMATION
, *PKEY_VALUE_BASIC_INFORMATION
;
279 typedef struct _KEY_VALUE_FULL_INFORMATION
287 } KEY_VALUE_FULL_INFORMATION
, *PKEY_VALUE_FULL_INFORMATION
;
289 typedef struct _KEY_BASIC_INFORMATION
291 LARGE_INTEGER LastWriteTime
;
295 } KEY_BASIC_INFORMATION
, *PKEY_BASIC_INFORMATION
;
300 // Plug and Play Event Block
302 typedef struct _PLUGPLAY_EVENT_BLOCK
305 PLUGPLAY_EVENT_CATEGORY EventCategory
;
315 WCHAR SymbolicLinkName
[ANYSIZE_ARRAY
];
319 WCHAR DeviceIds
[ANYSIZE_ARRAY
];
323 WCHAR DeviceId
[ANYSIZE_ARRAY
];
327 PVOID NotificationStructure
;
328 WCHAR DeviceIds
[ANYSIZE_ARRAY
];
329 } CustomNotification
;
333 } ProfileNotification
;
336 ULONG NotificationCode
;
337 ULONG NotificationData
;
341 PNP_VETO_TYPE VetoType
;
342 WCHAR DeviceIdVetoNameBuffer
[ANYSIZE_ARRAY
];
346 GUID BlockedDriverGuid
;
347 } BlockedDriverNotification
;
349 } PLUGPLAY_EVENT_BLOCK
, *PPLUGPLAY_EVENT_BLOCK
;
352 // Plug and Play Control Classes
356 typedef struct _PLUGPLAY_CONTROL_PROPERTY_DATA
358 UNICODE_STRING DeviceInstance
;
362 } PLUGPLAY_CONTROL_PROPERTY_DATA
, *PPLUGPLAY_CONTROL_PROPERTY_DATA
;
365 typedef struct _PLUGPLAY_CONTROL_RELATED_DEVICE_DATA
367 UNICODE_STRING TargetDeviceInstance
;
369 PWCHAR RelatedDeviceInstance
;
370 ULONG RelatedDeviceInstanceLength
;
371 } PLUGPLAY_CONTROL_RELATED_DEVICE_DATA
, *PPLUGPLAY_CONTROL_RELATED_DEVICE_DATA
;
374 typedef struct _PLUGPLAY_CONTOL_STATUS_DATA
376 UNICODE_STRING DeviceInstance
;
380 } PLUGPLAY_CONTROL_STATUS_DATA
, *PPLUGPLAY_CONTROL_STATUS_DATA
;
383 typedef struct _PLUGPLAY_CONTROL_DEPTH_DATA
385 UNICODE_STRING DeviceInstance
;
387 } PLUGPLAY_CONTROL_DEPTH_DATA
, *PPLUGPLAY_CONTROL_DEPTH_DATA
;
390 typedef struct _PLUGPLAY_CONTROL_RESET_DEVICE_DATA
392 UNICODE_STRING DeviceInstance
;
393 } PLUGPLAY_CONTROL_RESET_DEVICE_DATA
, *PPLUGPLAY_CONTROL_RESET_DEVICE_DATA
;
396 // Plug and Play Bus Type Definition
398 typedef struct _PLUGPLAY_BUS_TYPE
400 PLUGPLAY_BUS_CLASS BusClass
;
403 INTERFACE_TYPE SystemBusType
;
404 PLUGPLAY_VIRTUAL_BUS_TYPE PlugPlayVirtualBusType
;
406 } PLUGPLAY_BUS_TYPE
, *PPLUGPLAY_BUS_TYPE
;
409 // Plug and Play Bus Instance Definition
411 typedef struct _PLUGPLAY_BUS_INSTANCE
413 PLUGPLAY_BUS_TYPE BusType
;
415 WCHAR BusName
[MAX_BUS_NAME
];
416 } PLUGPLAY_BUS_INSTANCE
, *PPLUGPLAY_BUS_INSTANCE
;
418 #ifdef NTOS_MODE_USER
421 // Partial Resource Descriptor and List for Hardware
423 #include <pshpack1.h>
424 typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR
427 UCHAR ShareDisposition
;
433 PHYSICAL_ADDRESS Start
;
438 PHYSICAL_ADDRESS Start
;
447 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
470 PHYSICAL_ADDRESS Start
;
494 } DeviceSpecificData
;
495 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
498 PHYSICAL_ADDRESS Start
;
503 PHYSICAL_ADDRESS Start
;
508 PHYSICAL_ADDRESS Start
;
513 } CM_PARTIAL_RESOURCE_DESCRIPTOR
, *PCM_PARTIAL_RESOURCE_DESCRIPTOR
;
515 typedef struct _CM_PARTIAL_RESOURCE_LIST
520 CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors
[1];
521 } CM_PARTIAL_RESOURCE_LIST
, *PCM_PARTIAL_RESOURCE_LIST
;
524 // Full Resource Descriptor and List for Hardware
526 typedef struct _CM_FULL_RESOURCE_DESCRIPTOR
528 INTERFACE_TYPE InterfaceType
;
530 CM_PARTIAL_RESOURCE_LIST PartialResourceList
;
531 } CM_FULL_RESOURCE_DESCRIPTOR
, *PCM_FULL_RESOURCE_DESCRIPTOR
;
533 typedef struct _CM_RESOURCE_LIST
536 CM_FULL_RESOURCE_DESCRIPTOR List
[1];
537 } CM_RESOURCE_LIST
, *PCM_RESOURCE_LIST
;
540 // ROM Block Structure
542 typedef struct _CM_ROM_BLOCK
546 } CM_ROM_BLOCK
, *PCM_ROM_BLOCK
;
549 // Disk/INT13 Structures
551 typedef struct _CM_INT13_DRIVE_PARAMETER
555 USHORT SectorsPerTrack
;
558 } CM_INT13_DRIVE_PARAMETER
, *PCM_INT13_DRIVE_PARAMETER
;
560 typedef struct _CM_DISK_GEOMETRY_DEVICE_DATA
562 ULONG BytesPerSector
;
563 ULONG NumberOfCylinders
;
564 ULONG SectorsPerTrack
;
566 } CM_DISK_GEOMETRY_DEVICE_DATA
, *PCM_DISK_GEOMETRY_DEVICE_DATA
;
570 #endif // _!NTOS_MODE_USER