Create the AHCI branch for Aman's work
[reactos.git] / sdk / include / xdk / cmtypes.h
1 /******************************************************************************
2 * Configuration Manager Types *
3 ******************************************************************************/
4
5 $if (_WDMDDK_)
6 /* Resource list definitions */
7 typedef int CM_RESOURCE_TYPE;
8
9 #define CmResourceTypeNull 0
10 #define CmResourceTypePort 1
11 #define CmResourceTypeInterrupt 2
12 #define CmResourceTypeMemory 3
13 #define CmResourceTypeDma 4
14 #define CmResourceTypeDeviceSpecific 5
15 #define CmResourceTypeBusNumber 6
16 #define CmResourceTypeNonArbitrated 128
17 #define CmResourceTypeConfigData 128
18 #define CmResourceTypeDevicePrivate 129
19 #define CmResourceTypePcCardConfig 130
20 #define CmResourceTypeMfCardConfig 131
21
22 /* KEY_VALUE_Xxx.Type */
23 #define REG_NONE 0
24 #define REG_SZ 1
25 #define REG_EXPAND_SZ 2
26 #define REG_BINARY 3
27 #define REG_DWORD 4
28 #define REG_DWORD_LITTLE_ENDIAN 4
29 #define REG_DWORD_BIG_ENDIAN 5
30 #define REG_LINK 6
31 #define REG_MULTI_SZ 7
32 #define REG_RESOURCE_LIST 8
33 #define REG_FULL_RESOURCE_DESCRIPTOR 9
34 #define REG_RESOURCE_REQUIREMENTS_LIST 10
35 #define REG_QWORD 11
36 #define REG_QWORD_LITTLE_ENDIAN 11
37
38 /* Registry Access Rights */
39 #define KEY_QUERY_VALUE (0x0001)
40 #define KEY_SET_VALUE (0x0002)
41 #define KEY_CREATE_SUB_KEY (0x0004)
42 #define KEY_ENUMERATE_SUB_KEYS (0x0008)
43 #define KEY_NOTIFY (0x0010)
44 #define KEY_CREATE_LINK (0x0020)
45 #define KEY_WOW64_32KEY (0x0200)
46 #define KEY_WOW64_64KEY (0x0100)
47 #define KEY_WOW64_RES (0x0300)
48
49 #define KEY_READ ((STANDARD_RIGHTS_READ |\
50 KEY_QUERY_VALUE |\
51 KEY_ENUMERATE_SUB_KEYS |\
52 KEY_NOTIFY) \
53 & \
54 (~SYNCHRONIZE))
55
56 #define KEY_WRITE ((STANDARD_RIGHTS_WRITE |\
57 KEY_SET_VALUE |\
58 KEY_CREATE_SUB_KEY) \
59 & \
60 (~SYNCHRONIZE))
61
62 #define KEY_EXECUTE ((KEY_READ) \
63 & \
64 (~SYNCHRONIZE))
65
66 #define KEY_ALL_ACCESS ((STANDARD_RIGHTS_ALL |\
67 KEY_QUERY_VALUE |\
68 KEY_SET_VALUE |\
69 KEY_CREATE_SUB_KEY |\
70 KEY_ENUMERATE_SUB_KEYS |\
71 KEY_NOTIFY |\
72 KEY_CREATE_LINK) \
73 & \
74 (~SYNCHRONIZE))
75
76 /* Registry Open/Create Options */
77 #define REG_OPTION_RESERVED (0x00000000L)
78 #define REG_OPTION_NON_VOLATILE (0x00000000L)
79 #define REG_OPTION_VOLATILE (0x00000001L)
80 #define REG_OPTION_CREATE_LINK (0x00000002L)
81 #define REG_OPTION_BACKUP_RESTORE (0x00000004L)
82 #define REG_OPTION_OPEN_LINK (0x00000008L)
83
84 #define REG_LEGAL_OPTION \
85 (REG_OPTION_RESERVED |\
86 REG_OPTION_NON_VOLATILE |\
87 REG_OPTION_VOLATILE |\
88 REG_OPTION_CREATE_LINK |\
89 REG_OPTION_BACKUP_RESTORE |\
90 REG_OPTION_OPEN_LINK)
91
92 #define REG_OPEN_LEGAL_OPTION \
93 (REG_OPTION_RESERVED |\
94 REG_OPTION_BACKUP_RESTORE |\
95 REG_OPTION_OPEN_LINK)
96
97 #define REG_STANDARD_FORMAT 1
98 #define REG_LATEST_FORMAT 2
99 #define REG_NO_COMPRESSION 4
100
101 /* Key creation/open disposition */
102 #define REG_CREATED_NEW_KEY (0x00000001L)
103 #define REG_OPENED_EXISTING_KEY (0x00000002L)
104
105 /* Key restore & hive load flags */
106 #define REG_WHOLE_HIVE_VOLATILE (0x00000001L)
107 #define REG_REFRESH_HIVE (0x00000002L)
108 #define REG_NO_LAZY_FLUSH (0x00000004L)
109 #define REG_FORCE_RESTORE (0x00000008L)
110 #define REG_APP_HIVE (0x00000010L)
111 #define REG_PROCESS_PRIVATE (0x00000020L)
112 #define REG_START_JOURNAL (0x00000040L)
113 #define REG_HIVE_EXACT_FILE_GROWTH (0x00000080L)
114 #define REG_HIVE_NO_RM (0x00000100L)
115 #define REG_HIVE_SINGLE_LOG (0x00000200L)
116 #define REG_BOOT_HIVE (0x00000400L)
117
118 /* Unload Flags */
119 #define REG_FORCE_UNLOAD 1
120
121 /* Notify Filter Values */
122 #define REG_NOTIFY_CHANGE_NAME (0x00000001L)
123 #define REG_NOTIFY_CHANGE_ATTRIBUTES (0x00000002L)
124 #define REG_NOTIFY_CHANGE_LAST_SET (0x00000004L)
125 #define REG_NOTIFY_CHANGE_SECURITY (0x00000008L)
126
127 #define REG_LEGAL_CHANGE_FILTER \
128 (REG_NOTIFY_CHANGE_NAME |\
129 REG_NOTIFY_CHANGE_ATTRIBUTES |\
130 REG_NOTIFY_CHANGE_LAST_SET |\
131 REG_NOTIFY_CHANGE_SECURITY)
132
133 #include <pshpack4.h>
134 typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR {
135 UCHAR Type;
136 UCHAR ShareDisposition;
137 USHORT Flags;
138 union {
139 struct {
140 PHYSICAL_ADDRESS Start;
141 ULONG Length;
142 } Generic;
143 struct {
144 PHYSICAL_ADDRESS Start;
145 ULONG Length;
146 } Port;
147 struct {
148 #if defined(NT_PROCESSOR_GROUPS)
149 USHORT Level;
150 USHORT Group;
151 #else
152 ULONG Level;
153 #endif
154 ULONG Vector;
155 KAFFINITY Affinity;
156 } Interrupt;
157 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
158 struct {
159 _ANONYMOUS_UNION union {
160 struct {
161 #if defined(NT_PROCESSOR_GROUPS)
162 USHORT Group;
163 #else
164 USHORT Reserved;
165 #endif
166 USHORT MessageCount;
167 ULONG Vector;
168 KAFFINITY Affinity;
169 } Raw;
170 struct {
171 #if defined(NT_PROCESSOR_GROUPS)
172 USHORT Level;
173 USHORT Group;
174 #else
175 ULONG Level;
176 #endif
177 ULONG Vector;
178 KAFFINITY Affinity;
179 } Translated;
180 } DUMMYUNIONNAME;
181 } MessageInterrupt;
182 #endif
183 struct {
184 PHYSICAL_ADDRESS Start;
185 ULONG Length;
186 } Memory;
187 struct {
188 ULONG Channel;
189 ULONG Port;
190 ULONG Reserved1;
191 } Dma;
192 struct {
193 ULONG Data[3];
194 } DevicePrivate;
195 struct {
196 ULONG Start;
197 ULONG Length;
198 ULONG Reserved;
199 } BusNumber;
200 struct {
201 ULONG DataSize;
202 ULONG Reserved1;
203 ULONG Reserved2;
204 } DeviceSpecificData;
205 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
206 struct {
207 PHYSICAL_ADDRESS Start;
208 ULONG Length40;
209 } Memory40;
210 struct {
211 PHYSICAL_ADDRESS Start;
212 ULONG Length48;
213 } Memory48;
214 struct {
215 PHYSICAL_ADDRESS Start;
216 ULONG Length64;
217 } Memory64;
218 #endif
219 } u;
220 } CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR;
221 #include <poppack.h>
222
223 /* CM_PARTIAL_RESOURCE_DESCRIPTOR.Type */
224 #define CmResourceTypeNull 0
225 #define CmResourceTypePort 1
226 #define CmResourceTypeInterrupt 2
227 #define CmResourceTypeMemory 3
228 #define CmResourceTypeDma 4
229 #define CmResourceTypeDeviceSpecific 5
230 #define CmResourceTypeBusNumber 6
231 #define CmResourceTypeMemoryLarge 7
232 #define CmResourceTypeNonArbitrated 128
233 #define CmResourceTypeConfigData 128
234 #define CmResourceTypeDevicePrivate 129
235 #define CmResourceTypePcCardConfig 130
236 #define CmResourceTypeMfCardConfig 131
237
238 /* CM_PARTIAL_RESOURCE_DESCRIPTOR.ShareDisposition */
239 typedef enum _CM_SHARE_DISPOSITION {
240 CmResourceShareUndetermined = 0,
241 CmResourceShareDeviceExclusive,
242 CmResourceShareDriverExclusive,
243 CmResourceShareShared
244 } CM_SHARE_DISPOSITION;
245
246 /* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypePort */
247 #define CM_RESOURCE_PORT_MEMORY 0x0000
248 #define CM_RESOURCE_PORT_IO 0x0001
249 #define CM_RESOURCE_PORT_10_BIT_DECODE 0x0004
250 #define CM_RESOURCE_PORT_12_BIT_DECODE 0x0008
251 #define CM_RESOURCE_PORT_16_BIT_DECODE 0x0010
252 #define CM_RESOURCE_PORT_POSITIVE_DECODE 0x0020
253 #define CM_RESOURCE_PORT_PASSIVE_DECODE 0x0040
254 #define CM_RESOURCE_PORT_WINDOW_DECODE 0x0080
255 #define CM_RESOURCE_PORT_BAR 0x0100
256
257 /* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypeInterrupt */
258 #define CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE 0x0000
259 #define CM_RESOURCE_INTERRUPT_LATCHED 0x0001
260 #define CM_RESOURCE_INTERRUPT_MESSAGE 0x0002
261 #define CM_RESOURCE_INTERRUPT_POLICY_INCLUDED 0x0004
262
263 #define CM_RESOURCE_INTERRUPT_LEVEL_LATCHED_BITS 0x0001
264
265 #define CM_RESOURCE_INTERRUPT_MESSAGE_TOKEN ((ULONG)-2)
266
267 /* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypeMemory */
268 #define CM_RESOURCE_MEMORY_READ_WRITE 0x0000
269 #define CM_RESOURCE_MEMORY_READ_ONLY 0x0001
270 #define CM_RESOURCE_MEMORY_WRITE_ONLY 0x0002
271 #define CM_RESOURCE_MEMORY_WRITEABILITY_MASK 0x0003
272 #define CM_RESOURCE_MEMORY_PREFETCHABLE 0x0004
273 #define CM_RESOURCE_MEMORY_COMBINEDWRITE 0x0008
274 #define CM_RESOURCE_MEMORY_24 0x0010
275 #define CM_RESOURCE_MEMORY_CACHEABLE 0x0020
276 #define CM_RESOURCE_MEMORY_WINDOW_DECODE 0x0040
277 #define CM_RESOURCE_MEMORY_BAR 0x0080
278 #define CM_RESOURCE_MEMORY_COMPAT_FOR_INACCESSIBLE_RANGE 0x0100
279
280 #define CM_RESOURCE_MEMORY_LARGE 0x0E00
281 #define CM_RESOURCE_MEMORY_LARGE_40 0x0200
282 #define CM_RESOURCE_MEMORY_LARGE_48 0x0400
283 #define CM_RESOURCE_MEMORY_LARGE_64 0x0800
284
285 #define CM_RESOURCE_MEMORY_LARGE_40_MAXLEN 0x000000FFFFFFFF00
286 #define CM_RESOURCE_MEMORY_LARGE_48_MAXLEN 0x0000FFFFFFFF0000
287 #define CM_RESOURCE_MEMORY_LARGE_64_MAXLEN 0xFFFFFFFF00000000
288
289 /* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags if Type = CmResourceTypeDma */
290 #define CM_RESOURCE_DMA_8 0x0000
291 #define CM_RESOURCE_DMA_16 0x0001
292 #define CM_RESOURCE_DMA_32 0x0002
293 #define CM_RESOURCE_DMA_8_AND_16 0x0004
294 #define CM_RESOURCE_DMA_BUS_MASTER 0x0008
295 #define CM_RESOURCE_DMA_TYPE_A 0x0010
296 #define CM_RESOURCE_DMA_TYPE_B 0x0020
297 #define CM_RESOURCE_DMA_TYPE_F 0x0040
298
299 typedef struct _DEVICE_FLAGS {
300 ULONG Failed:1;
301 ULONG ReadOnly:1;
302 ULONG Removable:1;
303 ULONG ConsoleIn:1;
304 ULONG ConsoleOut:1;
305 ULONG Input:1;
306 ULONG Output:1;
307 } DEVICE_FLAGS, *PDEVICE_FLAGS;
308
309 typedef enum _INTERFACE_TYPE {
310 InterfaceTypeUndefined = -1,
311 Internal,
312 Isa,
313 Eisa,
314 MicroChannel,
315 TurboChannel,
316 PCIBus,
317 VMEBus,
318 NuBus,
319 PCMCIABus,
320 CBus,
321 MPIBus,
322 MPSABus,
323 ProcessorInternal,
324 InternalPowerBus,
325 PNPISABus,
326 PNPBus,
327 Vmcs,
328 MaximumInterfaceType
329 } INTERFACE_TYPE, *PINTERFACE_TYPE;
330
331 typedef struct _CM_COMPONENT_INFORMATION {
332 DEVICE_FLAGS Flags;
333 ULONG Version;
334 ULONG Key;
335 KAFFINITY AffinityMask;
336 } CM_COMPONENT_INFORMATION, *PCM_COMPONENT_INFORMATION;
337
338 typedef struct _CM_ROM_BLOCK {
339 ULONG Address;
340 ULONG Size;
341 } CM_ROM_BLOCK, *PCM_ROM_BLOCK;
342
343 typedef struct _CM_PARTIAL_RESOURCE_LIST {
344 USHORT Version;
345 USHORT Revision;
346 ULONG Count;
347 CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1];
348 } CM_PARTIAL_RESOURCE_LIST, *PCM_PARTIAL_RESOURCE_LIST;
349
350 typedef struct _CM_FULL_RESOURCE_DESCRIPTOR {
351 INTERFACE_TYPE InterfaceType;
352 ULONG BusNumber;
353 CM_PARTIAL_RESOURCE_LIST PartialResourceList;
354 } CM_FULL_RESOURCE_DESCRIPTOR, *PCM_FULL_RESOURCE_DESCRIPTOR;
355
356 typedef struct _CM_RESOURCE_LIST {
357 ULONG Count;
358 CM_FULL_RESOURCE_DESCRIPTOR List[1];
359 } CM_RESOURCE_LIST, *PCM_RESOURCE_LIST;
360
361 typedef struct _PNP_BUS_INFORMATION {
362 GUID BusTypeGuid;
363 INTERFACE_TYPE LegacyBusType;
364 ULONG BusNumber;
365 } PNP_BUS_INFORMATION, *PPNP_BUS_INFORMATION;
366
367 #include <pshpack1.h>
368
369 typedef struct _CM_INT13_DRIVE_PARAMETER {
370 USHORT DriveSelect;
371 ULONG MaxCylinders;
372 USHORT SectorsPerTrack;
373 USHORT MaxHeads;
374 USHORT NumberDrives;
375 } CM_INT13_DRIVE_PARAMETER, *PCM_INT13_DRIVE_PARAMETER;
376
377 typedef struct _CM_MCA_POS_DATA {
378 USHORT AdapterId;
379 UCHAR PosData1;
380 UCHAR PosData2;
381 UCHAR PosData3;
382 UCHAR PosData4;
383 } CM_MCA_POS_DATA, *PCM_MCA_POS_DATA;
384
385 typedef struct _CM_PNP_BIOS_DEVICE_NODE {
386 USHORT Size;
387 UCHAR Node;
388 ULONG ProductId;
389 UCHAR DeviceType[3];
390 USHORT DeviceAttributes;
391 } CM_PNP_BIOS_DEVICE_NODE,*PCM_PNP_BIOS_DEVICE_NODE;
392
393 typedef struct _CM_PNP_BIOS_INSTALLATION_CHECK {
394 UCHAR Signature[4];
395 UCHAR Revision;
396 UCHAR Length;
397 USHORT ControlField;
398 UCHAR Checksum;
399 ULONG EventFlagAddress;
400 USHORT RealModeEntryOffset;
401 USHORT RealModeEntrySegment;
402 USHORT ProtectedModeEntryOffset;
403 ULONG ProtectedModeCodeBaseAddress;
404 ULONG OemDeviceId;
405 USHORT RealModeDataBaseAddress;
406 ULONG ProtectedModeDataBaseAddress;
407 } CM_PNP_BIOS_INSTALLATION_CHECK, *PCM_PNP_BIOS_INSTALLATION_CHECK;
408
409 #include <poppack.h>
410
411 typedef struct _CM_DISK_GEOMETRY_DEVICE_DATA {
412 ULONG BytesPerSector;
413 ULONG NumberOfCylinders;
414 ULONG SectorsPerTrack;
415 ULONG NumberOfHeads;
416 } CM_DISK_GEOMETRY_DEVICE_DATA, *PCM_DISK_GEOMETRY_DEVICE_DATA;
417
418 typedef struct _CM_KEYBOARD_DEVICE_DATA {
419 USHORT Version;
420 USHORT Revision;
421 UCHAR Type;
422 UCHAR Subtype;
423 USHORT KeyboardFlags;
424 } CM_KEYBOARD_DEVICE_DATA, *PCM_KEYBOARD_DEVICE_DATA;
425
426 typedef struct _CM_SCSI_DEVICE_DATA {
427 USHORT Version;
428 USHORT Revision;
429 UCHAR HostIdentifier;
430 } CM_SCSI_DEVICE_DATA, *PCM_SCSI_DEVICE_DATA;
431
432 typedef struct _CM_VIDEO_DEVICE_DATA {
433 USHORT Version;
434 USHORT Revision;
435 ULONG VideoClock;
436 } CM_VIDEO_DEVICE_DATA, *PCM_VIDEO_DEVICE_DATA;
437
438 typedef struct _CM_SONIC_DEVICE_DATA {
439 USHORT Version;
440 USHORT Revision;
441 USHORT DataConfigurationRegister;
442 UCHAR EthernetAddress[8];
443 } CM_SONIC_DEVICE_DATA, *PCM_SONIC_DEVICE_DATA;
444
445 typedef struct _CM_SERIAL_DEVICE_DATA {
446 USHORT Version;
447 USHORT Revision;
448 ULONG BaudClock;
449 } CM_SERIAL_DEVICE_DATA, *PCM_SERIAL_DEVICE_DATA;
450
451 typedef struct _CM_MONITOR_DEVICE_DATA {
452 USHORT Version;
453 USHORT Revision;
454 USHORT HorizontalScreenSize;
455 USHORT VerticalScreenSize;
456 USHORT HorizontalResolution;
457 USHORT VerticalResolution;
458 USHORT HorizontalDisplayTimeLow;
459 USHORT HorizontalDisplayTime;
460 USHORT HorizontalDisplayTimeHigh;
461 USHORT HorizontalBackPorchLow;
462 USHORT HorizontalBackPorch;
463 USHORT HorizontalBackPorchHigh;
464 USHORT HorizontalFrontPorchLow;
465 USHORT HorizontalFrontPorch;
466 USHORT HorizontalFrontPorchHigh;
467 USHORT HorizontalSyncLow;
468 USHORT HorizontalSync;
469 USHORT HorizontalSyncHigh;
470 USHORT VerticalBackPorchLow;
471 USHORT VerticalBackPorch;
472 USHORT VerticalBackPorchHigh;
473 USHORT VerticalFrontPorchLow;
474 USHORT VerticalFrontPorch;
475 USHORT VerticalFrontPorchHigh;
476 USHORT VerticalSyncLow;
477 USHORT VerticalSync;
478 USHORT VerticalSyncHigh;
479 } CM_MONITOR_DEVICE_DATA, *PCM_MONITOR_DEVICE_DATA;
480
481 typedef struct _CM_FLOPPY_DEVICE_DATA {
482 USHORT Version;
483 USHORT Revision;
484 CHAR Size[8];
485 ULONG MaxDensity;
486 ULONG MountDensity;
487 UCHAR StepRateHeadUnloadTime;
488 UCHAR HeadLoadTime;
489 UCHAR MotorOffTime;
490 UCHAR SectorLengthCode;
491 UCHAR SectorPerTrack;
492 UCHAR ReadWriteGapLength;
493 UCHAR DataTransferLength;
494 UCHAR FormatGapLength;
495 UCHAR FormatFillCharacter;
496 UCHAR HeadSettleTime;
497 UCHAR MotorSettleTime;
498 UCHAR MaximumTrackValue;
499 UCHAR DataTransferRate;
500 } CM_FLOPPY_DEVICE_DATA, *PCM_FLOPPY_DEVICE_DATA;
501
502 typedef enum _KEY_INFORMATION_CLASS {
503 KeyBasicInformation,
504 KeyNodeInformation,
505 KeyFullInformation,
506 KeyNameInformation,
507 KeyCachedInformation,
508 KeyFlagsInformation,
509 KeyVirtualizationInformation,
510 KeyHandleTagsInformation,
511 MaxKeyInfoClass
512 } KEY_INFORMATION_CLASS;
513
514 typedef struct _KEY_BASIC_INFORMATION {
515 LARGE_INTEGER LastWriteTime;
516 ULONG TitleIndex;
517 ULONG NameLength;
518 WCHAR Name[1];
519 } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
520
521 typedef struct _KEY_CONTROL_FLAGS_INFORMATION {
522 ULONG ControlFlags;
523 } KEY_CONTROL_FLAGS_INFORMATION, *PKEY_CONTROL_FLAGS_INFORMATION;
524
525 typedef struct _KEY_FULL_INFORMATION {
526 LARGE_INTEGER LastWriteTime;
527 ULONG TitleIndex;
528 ULONG ClassOffset;
529 ULONG ClassLength;
530 ULONG SubKeys;
531 ULONG MaxNameLen;
532 ULONG MaxClassLen;
533 ULONG Values;
534 ULONG MaxValueNameLen;
535 ULONG MaxValueDataLen;
536 WCHAR Class[1];
537 } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
538
539 typedef struct _KEY_HANDLE_TAGS_INFORMATION {
540 ULONG HandleTags;
541 } KEY_HANDLE_TAGS_INFORMATION, *PKEY_HANDLE_TAGS_INFORMATION;
542
543 typedef struct _KEY_NODE_INFORMATION {
544 LARGE_INTEGER LastWriteTime;
545 ULONG TitleIndex;
546 ULONG ClassOffset;
547 ULONG ClassLength;
548 ULONG NameLength;
549 WCHAR Name[1];
550 } KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
551
552 typedef enum _KEY_SET_INFORMATION_CLASS {
553 KeyWriteTimeInformation,
554 KeyWow64FlagsInformation,
555 KeyControlFlagsInformation,
556 KeySetVirtualizationInformation,
557 KeySetDebugInformation,
558 KeySetHandleTagsInformation,
559 MaxKeySetInfoClass
560 } KEY_SET_INFORMATION_CLASS;
561
562 typedef struct _KEY_SET_VIRTUALIZATION_INFORMATION {
563 ULONG VirtualTarget:1;
564 ULONG VirtualStore:1;
565 ULONG VirtualSource:1;
566 ULONG Reserved:29;
567 } KEY_SET_VIRTUALIZATION_INFORMATION, *PKEY_SET_VIRTUALIZATION_INFORMATION;
568
569 typedef struct _KEY_VALUE_BASIC_INFORMATION {
570 ULONG TitleIndex;
571 ULONG Type;
572 ULONG NameLength;
573 WCHAR Name[1];
574 } KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
575
576 typedef struct _KEY_VALUE_FULL_INFORMATION {
577 ULONG TitleIndex;
578 ULONG Type;
579 ULONG DataOffset;
580 ULONG DataLength;
581 ULONG NameLength;
582 WCHAR Name[1];
583 } KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
584
585 typedef struct _KEY_VALUE_PARTIAL_INFORMATION {
586 ULONG TitleIndex;
587 ULONG Type;
588 ULONG DataLength;
589 _Field_size_bytes_(DataLength) UCHAR Data[1];
590 } KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
591
592 typedef struct _KEY_VALUE_PARTIAL_INFORMATION_ALIGN64 {
593 ULONG Type;
594 ULONG DataLength;
595 _Field_size_bytes_(DataLength) UCHAR Data[1];
596 } KEY_VALUE_PARTIAL_INFORMATION_ALIGN64, *PKEY_VALUE_PARTIAL_INFORMATION_ALIGN64;
597
598 typedef struct _KEY_VALUE_ENTRY {
599 PUNICODE_STRING ValueName;
600 ULONG DataLength;
601 ULONG DataOffset;
602 ULONG Type;
603 } KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
604
605 typedef enum _KEY_VALUE_INFORMATION_CLASS {
606 KeyValueBasicInformation,
607 KeyValueFullInformation,
608 KeyValuePartialInformation,
609 KeyValueFullInformationAlign64,
610 KeyValuePartialInformationAlign64
611 } KEY_VALUE_INFORMATION_CLASS;
612
613 typedef struct _KEY_WOW64_FLAGS_INFORMATION {
614 ULONG UserFlags;
615 } KEY_WOW64_FLAGS_INFORMATION, *PKEY_WOW64_FLAGS_INFORMATION;
616
617 typedef struct _KEY_WRITE_TIME_INFORMATION {
618 LARGE_INTEGER LastWriteTime;
619 } KEY_WRITE_TIME_INFORMATION, *PKEY_WRITE_TIME_INFORMATION;
620
621 #if (NTDDI_VERSION < NTDDI_VISTA)
622 typedef struct _KEY_USER_FLAGS_INFORMATION {
623 ULONG UserFlags;
624 } KEY_USER_FLAGS_INFORMATION, *PKEY_USER_FLAGS_INFORMATION;
625 #endif
626
627 typedef enum _REG_NOTIFY_CLASS {
628 RegNtDeleteKey,
629 RegNtPreDeleteKey = RegNtDeleteKey,
630 RegNtSetValueKey,
631 RegNtPreSetValueKey = RegNtSetValueKey,
632 RegNtDeleteValueKey,
633 RegNtPreDeleteValueKey = RegNtDeleteValueKey,
634 RegNtSetInformationKey,
635 RegNtPreSetInformationKey = RegNtSetInformationKey,
636 RegNtRenameKey,
637 RegNtPreRenameKey = RegNtRenameKey,
638 RegNtEnumerateKey,
639 RegNtPreEnumerateKey = RegNtEnumerateKey,
640 RegNtEnumerateValueKey,
641 RegNtPreEnumerateValueKey = RegNtEnumerateValueKey,
642 RegNtQueryKey,
643 RegNtPreQueryKey = RegNtQueryKey,
644 RegNtQueryValueKey,
645 RegNtPreQueryValueKey = RegNtQueryValueKey,
646 RegNtQueryMultipleValueKey,
647 RegNtPreQueryMultipleValueKey = RegNtQueryMultipleValueKey,
648 RegNtPreCreateKey,
649 RegNtPostCreateKey,
650 RegNtPreOpenKey,
651 RegNtPostOpenKey,
652 RegNtKeyHandleClose,
653 RegNtPreKeyHandleClose = RegNtKeyHandleClose,
654 RegNtPostDeleteKey,
655 RegNtPostSetValueKey,
656 RegNtPostDeleteValueKey,
657 RegNtPostSetInformationKey,
658 RegNtPostRenameKey,
659 RegNtPostEnumerateKey,
660 RegNtPostEnumerateValueKey,
661 RegNtPostQueryKey,
662 RegNtPostQueryValueKey,
663 RegNtPostQueryMultipleValueKey,
664 RegNtPostKeyHandleClose,
665 RegNtPreCreateKeyEx,
666 RegNtPostCreateKeyEx,
667 RegNtPreOpenKeyEx,
668 RegNtPostOpenKeyEx,
669 RegNtPreFlushKey,
670 RegNtPostFlushKey,
671 RegNtPreLoadKey,
672 RegNtPostLoadKey,
673 RegNtPreUnLoadKey,
674 RegNtPostUnLoadKey,
675 RegNtPreQueryKeySecurity,
676 RegNtPostQueryKeySecurity,
677 RegNtPreSetKeySecurity,
678 RegNtPostSetKeySecurity,
679 RegNtCallbackObjectContextCleanup,
680 RegNtPreRestoreKey,
681 RegNtPostRestoreKey,
682 RegNtPreSaveKey,
683 RegNtPostSaveKey,
684 RegNtPreReplaceKey,
685 RegNtPostReplaceKey,
686 MaxRegNtNotifyClass
687 } REG_NOTIFY_CLASS, *PREG_NOTIFY_CLASS;
688
689 _IRQL_requires_same_
690 _Function_class_(EX_CALLBACK_FUNCTION)
691 typedef NTSTATUS
692 (NTAPI EX_CALLBACK_FUNCTION)(
693 _In_ PVOID CallbackContext,
694 _In_opt_ PVOID Argument1,
695 _In_opt_ PVOID Argument2);
696 typedef EX_CALLBACK_FUNCTION *PEX_CALLBACK_FUNCTION;
697
698 typedef struct _REG_DELETE_KEY_INFORMATION {
699 PVOID Object;
700 PVOID CallContext;
701 PVOID ObjectContext;
702 PVOID Reserved;
703 } REG_DELETE_KEY_INFORMATION, *PREG_DELETE_KEY_INFORMATION
704 #if (NTDDI_VERSION >= NTDDI_VISTA)
705 , REG_FLUSH_KEY_INFORMATION, *PREG_FLUSH_KEY_INFORMATION
706 #endif
707 ;
708
709 typedef struct _REG_SET_VALUE_KEY_INFORMATION {
710 PVOID Object;
711 PUNICODE_STRING ValueName;
712 ULONG TitleIndex;
713 ULONG Type;
714 PVOID Data;
715 ULONG DataSize;
716 PVOID CallContext;
717 PVOID ObjectContext;
718 PVOID Reserved;
719 } REG_SET_VALUE_KEY_INFORMATION, *PREG_SET_VALUE_KEY_INFORMATION;
720
721 typedef struct _REG_DELETE_VALUE_KEY_INFORMATION {
722 PVOID Object;
723 PUNICODE_STRING ValueName;
724 PVOID CallContext;
725 PVOID ObjectContext;
726 PVOID Reserved;
727 } REG_DELETE_VALUE_KEY_INFORMATION, *PREG_DELETE_VALUE_KEY_INFORMATION;
728
729 typedef struct _REG_SET_INFORMATION_KEY_INFORMATION {
730 PVOID Object;
731 KEY_SET_INFORMATION_CLASS KeySetInformationClass;
732 PVOID KeySetInformation;
733 ULONG KeySetInformationLength;
734 PVOID CallContext;
735 PVOID ObjectContext;
736 PVOID Reserved;
737 } REG_SET_INFORMATION_KEY_INFORMATION, *PREG_SET_INFORMATION_KEY_INFORMATION;
738
739 typedef struct _REG_ENUMERATE_KEY_INFORMATION {
740 PVOID Object;
741 ULONG Index;
742 KEY_INFORMATION_CLASS KeyInformationClass;
743 PVOID KeyInformation;
744 ULONG Length;
745 PULONG ResultLength;
746 PVOID CallContext;
747 PVOID ObjectContext;
748 PVOID Reserved;
749 } REG_ENUMERATE_KEY_INFORMATION, *PREG_ENUMERATE_KEY_INFORMATION;
750
751 typedef struct _REG_ENUMERATE_VALUE_KEY_INFORMATION {
752 PVOID Object;
753 ULONG Index;
754 KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass;
755 PVOID KeyValueInformation;
756 ULONG Length;
757 PULONG ResultLength;
758 PVOID CallContext;
759 PVOID ObjectContext;
760 PVOID Reserved;
761 } REG_ENUMERATE_VALUE_KEY_INFORMATION, *PREG_ENUMERATE_VALUE_KEY_INFORMATION;
762
763 typedef struct _REG_QUERY_KEY_INFORMATION {
764 PVOID Object;
765 KEY_INFORMATION_CLASS KeyInformationClass;
766 PVOID KeyInformation;
767 ULONG Length;
768 PULONG ResultLength;
769 PVOID CallContext;
770 PVOID ObjectContext;
771 PVOID Reserved;
772 } REG_QUERY_KEY_INFORMATION, *PREG_QUERY_KEY_INFORMATION;
773
774 typedef struct _REG_QUERY_VALUE_KEY_INFORMATION {
775 PVOID Object;
776 PUNICODE_STRING ValueName;
777 KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass;
778 PVOID KeyValueInformation;
779 ULONG Length;
780 PULONG ResultLength;
781 PVOID CallContext;
782 PVOID ObjectContext;
783 PVOID Reserved;
784 } REG_QUERY_VALUE_KEY_INFORMATION, *PREG_QUERY_VALUE_KEY_INFORMATION;
785
786 typedef struct _REG_QUERY_MULTIPLE_VALUE_KEY_INFORMATION {
787 PVOID Object;
788 PKEY_VALUE_ENTRY ValueEntries;
789 ULONG EntryCount;
790 PVOID ValueBuffer;
791 PULONG BufferLength;
792 PULONG RequiredBufferLength;
793 PVOID CallContext;
794 PVOID ObjectContext;
795 PVOID Reserved;
796 } REG_QUERY_MULTIPLE_VALUE_KEY_INFORMATION, *PREG_QUERY_MULTIPLE_VALUE_KEY_INFORMATION;
797
798 typedef struct _REG_RENAME_KEY_INFORMATION {
799 PVOID Object;
800 PUNICODE_STRING NewName;
801 PVOID CallContext;
802 PVOID ObjectContext;
803 PVOID Reserved;
804 } REG_RENAME_KEY_INFORMATION, *PREG_RENAME_KEY_INFORMATION;
805
806 typedef struct _REG_CREATE_KEY_INFORMATION {
807 PUNICODE_STRING CompleteName;
808 PVOID RootObject;
809 PVOID ObjectType;
810 ULONG CreateOptions;
811 PUNICODE_STRING Class;
812 PVOID SecurityDescriptor;
813 PVOID SecurityQualityOfService;
814 ACCESS_MASK DesiredAccess;
815 ACCESS_MASK GrantedAccess;
816 PULONG Disposition;
817 PVOID *ResultObject;
818 PVOID CallContext;
819 PVOID RootObjectContext;
820 PVOID Transaction;
821 PVOID Reserved;
822 } REG_CREATE_KEY_INFORMATION, REG_OPEN_KEY_INFORMATION,*PREG_CREATE_KEY_INFORMATION, *PREG_OPEN_KEY_INFORMATION;
823
824 typedef struct _REG_CREATE_KEY_INFORMATION_V1 {
825 PUNICODE_STRING CompleteName;
826 PVOID RootObject;
827 PVOID ObjectType;
828 ULONG Options;
829 PUNICODE_STRING Class;
830 PVOID SecurityDescriptor;
831 PVOID SecurityQualityOfService;
832 ACCESS_MASK DesiredAccess;
833 ACCESS_MASK GrantedAccess;
834 PULONG Disposition;
835 PVOID *ResultObject;
836 PVOID CallContext;
837 PVOID RootObjectContext;
838 PVOID Transaction;
839 ULONG_PTR Version;
840 PUNICODE_STRING RemainingName;
841 ULONG Wow64Flags;
842 ULONG Attributes;
843 KPROCESSOR_MODE CheckAccessMode;
844 } REG_CREATE_KEY_INFORMATION_V1, REG_OPEN_KEY_INFORMATION_V1,*PREG_CREATE_KEY_INFORMATION_V1, *PREG_OPEN_KEY_INFORMATION_V1;
845
846 typedef struct _REG_PRE_CREATE_KEY_INFORMATION {
847 PUNICODE_STRING CompleteName;
848 } REG_PRE_CREATE_KEY_INFORMATION, REG_PRE_OPEN_KEY_INFORMATION,*PREG_PRE_CREATE_KEY_INFORMATION, *PREG_PRE_OPEN_KEY_INFORMATION;
849
850 typedef struct _REG_POST_CREATE_KEY_INFORMATION {
851 PUNICODE_STRING CompleteName;
852 PVOID Object;
853 NTSTATUS Status;
854 } REG_POST_CREATE_KEY_INFORMATION,REG_POST_OPEN_KEY_INFORMATION, *PREG_POST_CREATE_KEY_INFORMATION, *PREG_POST_OPEN_KEY_INFORMATION;
855
856 typedef struct _REG_POST_OPERATION_INFORMATION {
857 PVOID Object;
858 NTSTATUS Status;
859 PVOID PreInformation;
860 NTSTATUS ReturnStatus;
861 PVOID CallContext;
862 PVOID ObjectContext;
863 PVOID Reserved;
864 } REG_POST_OPERATION_INFORMATION,*PREG_POST_OPERATION_INFORMATION;
865
866 typedef struct _REG_KEY_HANDLE_CLOSE_INFORMATION {
867 PVOID Object;
868 PVOID CallContext;
869 PVOID ObjectContext;
870 PVOID Reserved;
871 } REG_KEY_HANDLE_CLOSE_INFORMATION, *PREG_KEY_HANDLE_CLOSE_INFORMATION;
872
873 #if (NTDDI_VERSION >= NTDDI_VISTA)
874
875 typedef struct _REG_LOAD_KEY_INFORMATION {
876 PVOID Object;
877 PUNICODE_STRING KeyName;
878 PUNICODE_STRING SourceFile;
879 ULONG Flags;
880 PVOID TrustClassObject;
881 PVOID UserEvent;
882 ACCESS_MASK DesiredAccess;
883 PHANDLE RootHandle;
884 PVOID CallContext;
885 PVOID ObjectContext;
886 PVOID Reserved;
887 } REG_LOAD_KEY_INFORMATION, *PREG_LOAD_KEY_INFORMATION;
888
889 typedef struct _REG_UNLOAD_KEY_INFORMATION {
890 PVOID Object;
891 PVOID UserEvent;
892 PVOID CallContext;
893 PVOID ObjectContext;
894 PVOID Reserved;
895 } REG_UNLOAD_KEY_INFORMATION, *PREG_UNLOAD_KEY_INFORMATION;
896
897 typedef struct _REG_CALLBACK_CONTEXT_CLEANUP_INFORMATION {
898 PVOID Object;
899 PVOID ObjectContext;
900 PVOID Reserved;
901 } REG_CALLBACK_CONTEXT_CLEANUP_INFORMATION, *PREG_CALLBACK_CONTEXT_CLEANUP_INFORMATION;
902
903 typedef struct _REG_QUERY_KEY_SECURITY_INFORMATION {
904 PVOID Object;
905 PSECURITY_INFORMATION SecurityInformation;
906 PSECURITY_DESCRIPTOR SecurityDescriptor;
907 PULONG Length;
908 PVOID CallContext;
909 PVOID ObjectContext;
910 PVOID Reserved;
911 } REG_QUERY_KEY_SECURITY_INFORMATION, *PREG_QUERY_KEY_SECURITY_INFORMATION;
912
913 typedef struct _REG_SET_KEY_SECURITY_INFORMATION {
914 PVOID Object;
915 PSECURITY_INFORMATION SecurityInformation;
916 PSECURITY_DESCRIPTOR SecurityDescriptor;
917 PVOID CallContext;
918 PVOID ObjectContext;
919 PVOID Reserved;
920 } REG_SET_KEY_SECURITY_INFORMATION, *PREG_SET_KEY_SECURITY_INFORMATION;
921
922 typedef struct _REG_RESTORE_KEY_INFORMATION {
923 PVOID Object;
924 HANDLE FileHandle;
925 ULONG Flags;
926 PVOID CallContext;
927 PVOID ObjectContext;
928 PVOID Reserved;
929 } REG_RESTORE_KEY_INFORMATION, *PREG_RESTORE_KEY_INFORMATION;
930
931 typedef struct _REG_SAVE_KEY_INFORMATION {
932 PVOID Object;
933 HANDLE FileHandle;
934 ULONG Format;
935 PVOID CallContext;
936 PVOID ObjectContext;
937 PVOID Reserved;
938 } REG_SAVE_KEY_INFORMATION, *PREG_SAVE_KEY_INFORMATION;
939
940 typedef struct _REG_REPLACE_KEY_INFORMATION {
941 PVOID Object;
942 PUNICODE_STRING OldFileName;
943 PUNICODE_STRING NewFileName;
944 PVOID CallContext;
945 PVOID ObjectContext;
946 PVOID Reserved;
947 } REG_REPLACE_KEY_INFORMATION, *PREG_REPLACE_KEY_INFORMATION;
948
949 #endif /* NTDDI_VERSION >= NTDDI_VISTA */
950
951 #define SERVICE_KERNEL_DRIVER 0x00000001
952 #define SERVICE_FILE_SYSTEM_DRIVER 0x00000002
953 #define SERVICE_ADAPTER 0x00000004
954 #define SERVICE_RECOGNIZER_DRIVER 0x00000008
955
956 #define SERVICE_DRIVER (SERVICE_KERNEL_DRIVER | \
957 SERVICE_FILE_SYSTEM_DRIVER | \
958 SERVICE_RECOGNIZER_DRIVER)
959
960 #define SERVICE_WIN32_OWN_PROCESS 0x00000010
961 #define SERVICE_WIN32_SHARE_PROCESS 0x00000020
962 #define SERVICE_WIN32 (SERVICE_WIN32_OWN_PROCESS | \
963 SERVICE_WIN32_SHARE_PROCESS)
964
965 #define SERVICE_INTERACTIVE_PROCESS 0x00000100
966
967 #define SERVICE_TYPE_ALL (SERVICE_WIN32 | \
968 SERVICE_ADAPTER | \
969 SERVICE_DRIVER | \
970 SERVICE_INTERACTIVE_PROCESS)
971
972 /* Service Start Types */
973 #define SERVICE_BOOT_START 0x00000000
974 #define SERVICE_SYSTEM_START 0x00000001
975 #define SERVICE_AUTO_START 0x00000002
976 #define SERVICE_DEMAND_START 0x00000003
977 #define SERVICE_DISABLED 0x00000004
978
979 #define SERVICE_ERROR_IGNORE 0x00000000
980 #define SERVICE_ERROR_NORMAL 0x00000001
981 #define SERVICE_ERROR_SEVERE 0x00000002
982 #define SERVICE_ERROR_CRITICAL 0x00000003
983
984 typedef enum _CM_SERVICE_NODE_TYPE {
985 DriverType = SERVICE_KERNEL_DRIVER,
986 FileSystemType = SERVICE_FILE_SYSTEM_DRIVER,
987 Win32ServiceOwnProcess = SERVICE_WIN32_OWN_PROCESS,
988 Win32ServiceShareProcess = SERVICE_WIN32_SHARE_PROCESS,
989 AdapterType = SERVICE_ADAPTER,
990 RecognizerType = SERVICE_RECOGNIZER_DRIVER
991 } SERVICE_NODE_TYPE;
992
993 typedef enum _CM_SERVICE_LOAD_TYPE {
994 BootLoad = SERVICE_BOOT_START,
995 SystemLoad = SERVICE_SYSTEM_START,
996 AutoLoad = SERVICE_AUTO_START,
997 DemandLoad = SERVICE_DEMAND_START,
998 DisableLoad = SERVICE_DISABLED
999 } SERVICE_LOAD_TYPE;
1000
1001 typedef enum _CM_ERROR_CONTROL_TYPE {
1002 IgnoreError = SERVICE_ERROR_IGNORE,
1003 NormalError = SERVICE_ERROR_NORMAL,
1004 SevereError = SERVICE_ERROR_SEVERE,
1005 CriticalError = SERVICE_ERROR_CRITICAL
1006 } SERVICE_ERROR_TYPE;
1007
1008 #define CM_SERVICE_NETWORK_BOOT_LOAD 0x00000001
1009 #define CM_SERVICE_VIRTUAL_DISK_BOOT_LOAD 0x00000002
1010 #define CM_SERVICE_USB_DISK_BOOT_LOAD 0x00000004
1011
1012 #define CM_SERVICE_VALID_PROMOTION_MASK (CM_SERVICE_NETWORK_BOOT_LOAD | \
1013 CM_SERVICE_VIRTUAL_DISK_BOOT_LOAD | \
1014 CM_SERVICE_USB_DISK_BOOT_LOAD)
1015
1016 $endif (_WDMDDK_)
1017 $if (_NTDDK_)
1018 typedef struct _KEY_NAME_INFORMATION {
1019 ULONG NameLength;
1020 WCHAR Name[1];
1021 } KEY_NAME_INFORMATION, *PKEY_NAME_INFORMATION;
1022
1023 typedef struct _KEY_CACHED_INFORMATION {
1024 LARGE_INTEGER LastWriteTime;
1025 ULONG TitleIndex;
1026 ULONG SubKeys;
1027 ULONG MaxNameLen;
1028 ULONG Values;
1029 ULONG MaxValueNameLen;
1030 ULONG MaxValueDataLen;
1031 ULONG NameLength;
1032 } KEY_CACHED_INFORMATION, *PKEY_CACHED_INFORMATION;
1033
1034 typedef struct _KEY_VIRTUALIZATION_INFORMATION {
1035 ULONG VirtualizationCandidate:1;
1036 ULONG VirtualizationEnabled:1;
1037 ULONG VirtualTarget:1;
1038 ULONG VirtualStore:1;
1039 ULONG VirtualSource:1;
1040 ULONG Reserved:27;
1041 } KEY_VIRTUALIZATION_INFORMATION, *PKEY_VIRTUALIZATION_INFORMATION;
1042
1043 #define CmResourceTypeMaximum 8
1044
1045 typedef struct _CM_PCCARD_DEVICE_DATA {
1046 UCHAR Flags;
1047 UCHAR ErrorCode;
1048 USHORT Reserved;
1049 ULONG BusData;
1050 ULONG DeviceId;
1051 ULONG LegacyBaseAddress;
1052 UCHAR IRQMap[16];
1053 } CM_PCCARD_DEVICE_DATA, *PCM_PCCARD_DEVICE_DATA;
1054
1055 $endif (_NTDDK_)