:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git] / include / ddk / pnptypes.h
1 #ifndef __INCLUDE_DDK_PNPTYPES_H
2 #define __INCLUDE_DDK_PNPTYPES_H
3
4 struct _DEVICE_OBJECT;
5 struct _FILE_OBJECT;
6
7 // windows.h may be included before
8 #ifndef _GUID_DEFINED
9 #define _GUID_DEFINED
10
11 typedef struct _GUID {
12   ULONG Data1;
13   USHORT Data2;
14   USHORT Data3;
15   UCHAR Data4[8];
16 } GUID, *LPGUID;
17
18 #endif
19
20 typedef struct _PNP_BUS_INFORMATION {
21   GUID BusTypeGuid;
22   INTERFACE_TYPE LegacyBusType;
23   ULONG BusNumber;
24 } PNP_BUS_INFORMATION, *PPNP_BUS_INFORMATION;
25
26 typedef struct _DEVICE_CAPABILITIES {
27   USHORT Size;
28   USHORT Version;
29   ULONG DeviceD1:1;
30   ULONG DeviceD2:1;
31   ULONG LockSupported:1;
32   ULONG EjectSupported:1;
33   ULONG Removable:1;
34   ULONG DockDevice:1;
35   ULONG UniqueID:1;
36   ULONG SilentInstall:1;
37   ULONG RawDeviceOK:1;
38   ULONG SurpriseRemovalOK:1;
39   ULONG WakeFromD0:1;
40   ULONG WakeFromD1:1;
41   ULONG WakeFromD2:1;
42   ULONG WakeFromD3:1;
43   ULONG HardwareDisabled:1;
44   ULONG NonDynamic:1;
45   ULONG WarmEjectSupported:1;
46   ULONG Reserved:15;
47   ULONG Address;
48   ULONG UINumber;
49   DEVICE_POWER_STATE DeviceState[PowerSystemMaximum];
50   SYSTEM_POWER_STATE SystemWake;
51   DEVICE_POWER_STATE DeviceWake;
52   ULONG D1Latency;
53   ULONG D2Latency;
54   ULONG D3Latency;
55 } DEVICE_CAPABILITIES, *PDEVICE_CAPABILITIES;
56
57 typedef struct _DEVICE_INTERFACE_CHANGE_NOTIFICATION {
58   USHORT Version;
59   USHORT Size;
60   GUID Event;
61   //
62   // Event-specific data
63   //
64   GUID InterfaceClassGuid;
65   PUNICODE_STRING SymbolicLinkName;
66 } DEVICE_INTERFACE_CHANGE_NOTIFICATION, *PDEVICE_INTERFACE_CHANGE_NOTIFICATION;
67
68 typedef struct _HWPROFILE_CHANGE_NOTIFICATION {
69   USHORT Version;
70   USHORT Size;
71   GUID Event;
72   //
73   // (No event-specific data)
74   //
75 } HWPROFILE_CHANGE_NOTIFICATION, *PHWPROFILE_CHANGE_NOTIFICATION;
76
77 typedef struct _PLUGPLAY_NOTIFICATION_HEADER {
78   USHORT Version; 
79   USHORT Size; 
80   GUID Event;
81 } PLUGPLAY_NOTIFICATION_HEADER, *PPLUGPLAY_NOTIFICATION_HEADER;
82
83 typedef ULONG PNP_DEVICE_STATE, *PPNP_DEVICE_STATE;
84
85 #define PNP_DEVICE_DISABLED                      0x00000001
86 #define PNP_DEVICE_DONT_DISPLAY_IN_UI            0x00000002
87 #define PNP_DEVICE_FAILED                        0x00000004
88 #define PNP_DEVICE_REMOVED                       0x00000008
89 #define PNP_DEVICE_RESOURCE_REQUIREMENTS_CHANGED 0x00000010
90 #define PNP_DEVICE_NOT_DISABLEABLE               0x00000020
91
92 typedef struct _TARGET_DEVICE_CUSTOM_NOTIFICATION {
93   USHORT Version;
94   USHORT Size;
95   GUID Event;
96   //
97   // Event-specific data
98   //
99   struct _FILE_OBJECT *FileObject;
100   LONG NameBufferOffset;
101   UCHAR CustomDataBuffer[1];
102 } TARGET_DEVICE_CUSTOM_NOTIFICATION, *PTARGET_DEVICE_CUSTOM_NOTIFICATION;
103
104 typedef struct _TARGET_DEVICE_REMOVAL_NOTIFICATION {
105   USHORT Version;
106   USHORT Size;
107   GUID Event;
108   //
109   // Event-specific data
110   //
111   struct _FILE_OBJECT *FileObject;
112 } TARGET_DEVICE_REMOVAL_NOTIFICATION, *PTARGET_DEVICE_REMOVAL_NOTIFICATION;
113
114
115 // PnP Device Property for IoGetDeviceProperty
116 typedef enum {
117   DevicePropertyDeviceDescription,
118   DevicePropertyHardwareID,
119   DevicePropertyCompatibleIDs,
120   DevicePropertyBootConfiguration,
121   DevicePropertyBootConfigurationTranslated,
122   DevicePropertyClassName,
123   DevicePropertyClassGuid,
124   DevicePropertyDriverKeyName,
125   DevicePropertyManufacturer,
126   DevicePropertyFriendlyName,
127   DevicePropertyLocationInformation,
128   DevicePropertyPhysicalDeviceObjectName,
129   DevicePropertyBusTypeGuid,
130   DevicePropertyLegacyBusType,
131   DevicePropertyBusNumber,
132   DevicePropertyEnumeratorName,
133   DevicePropertyAddress,
134   DevicePropertyUINumber
135 } DEVICE_REGISTRY_PROPERTY;
136
137 // DevInstKeyType values for IoOpenDeviceRegistryKey
138 #define PLUGPLAY_REGKEY_DEVICE              1
139 #define PLUGPLAY_REGKEY_DRIVER              2
140 #define PLUGPLAY_REGKEY_CURRENT_HWPROFILE   4
141
142 // EventCategory for IoRegisterPlugPlayNotification
143 typedef enum _IO_NOTIFICATION_EVENT_CATEGORY {
144   EventCategoryReserved,
145   EventCategoryHardwareProfileChange,
146   EventCategoryDeviceInterfaceChange,
147   EventCategoryTargetDeviceChange
148 } IO_NOTIFICATION_EVENT_CATEGORY;
149
150 // CallbackRoutine for IoRegisterPlugPlayNotification
151 typedef NTSTATUS STDCALL
152 (*PDRIVER_NOTIFICATION_CALLBACK_ROUTINE)(
153   IN PVOID NotificationStructure,
154   IN PVOID Context);
155
156 // Callback for IoReportTargetDeviceChangeAsynchronous
157 typedef VOID STDCALL
158 (*PDEVICE_CHANGE_COMPLETE_CALLBACK)(
159   IN PVOID Context);
160
161 // PNP/POWER values for IRP_MJ_PNP/IRP_MJ_POWER
162 typedef enum _DEVICE_RELATION_TYPE {
163   BusRelations,
164   EjectionRelations,
165   PowerRelations,
166   RemovalRelations,
167   TargetDeviceRelation
168 } DEVICE_RELATION_TYPE, *PDEVICE_RELATION_TYPE;
169
170 typedef struct _DEVICE_RELATIONS {
171   ULONG Count;
172   struct _DEVICE_OBJECT *Objects[1];
173 } DEVICE_RELATIONS, *PDEVICE_RELATIONS;
174
175 typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE {
176   DeviceUsageTypeUndefined,
177   DeviceUsageTypePaging,
178   DeviceUsageTypeHibernation,
179   DeviceUsageTypeDumpFile
180 } DEVICE_USAGE_NOTIFICATION_TYPE;
181
182
183 typedef struct _IO_REMOVE_LOCK_COMMON_BLOCK {
184   BOOLEAN Removed;
185   BOOLEAN Reserved[3];
186   LONG IoCount;
187   KEVENT RemoveEvent;
188 } IO_REMOVE_LOCK_COMMON_BLOCK;
189
190 typedef struct _IO_REMOVE_LOCK {
191   IO_REMOVE_LOCK_COMMON_BLOCK Common;
192 } IO_REMOVE_LOCK, *PIO_REMOVE_LOCK;
193
194 #endif /* __INCLUDE_DDK_PNPTYPES_H */