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 CmResourceTypeMaximum 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
113 #ifdef NTOS_MODE_USER
116 // Information Classes for NtQueryKey
118 typedef enum _KEY_INFORMATION_CLASS
124 KeyCachedInformation
,
126 } KEY_INFORMATION_CLASS
;
128 typedef enum _KEY_VALUE_INFORMATION_CLASS
130 KeyValueBasicInformation
,
131 KeyValueFullInformation
,
132 KeyValuePartialInformation
,
133 KeyValueFullInformationAlign64
,
134 KeyValuePartialInformationAlign64
135 } KEY_VALUE_INFORMATION_CLASS
;
137 typedef enum _KEY_SET_INFORMATION_CLASS
139 KeyWriteTimeInformation
,
140 KeyUserFlagsInformation
,
142 } KEY_SET_INFORMATION_CLASS
;
147 // Plag and Play Classes
149 typedef enum _PLUGPLAY_CONTROL_CLASS
151 PlugPlayControlUserResponse
= 0x07,
152 PlugPlayControlProperty
= 0x0A,
153 PlugPlayControlGetRelatedDevice
= 0x0C,
154 PlugPlayControlDeviceStatus
= 0x0E,
155 PlugPlayControlGetDeviceDepth
,
156 PlugPlayControlResetDevice
= 0x14
157 } PLUGPLAY_CONTROL_CLASS
;
159 typedef enum _PLUGPLAY_BUS_CLASS
164 } PLUGPLAY_BUS_CLASS
, *PPLUGPLAY_BUS_CLASS
;
167 // Plag and Play Bus Types
169 typedef enum _PLUGPLAY_VIRTUAL_BUS_TYPE
172 MaxPlugPlayVirtualBusType
173 } PLUGPLAY_VIRTUAL_BUS_TYPE
, *PPLUGPLAY_VIRTUAL_BUS_TYPE
;
176 // Plag and Play Event Categories
178 typedef enum _PLUGPLAY_EVENT_CATEGORY
180 HardwareProfileChangeEvent
,
181 TargetDeviceChangeEvent
,
182 DeviceClassChangeEvent
,
190 } PLUGPLAY_EVENT_CATEGORY
;
192 #ifdef NTOS_MODE_USER
195 // Information Structures for NtQueryKeyInformation
197 typedef struct _KEY_WRITE_TIME_INFORMATION
199 LARGE_INTEGER LastWriteTime
;
200 } KEY_WRITE_TIME_INFORMATION
, *PKEY_WRITE_TIME_INFORMATION
;
202 typedef struct _KEY_USER_FLAGS_INFORMATION
205 } KEY_USER_FLAGS_INFORMATION
, *PKEY_USER_FLAGS_INFORMATION
;
207 typedef struct _KEY_FULL_INFORMATION
209 LARGE_INTEGER LastWriteTime
;
217 ULONG MaxValueNameLen
;
218 ULONG MaxValueDataLen
;
220 } KEY_FULL_INFORMATION
, *PKEY_FULL_INFORMATION
;
222 typedef struct _KEY_NODE_INFORMATION
224 LARGE_INTEGER LastWriteTime
;
230 } KEY_NODE_INFORMATION
, *PKEY_NODE_INFORMATION
;
232 typedef struct _KEY_VALUE_ENTRY
234 PUNICODE_STRING ValueName
;
238 } KEY_VALUE_ENTRY
, *PKEY_VALUE_ENTRY
;
240 typedef struct _KEY_VALUE_PARTIAL_INFORMATION
246 } KEY_VALUE_PARTIAL_INFORMATION
, *PKEY_VALUE_PARTIAL_INFORMATION
;
248 typedef struct _KEY_VALUE_BASIC_INFORMATION
254 } KEY_VALUE_BASIC_INFORMATION
, *PKEY_VALUE_BASIC_INFORMATION
;
256 typedef struct _KEY_VALUE_FULL_INFORMATION
264 } KEY_VALUE_FULL_INFORMATION
, *PKEY_VALUE_FULL_INFORMATION
;
266 typedef struct _KEY_BASIC_INFORMATION
268 LARGE_INTEGER LastWriteTime
;
272 } KEY_BASIC_INFORMATION
, *PKEY_BASIC_INFORMATION
;
277 // Plug and Play Event Block
279 typedef struct _PLUGPLAY_EVENT_BLOCK
282 PLUGPLAY_EVENT_CATEGORY EventCategory
;
292 WCHAR SymbolicLinkName
[ANYSIZE_ARRAY
];
296 WCHAR DeviceIds
[ANYSIZE_ARRAY
];
300 WCHAR DeviceId
[ANYSIZE_ARRAY
];
304 PVOID NotificationStructure
;
305 WCHAR DeviceIds
[ANYSIZE_ARRAY
];
306 } CustomNotification
;
310 } ProfileNotification
;
313 ULONG NotificationCode
;
314 ULONG NotificationData
;
318 PNP_VETO_TYPE VetoType
;
319 WCHAR DeviceIdVetoNameBuffer
[ANYSIZE_ARRAY
];
323 GUID BlockedDriverGuid
;
324 } BlockedDriverNotification
;
326 } PLUGPLAY_EVENT_BLOCK
, *PPLUGPLAY_EVENT_BLOCK
;
329 // Plug and Play Control Classes
333 typedef struct _PLUGPLAY_CONTROL_PROPERTY_DATA
335 UNICODE_STRING DeviceInstance
;
339 } PLUGPLAY_CONTROL_PROPERTY_DATA
, *PPLUGPLAY_CONTROL_PROPERTY_DATA
;
342 typedef struct _PLUGPLAY_CONTROL_RELATED_DEVICE_DATA
344 UNICODE_STRING TargetDeviceInstance
;
346 PWCHAR RelatedDeviceInstance
;
347 ULONG RelatedDeviceInstanceLength
;
348 } PLUGPLAY_CONTROL_RELATED_DEVICE_DATA
, *PPLUGPLAY_CONTROL_RELATED_DEVICE_DATA
;
351 typedef struct _PLUGPLAY_CONTOL_STATUS_DATA
353 UNICODE_STRING DeviceInstance
;
357 } PLUGPLAY_CONTROL_STATUS_DATA
, *PPLUGPLAY_CONTROL_STATUS_DATA
;
360 typedef struct _PLUGPLAY_CONTROL_DEPTH_DATA
362 UNICODE_STRING DeviceInstance
;
364 } PLUGPLAY_CONTROL_DEPTH_DATA
, *PPLUGPLAY_CONTROL_DEPTH_DATA
;
367 typedef struct _PLUGPLAY_CONTROL_RESET_DEVICE_DATA
369 UNICODE_STRING DeviceInstance
;
370 } PLUGPLAY_CONTROL_RESET_DEVICE_DATA
, *PPLUGPLAY_CONTROL_RESET_DEVICE_DATA
;
373 // Plug and Play Bus Type Definition
375 typedef struct _PLUGPLAY_BUS_TYPE
377 PLUGPLAY_BUS_CLASS BusClass
;
380 INTERFACE_TYPE SystemBusType
;
381 PLUGPLAY_VIRTUAL_BUS_TYPE PlugPlayVirtualBusType
;
383 } PLUGPLAY_BUS_TYPE
, *PPLUGPLAY_BUS_TYPE
;
386 // Plug and Play Bus Instance Definition
388 typedef struct _PLUGPLAY_BUS_INSTANCE
390 PLUGPLAY_BUS_TYPE BusType
;
392 WCHAR BusName
[MAX_BUS_NAME
];
393 } PLUGPLAY_BUS_INSTANCE
, *PPLUGPLAY_BUS_INSTANCE
;
395 #ifdef NTOS_MODE_USER
398 // Partial Resource Descriptor and List for Hardware
400 #include <pshpack1.h>
401 typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR
404 UCHAR ShareDisposition
;
410 PHYSICAL_ADDRESS Start
;
415 PHYSICAL_ADDRESS Start
;
426 PHYSICAL_ADDRESS Start
;
450 } DeviceSpecificData
;
452 } CM_PARTIAL_RESOURCE_DESCRIPTOR
, *PCM_PARTIAL_RESOURCE_DESCRIPTOR
;
454 typedef struct _CM_PARTIAL_RESOURCE_LIST
459 CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors
[1];
460 } CM_PARTIAL_RESOURCE_LIST
, *PCM_PARTIAL_RESOURCE_LIST
;
463 // Full Resource Descriptor and List for Hardware
465 typedef struct _CM_FULL_RESOURCE_DESCRIPTOR
467 INTERFACE_TYPE InterfaceType
;
469 CM_PARTIAL_RESOURCE_LIST PartialResourceList
;
470 } CM_FULL_RESOURCE_DESCRIPTOR
, *PCM_FULL_RESOURCE_DESCRIPTOR
;
472 typedef struct _CM_RESOURCE_LIST
475 CM_FULL_RESOURCE_DESCRIPTOR List
[1];
476 } CM_RESOURCE_LIST
, *PCM_RESOURCE_LIST
;
479 // ROM Block Structure
481 typedef struct _CM_ROM_BLOCK
485 } CM_ROM_BLOCK
, *PCM_ROM_BLOCK
;
488 // Disk/INT13 Structures
490 typedef struct _CM_INT13_DRIVE_PARAMETER
494 USHORT SectorsPerTrack
;
497 } CM_INT13_DRIVE_PARAMETER
, *PCM_INT13_DRIVE_PARAMETER
;
499 typedef struct _CM_DISK_GEOMETRY_DEVICE_DATA
501 ULONG BytesPerSector
;
502 ULONG NumberOfCylinders
;
503 ULONG SectorsPerTrack
;
505 } CM_DISK_GEOMETRY_DEVICE_DATA
, *PCM_DISK_GEOMETRY_DEVICE_DATA
;
509 #endif // _!NTOS_MODE_USER