[XDK]
[reactos.git] / include / ndk / cmtypes.h
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_RELATED_DEVICE_DATA.Relations
33 //
34 #define PNP_GET_PARENT_DEVICE 1
35 #define PNP_GET_CHILD_DEVICE 2
36 #define PNP_GET_SIBLING_DEVICE 3
37
38 //
39 // PLUGPLAY_CONTROL_STATUS_DATA Operations
40 //
41 #define PNP_GET_DEVICE_STATUS 0
42 #define PNP_SET_DEVICE_STATUS 1
43 #define PNP_CLEAR_DEVICE_STATUS 2
44
45 #ifdef NTOS_MODE_USER
46
47 //
48 // Resource Type
49 //
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
63
64
65 //
66 // Resource Descriptor Share Dispositions
67 //
68 typedef enum _CM_SHARE_DISPOSITION
69 {
70 CmResourceShareUndetermined,
71 CmResourceShareDeviceExclusive,
72 CmResourceShareDriverExclusive,
73 CmResourceShareShared
74 } CM_SHARE_DISPOSITION;
75
76 #endif
77
78 //
79 // Port Resource Descriptor Flags
80 //
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
89
90 //
91 // Memory Resource Descriptor Flags
92 //
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
100
101 //
102 // DMA Resource Descriptor Flags
103 //
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
112
113 //
114 // NtInitializeRegistry Flags
115 //
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
120
121 #ifdef NTOS_MODE_USER
122
123 //
124 // Information Classes for NtQueryKey
125 //
126 typedef enum _KEY_INFORMATION_CLASS
127 {
128 KeyBasicInformation,
129 KeyNodeInformation,
130 KeyFullInformation,
131 KeyNameInformation,
132 KeyCachedInformation,
133 KeyFlagsInformation
134 } KEY_INFORMATION_CLASS;
135
136 typedef enum _KEY_VALUE_INFORMATION_CLASS
137 {
138 KeyValueBasicInformation,
139 KeyValueFullInformation,
140 KeyValuePartialInformation,
141 KeyValueFullInformationAlign64,
142 KeyValuePartialInformationAlign64
143 } KEY_VALUE_INFORMATION_CLASS;
144
145 typedef enum _KEY_SET_INFORMATION_CLASS {
146 KeyWriteTimeInformation,
147 KeyWow64FlagsInformation,
148 KeyControlFlagsInformation,
149 KeySetVirtualizationInformation,
150 KeySetDebugInformation,
151 KeySetHandleTagsInformation,
152 MaxKeySetInfoClass
153 } KEY_SET_INFORMATION_CLASS;
154
155 #endif
156
157 //
158 // Plag and Play Classes
159 //
160 typedef enum _PLUGPLAY_CONTROL_CLASS
161 {
162 PlugPlayControlUserResponse = 0x07,
163 PlugPlayControlProperty = 0x0A,
164 PlugPlayControlGetRelatedDevice = 0x0C,
165 PlugPlayControlDeviceStatus = 0x0E,
166 PlugPlayControlGetDeviceDepth,
167 PlugPlayControlResetDevice = 0x14
168 } PLUGPLAY_CONTROL_CLASS;
169
170 typedef enum _PLUGPLAY_BUS_CLASS
171 {
172 SystemBus,
173 PlugPlayVirtualBus,
174 MaxPlugPlayBusClass
175 } PLUGPLAY_BUS_CLASS, *PPLUGPLAY_BUS_CLASS;
176
177 //
178 // Plag and Play Bus Types
179 //
180 typedef enum _PLUGPLAY_VIRTUAL_BUS_TYPE
181 {
182 Root,
183 MaxPlugPlayVirtualBusType
184 } PLUGPLAY_VIRTUAL_BUS_TYPE, *PPLUGPLAY_VIRTUAL_BUS_TYPE;
185
186 //
187 // Plag and Play Event Categories
188 //
189 typedef enum _PLUGPLAY_EVENT_CATEGORY
190 {
191 HardwareProfileChangeEvent,
192 TargetDeviceChangeEvent,
193 DeviceClassChangeEvent,
194 CustomDeviceEvent,
195 DeviceInstallEvent,
196 DeviceArrivalEvent,
197 PowerEvent,
198 VetoEvent,
199 BlockedDriverEvent,
200 MaxPlugEventCategory
201 } PLUGPLAY_EVENT_CATEGORY;
202
203 #ifdef NTOS_MODE_USER
204
205 //
206 // Information Structures for NtQueryKeyInformation
207 //
208 typedef struct _KEY_WRITE_TIME_INFORMATION
209 {
210 LARGE_INTEGER LastWriteTime;
211 } KEY_WRITE_TIME_INFORMATION, *PKEY_WRITE_TIME_INFORMATION;
212
213 typedef struct _KEY_USER_FLAGS_INFORMATION
214 {
215 ULONG UserFlags;
216 } KEY_USER_FLAGS_INFORMATION, *PKEY_USER_FLAGS_INFORMATION;
217
218 typedef struct _KEY_FULL_INFORMATION
219 {
220 LARGE_INTEGER LastWriteTime;
221 ULONG TitleIndex;
222 ULONG ClassOffset;
223 ULONG ClassLength;
224 ULONG SubKeys;
225 ULONG MaxNameLen;
226 ULONG MaxClassLen;
227 ULONG Values;
228 ULONG MaxValueNameLen;
229 ULONG MaxValueDataLen;
230 WCHAR Class[1];
231 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
232
233 typedef struct _KEY_NAME_INFORMATION
234 {
235 WCHAR Name[1];
236 } KEY_NAME_INFORMATION, *PKEY_NAME_INFORMATION;
237
238
239 typedef struct _KEY_NODE_INFORMATION
240 {
241 LARGE_INTEGER LastWriteTime;
242 ULONG TitleIndex;
243 ULONG ClassOffset;
244 ULONG ClassLength;
245 ULONG NameLength;
246 WCHAR Name[1];
247 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
248
249 typedef struct _KEY_VALUE_ENTRY
250 {
251 PUNICODE_STRING ValueName;
252 ULONG DataLength;
253 ULONG DataOffset;
254 ULONG Type;
255 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
256
257 typedef struct _KEY_VALUE_PARTIAL_INFORMATION
258 {
259 ULONG TitleIndex;
260 ULONG Type;
261 ULONG DataLength;
262 UCHAR Data[1];
263 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
264
265 typedef struct _KEY_VALUE_BASIC_INFORMATION
266 {
267 ULONG TitleIndex;
268 ULONG Type;
269 ULONG NameLength;
270 WCHAR Name[1];
271 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
272
273 typedef struct _KEY_VALUE_FULL_INFORMATION
274 {
275 ULONG TitleIndex;
276 ULONG Type;
277 ULONG DataOffset;
278 ULONG DataLength;
279 ULONG NameLength;
280 WCHAR Name[1];
281 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
282
283 typedef struct _KEY_BASIC_INFORMATION
284 {
285 LARGE_INTEGER LastWriteTime;
286 ULONG TitleIndex;
287 ULONG NameLength;
288 WCHAR Name[1];
289 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
290
291 #endif
292
293 //
294 // Plug and Play Event Block
295 //
296 typedef struct _PLUGPLAY_EVENT_BLOCK
297 {
298 GUID EventGuid;
299 PLUGPLAY_EVENT_CATEGORY EventCategory;
300 PULONG Result;
301 ULONG Flags;
302 ULONG TotalSize;
303 PVOID DeviceObject;
304 union
305 {
306 struct
307 {
308 GUID ClassGuid;
309 WCHAR SymbolicLinkName[ANYSIZE_ARRAY];
310 } DeviceClass;
311 struct
312 {
313 WCHAR DeviceIds[ANYSIZE_ARRAY];
314 } TargetDevice;
315 struct
316 {
317 WCHAR DeviceId[ANYSIZE_ARRAY];
318 } InstallDevice;
319 struct
320 {
321 PVOID NotificationStructure;
322 WCHAR DeviceIds[ANYSIZE_ARRAY];
323 } CustomNotification;
324 struct
325 {
326 PVOID Notification;
327 } ProfileNotification;
328 struct
329 {
330 ULONG NotificationCode;
331 ULONG NotificationData;
332 } PowerNotification;
333 struct
334 {
335 PNP_VETO_TYPE VetoType;
336 WCHAR DeviceIdVetoNameBuffer[ANYSIZE_ARRAY];
337 } VetoNotification;
338 struct
339 {
340 GUID BlockedDriverGuid;
341 } BlockedDriverNotification;
342 };
343 } PLUGPLAY_EVENT_BLOCK, *PPLUGPLAY_EVENT_BLOCK;
344
345 //
346 // Plug and Play Control Classes
347 //
348
349 //Class 0x0A
350 typedef struct _PLUGPLAY_CONTROL_PROPERTY_DATA
351 {
352 UNICODE_STRING DeviceInstance;
353 ULONG Property;
354 PVOID Buffer;
355 ULONG BufferSize;
356 } PLUGPLAY_CONTROL_PROPERTY_DATA, *PPLUGPLAY_CONTROL_PROPERTY_DATA;
357
358 // Class 0x0C
359 typedef struct _PLUGPLAY_CONTROL_RELATED_DEVICE_DATA
360 {
361 UNICODE_STRING TargetDeviceInstance;
362 ULONG Relation;
363 PWCHAR RelatedDeviceInstance;
364 ULONG RelatedDeviceInstanceLength;
365 } PLUGPLAY_CONTROL_RELATED_DEVICE_DATA, *PPLUGPLAY_CONTROL_RELATED_DEVICE_DATA;
366
367 // Class 0x0E
368 typedef struct _PLUGPLAY_CONTOL_STATUS_DATA
369 {
370 UNICODE_STRING DeviceInstance;
371 ULONG Operation;
372 ULONG DeviceStatus;
373 ULONG DeviceProblem;
374 } PLUGPLAY_CONTROL_STATUS_DATA, *PPLUGPLAY_CONTROL_STATUS_DATA;
375
376 // Class 0x0F
377 typedef struct _PLUGPLAY_CONTROL_DEPTH_DATA
378 {
379 UNICODE_STRING DeviceInstance;
380 ULONG Depth;
381 } PLUGPLAY_CONTROL_DEPTH_DATA, *PPLUGPLAY_CONTROL_DEPTH_DATA;
382
383 // Class 0x14
384 typedef struct _PLUGPLAY_CONTROL_RESET_DEVICE_DATA
385 {
386 UNICODE_STRING DeviceInstance;
387 } PLUGPLAY_CONTROL_RESET_DEVICE_DATA, *PPLUGPLAY_CONTROL_RESET_DEVICE_DATA;
388
389 //
390 // Plug and Play Bus Type Definition
391 //
392 typedef struct _PLUGPLAY_BUS_TYPE
393 {
394 PLUGPLAY_BUS_CLASS BusClass;
395 union
396 {
397 INTERFACE_TYPE SystemBusType;
398 PLUGPLAY_VIRTUAL_BUS_TYPE PlugPlayVirtualBusType;
399 };
400 } PLUGPLAY_BUS_TYPE, *PPLUGPLAY_BUS_TYPE;
401
402 //
403 // Plug and Play Bus Instance Definition
404 //
405 typedef struct _PLUGPLAY_BUS_INSTANCE
406 {
407 PLUGPLAY_BUS_TYPE BusType;
408 ULONG BusNumber;
409 WCHAR BusName[MAX_BUS_NAME];
410 } PLUGPLAY_BUS_INSTANCE, *PPLUGPLAY_BUS_INSTANCE;
411
412 #ifdef NTOS_MODE_USER
413
414 //
415 // Partial Resource Descriptor and List for Hardware
416 //
417 #include <pshpack1.h>
418 typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR
419 {
420 UCHAR Type;
421 UCHAR ShareDisposition;
422 USHORT Flags;
423 union
424 {
425 struct
426 {
427 PHYSICAL_ADDRESS Start;
428 ULONG Length;
429 } Generic;
430 struct
431 {
432 PHYSICAL_ADDRESS Start;
433 ULONG Length;
434 } Port;
435 struct
436 {
437 ULONG Level;
438 ULONG Vector;
439 KAFFINITY Affinity;
440 } Interrupt;
441 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
442 struct
443 {
444 union
445 {
446 struct
447 {
448 USHORT Reserved;
449 USHORT MessageCount;
450 ULONG Vector;
451 KAFFINITY Affinity;
452 } Raw;
453 struct
454 {
455 ULONG Level;
456 ULONG Vector;
457 KAFFINITY Affinity;
458 } Translated;
459 };
460 } MessageInterrupt;
461 #endif
462 struct
463 {
464 PHYSICAL_ADDRESS Start;
465 ULONG Length;
466 } Memory;
467 struct
468 {
469 ULONG Channel;
470 ULONG Port;
471 ULONG Reserved1;
472 } Dma;
473 struct
474 {
475 ULONG Data[3];
476 } DevicePrivate;
477 struct
478 {
479 ULONG Start;
480 ULONG Length;
481 ULONG Reserved;
482 } BusNumber;
483 struct
484 {
485 ULONG DataSize;
486 ULONG Reserved1;
487 ULONG Reserved2;
488 } DeviceSpecificData;
489 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
490 struct
491 {
492 PHYSICAL_ADDRESS Start;
493 ULONG Length40;
494 } Memory40;
495 struct
496 {
497 PHYSICAL_ADDRESS Start;
498 ULONG Length48;
499 } Memory48;
500 struct
501 {
502 PHYSICAL_ADDRESS Start;
503 ULONG Length64;
504 } Memory64;
505 #endif
506 } u;
507 } CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR;
508
509 typedef struct _CM_PARTIAL_RESOURCE_LIST
510 {
511 USHORT Version;
512 USHORT Revision;
513 ULONG Count;
514 CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1];
515 } CM_PARTIAL_RESOURCE_LIST, *PCM_PARTIAL_RESOURCE_LIST;
516
517 //
518 // Full Resource Descriptor and List for Hardware
519 //
520 typedef struct _CM_FULL_RESOURCE_DESCRIPTOR
521 {
522 INTERFACE_TYPE InterfaceType;
523 ULONG BusNumber;
524 CM_PARTIAL_RESOURCE_LIST PartialResourceList;
525 } CM_FULL_RESOURCE_DESCRIPTOR, *PCM_FULL_RESOURCE_DESCRIPTOR;
526
527 typedef struct _CM_RESOURCE_LIST
528 {
529 ULONG Count;
530 CM_FULL_RESOURCE_DESCRIPTOR List[1];
531 } CM_RESOURCE_LIST, *PCM_RESOURCE_LIST;
532
533 //
534 // ROM Block Structure
535 //
536 typedef struct _CM_ROM_BLOCK
537 {
538 ULONG Address;
539 ULONG Size;
540 } CM_ROM_BLOCK, *PCM_ROM_BLOCK;
541
542 //
543 // Disk/INT13 Structures
544 //
545 typedef struct _CM_INT13_DRIVE_PARAMETER
546 {
547 USHORT DriveSelect;
548 ULONG MaxCylinders;
549 USHORT SectorsPerTrack;
550 USHORT MaxHeads;
551 USHORT NumberDrives;
552 } CM_INT13_DRIVE_PARAMETER, *PCM_INT13_DRIVE_PARAMETER;
553
554 typedef struct _CM_DISK_GEOMETRY_DEVICE_DATA
555 {
556 ULONG BytesPerSector;
557 ULONG NumberOfCylinders;
558 ULONG SectorsPerTrack;
559 ULONG NumberOfHeads;
560 } CM_DISK_GEOMETRY_DEVICE_DATA, *PCM_DISK_GEOMETRY_DEVICE_DATA;
561
562 #include <poppack.h>
563
564 #endif // _!NTOS_MODE_USER
565
566 #endif // _CMTYPES_H
567
568
569