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 // NtInitializeRegistry Flags
116 #define CM_BOOT_FLAG_SMSS 0x0000
117 #define CM_BOOT_FLAG_SETUP 0x0001
118 #define CM_BOOT_FLAG_ACCEPTED 0x0002
119 #define CM_BOOT_FLAG_MAX 0x03E9
121 #ifdef NTOS_MODE_USER
124 // Information Classes for NtQueryKey
126 typedef enum _KEY_INFORMATION_CLASS
132 KeyCachedInformation
,
134 } KEY_INFORMATION_CLASS
;
136 typedef enum _KEY_VALUE_INFORMATION_CLASS
138 KeyValueBasicInformation
,
139 KeyValueFullInformation
,
140 KeyValuePartialInformation
,
141 KeyValueFullInformationAlign64
,
142 KeyValuePartialInformationAlign64
143 } KEY_VALUE_INFORMATION_CLASS
;
145 typedef enum _KEY_SET_INFORMATION_CLASS
{
146 KeyWriteTimeInformation
,
147 KeyWow64FlagsInformation
,
148 KeyControlFlagsInformation
,
149 KeySetVirtualizationInformation
,
150 KeySetDebugInformation
,
151 KeySetHandleTagsInformation
,
153 } KEY_SET_INFORMATION_CLASS
;
158 // Plag and Play Classes
160 typedef enum _PLUGPLAY_CONTROL_CLASS
162 PlugPlayControlUserResponse
= 0x07,
163 PlugPlayControlProperty
= 0x0A,
164 PlugPlayControlGetRelatedDevice
= 0x0C,
165 PlugPlayControlDeviceStatus
= 0x0E,
166 PlugPlayControlGetDeviceDepth
,
167 PlugPlayControlResetDevice
= 0x14
168 } PLUGPLAY_CONTROL_CLASS
;
170 typedef enum _PLUGPLAY_BUS_CLASS
175 } PLUGPLAY_BUS_CLASS
, *PPLUGPLAY_BUS_CLASS
;
178 // Plag and Play Bus Types
180 typedef enum _PLUGPLAY_VIRTUAL_BUS_TYPE
183 MaxPlugPlayVirtualBusType
184 } PLUGPLAY_VIRTUAL_BUS_TYPE
, *PPLUGPLAY_VIRTUAL_BUS_TYPE
;
187 // Plag and Play Event Categories
189 typedef enum _PLUGPLAY_EVENT_CATEGORY
191 HardwareProfileChangeEvent
,
192 TargetDeviceChangeEvent
,
193 DeviceClassChangeEvent
,
201 } PLUGPLAY_EVENT_CATEGORY
;
203 #ifdef NTOS_MODE_USER
206 // Information Structures for NtQueryKeyInformation
208 typedef struct _KEY_WRITE_TIME_INFORMATION
210 LARGE_INTEGER LastWriteTime
;
211 } KEY_WRITE_TIME_INFORMATION
, *PKEY_WRITE_TIME_INFORMATION
;
213 typedef struct _KEY_USER_FLAGS_INFORMATION
216 } KEY_USER_FLAGS_INFORMATION
, *PKEY_USER_FLAGS_INFORMATION
;
218 typedef struct _KEY_FULL_INFORMATION
220 LARGE_INTEGER LastWriteTime
;
228 ULONG MaxValueNameLen
;
229 ULONG MaxValueDataLen
;
231 } KEY_FULL_INFORMATION
, *PKEY_FULL_INFORMATION
;
233 typedef struct _KEY_NAME_INFORMATION
236 } KEY_NAME_INFORMATION
, *PKEY_NAME_INFORMATION
;
239 typedef struct _KEY_NODE_INFORMATION
241 LARGE_INTEGER LastWriteTime
;
247 } KEY_NODE_INFORMATION
, *PKEY_NODE_INFORMATION
;
249 typedef struct _KEY_VALUE_ENTRY
251 PUNICODE_STRING ValueName
;
255 } KEY_VALUE_ENTRY
, *PKEY_VALUE_ENTRY
;
257 typedef struct _KEY_VALUE_PARTIAL_INFORMATION
263 } KEY_VALUE_PARTIAL_INFORMATION
, *PKEY_VALUE_PARTIAL_INFORMATION
;
265 typedef struct _KEY_VALUE_BASIC_INFORMATION
271 } KEY_VALUE_BASIC_INFORMATION
, *PKEY_VALUE_BASIC_INFORMATION
;
273 typedef struct _KEY_VALUE_FULL_INFORMATION
281 } KEY_VALUE_FULL_INFORMATION
, *PKEY_VALUE_FULL_INFORMATION
;
283 typedef struct _KEY_BASIC_INFORMATION
285 LARGE_INTEGER LastWriteTime
;
289 } KEY_BASIC_INFORMATION
, *PKEY_BASIC_INFORMATION
;
294 // Plug and Play Event Block
296 typedef struct _PLUGPLAY_EVENT_BLOCK
299 PLUGPLAY_EVENT_CATEGORY EventCategory
;
309 WCHAR SymbolicLinkName
[ANYSIZE_ARRAY
];
313 WCHAR DeviceIds
[ANYSIZE_ARRAY
];
317 WCHAR DeviceId
[ANYSIZE_ARRAY
];
321 PVOID NotificationStructure
;
322 WCHAR DeviceIds
[ANYSIZE_ARRAY
];
323 } CustomNotification
;
327 } ProfileNotification
;
330 ULONG NotificationCode
;
331 ULONG NotificationData
;
335 PNP_VETO_TYPE VetoType
;
336 WCHAR DeviceIdVetoNameBuffer
[ANYSIZE_ARRAY
];
340 GUID BlockedDriverGuid
;
341 } BlockedDriverNotification
;
343 } PLUGPLAY_EVENT_BLOCK
, *PPLUGPLAY_EVENT_BLOCK
;
346 // Plug and Play Control Classes
350 typedef struct _PLUGPLAY_CONTROL_PROPERTY_DATA
352 UNICODE_STRING DeviceInstance
;
356 } PLUGPLAY_CONTROL_PROPERTY_DATA
, *PPLUGPLAY_CONTROL_PROPERTY_DATA
;
359 typedef struct _PLUGPLAY_CONTROL_RELATED_DEVICE_DATA
361 UNICODE_STRING TargetDeviceInstance
;
363 PWCHAR RelatedDeviceInstance
;
364 ULONG RelatedDeviceInstanceLength
;
365 } PLUGPLAY_CONTROL_RELATED_DEVICE_DATA
, *PPLUGPLAY_CONTROL_RELATED_DEVICE_DATA
;
368 typedef struct _PLUGPLAY_CONTOL_STATUS_DATA
370 UNICODE_STRING DeviceInstance
;
374 } PLUGPLAY_CONTROL_STATUS_DATA
, *PPLUGPLAY_CONTROL_STATUS_DATA
;
377 typedef struct _PLUGPLAY_CONTROL_DEPTH_DATA
379 UNICODE_STRING DeviceInstance
;
381 } PLUGPLAY_CONTROL_DEPTH_DATA
, *PPLUGPLAY_CONTROL_DEPTH_DATA
;
384 typedef struct _PLUGPLAY_CONTROL_RESET_DEVICE_DATA
386 UNICODE_STRING DeviceInstance
;
387 } PLUGPLAY_CONTROL_RESET_DEVICE_DATA
, *PPLUGPLAY_CONTROL_RESET_DEVICE_DATA
;
390 // Plug and Play Bus Type Definition
392 typedef struct _PLUGPLAY_BUS_TYPE
394 PLUGPLAY_BUS_CLASS BusClass
;
397 INTERFACE_TYPE SystemBusType
;
398 PLUGPLAY_VIRTUAL_BUS_TYPE PlugPlayVirtualBusType
;
400 } PLUGPLAY_BUS_TYPE
, *PPLUGPLAY_BUS_TYPE
;
403 // Plug and Play Bus Instance Definition
405 typedef struct _PLUGPLAY_BUS_INSTANCE
407 PLUGPLAY_BUS_TYPE BusType
;
409 WCHAR BusName
[MAX_BUS_NAME
];
410 } PLUGPLAY_BUS_INSTANCE
, *PPLUGPLAY_BUS_INSTANCE
;
412 #ifdef NTOS_MODE_USER
415 // Partial Resource Descriptor and List for Hardware
417 #include <pshpack1.h>
418 typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR
421 UCHAR ShareDisposition
;
427 PHYSICAL_ADDRESS Start
;
432 PHYSICAL_ADDRESS Start
;
441 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
464 PHYSICAL_ADDRESS Start
;
488 } DeviceSpecificData
;
489 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
492 PHYSICAL_ADDRESS Start
;
497 PHYSICAL_ADDRESS Start
;
502 PHYSICAL_ADDRESS Start
;
507 } CM_PARTIAL_RESOURCE_DESCRIPTOR
, *PCM_PARTIAL_RESOURCE_DESCRIPTOR
;
509 typedef struct _CM_PARTIAL_RESOURCE_LIST
514 CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors
[1];
515 } CM_PARTIAL_RESOURCE_LIST
, *PCM_PARTIAL_RESOURCE_LIST
;
518 // Full Resource Descriptor and List for Hardware
520 typedef struct _CM_FULL_RESOURCE_DESCRIPTOR
522 INTERFACE_TYPE InterfaceType
;
524 CM_PARTIAL_RESOURCE_LIST PartialResourceList
;
525 } CM_FULL_RESOURCE_DESCRIPTOR
, *PCM_FULL_RESOURCE_DESCRIPTOR
;
527 typedef struct _CM_RESOURCE_LIST
530 CM_FULL_RESOURCE_DESCRIPTOR List
[1];
531 } CM_RESOURCE_LIST
, *PCM_RESOURCE_LIST
;
534 // ROM Block Structure
536 typedef struct _CM_ROM_BLOCK
540 } CM_ROM_BLOCK
, *PCM_ROM_BLOCK
;
543 // Disk/INT13 Structures
545 typedef struct _CM_INT13_DRIVE_PARAMETER
549 USHORT SectorsPerTrack
;
552 } CM_INT13_DRIVE_PARAMETER
, *PCM_INT13_DRIVE_PARAMETER
;
554 typedef struct _CM_DISK_GEOMETRY_DEVICE_DATA
556 ULONG BytesPerSector
;
557 ULONG NumberOfCylinders
;
558 ULONG SectorsPerTrack
;
560 } CM_DISK_GEOMETRY_DEVICE_DATA
, *PCM_DISK_GEOMETRY_DEVICE_DATA
;
564 #endif // _!NTOS_MODE_USER