xref: /reactos/sdk/include/psdk/wmistr.h (revision c2c66aff)
1 #ifndef _WMISTR_
2 #define _WMISTR_
3 
4 typedef struct _WNODE_HEADER
5 {
6     ULONG BufferSize;
7     ULONG ProviderId;
8     union
9     {
10         ULONG64 HistoricalContext;
11         struct
12         {
13             ULONG Version;
14             ULONG Linkage;
15         };
16     };
17     union
18     {
19         ULONG CountLost;
20         HANDLE KernelHandle;
21         LARGE_INTEGER TimeStamp;
22     };
23     GUID Guid;
24     ULONG ClientContext;
25     ULONG Flags;
26 } WNODE_HEADER, *PWNODE_HEADER;
27 
28 #define WNODE_FLAG_ALL_DATA             0x00000001
29 #define WNODE_FLAG_SINGLE_INSTANCE      0x00000002
30 #define WNODE_FLAG_SINGLE_ITEM          0x00000004
31 #define WNODE_FLAG_EVENT_ITEM           0x00000008
32 #define WNODE_FLAG_FIXED_INSTANCE_SIZE  0x00000010
33 #define WNODE_FLAG_TOO_SMALL            0x00000020
34 #define WNODE_FLAG_INSTANCES_SAME       0x00000040
35 #define WNODE_FLAG_STATIC_INSTANCE_NAMES 0x00000080
36 #define WNODE_FLAG_INTERNAL             0x00000100
37 #define WNODE_FLAG_USE_TIMESTAMP        0x00000200
38 #define WNODE_FLAG_PERSIST_EVENT        0x00000400
39 #define WNODE_FLAG_EVENT_REFERENCE      0x00002000
40 #define WNODE_FLAG_ANSI_INSTANCENAMES   0x00004000
41 #define WNODE_FLAG_METHOD_ITEM          0x00008000
42 #define WNODE_FLAG_PDO_INSTANCE_NAMES   0x00010000
43 #define WNODE_FLAG_TRACED_GUID          0x00020000
44 #define WNODE_FLAG_LOG_WNODE            0x00040000
45 #define WNODE_FLAG_USE_GUID_PTR         0x00080000
46 #define WNODE_FLAG_USE_MOF_PTR          0x00100000
47 #define WNODE_FLAG_NO_HEADER            0x00200000
48 #define WNODE_FLAG_SEVERITY_MASK        0xff000000
49 
50 typedef struct tagWNODE_TOO_SMALL
51 {
52     struct _WNODE_HEADER WnodeHeader;
53     ULONG SizeNeeded;
54 } WNODE_TOO_SMALL, *PWNODE_TOO_SMALL;
55 
56 typedef struct tagWNODE_SINGLE_INSTANCE
57 {
58     struct _WNODE_HEADER WnodeHeader;
59     ULONG OffsetInstanceName;
60     ULONG InstanceIndex;
61     ULONG DataBlockOffset;
62     ULONG SizeDataBlock;
63     UCHAR VariableData[];
64 } WNODE_SINGLE_INSTANCE, *PWNODE_SINGLE_INSTANCE;
65 
66 #define WMIREG_FLAG_EXPENSIVE           0x00000001
67 #define WMIREG_FLAG_INSTANCE_LIST       0x00000004
68 #define WMIREG_FLAG_INSTANCE_BASENAME   0x00000008
69 #define WMIREG_FLAG_INSTANCE_PDO        0x00000020
70 #define WMIREG_FLAG_REMOVE_GUID         0x00010000
71 #define WMIREG_FLAG_RESERVED1           0x00020000
72 #define WMIREG_FLAG_RESERVED2           0x00040000
73 #define WMIREG_FLAG_TRACED_GUID         0x00080000
74 #define WMIREG_FLAG_TRACE_CONTROL_GUID  0x00001000
75 #define WMIREG_FLAG_EVENT_ONLY_GUID     0x00000040
76 
77 typedef struct
78 {
79     GUID Guid;
80     ULONG Flags;
81     ULONG InstanceCount;
82     union
83     {
84         ULONG InstanceNameList;
85         ULONG BaseNameOffset;
86         ULONG_PTR Pdo;
87         ULONG_PTR InstanceInfo;
88     };
89 } WMIREGGUIDW, *PWMIREGGUIDW;
90 
91 typedef struct
92 {
93     ULONG BufferSize;
94     ULONG NextWmiRegInfo;
95     ULONG RegistryPath;
96     ULONG MofResourceName;
97     ULONG GuidCount;
98     WMIREGGUIDW WmiRegGuid[];
99 } WMIREGINFOW, *PWMIREGINFOW;
100 
101 typedef WMIREGINFOW WMIREGINFO;
102 typedef PWMIREGINFOW PWMIREGINFO;
103 
104 typedef struct
105 {
106     ULONG OffsetInstanceData;
107     ULONG LengthInstanceData;
108 } OFFSETINSTANCEDATAANDLENGTH, *POFFSETINSTANCEDATAANDLENGTH;
109 
110 typedef struct tagWNODE_ALL_DATA
111 {
112     struct _WNODE_HEADER WnodeHeader;
113     ULONG DataBlockOffset;
114     ULONG InstanceCount;
115     ULONG OffsetInstanceNameOffsets;
116     union
117     {
118         ULONG FixedInstanceSize;
119         OFFSETINSTANCEDATAANDLENGTH OffsetInstanceDataAndLength[0];
120     };
121 } WNODE_ALL_DATA, *PWNODE_ALL_DATA;
122 
123 typedef struct tagWNODE_SINGLE_ITEM
124 {
125     struct _WNODE_HEADER WnodeHeader;
126     ULONG OffsetInstanceName;
127     ULONG InstanceIndex;
128     ULONG ItemId;
129     ULONG DataBlockOffset;
130     ULONG SizeDataItem;
131     UCHAR VariableData[];
132 } WNODE_SINGLE_ITEM, *PWNODE_SINGLE_ITEM;
133 
134 typedef struct tagWNODE_METHOD_ITEM
135 {
136     struct _WNODE_HEADER WnodeHeader;
137     ULONG OffsetInstanceName;
138     ULONG InstanceIndex;
139     ULONG MethodId;
140     ULONG DataBlockOffset;
141     ULONG SizeDataBlock;
142     UCHAR VariableData[];
143 } WNODE_METHOD_ITEM, *PWNODE_METHOD_ITEM;
144 
145 typedef enum
146 {
147     WMI_GET_ALL_DATA = 0,
148     WMI_GET_SINGLE_INSTANCE,
149     WMI_SET_SINGLE_INSTANCE,
150     WMI_SET_SINGLE_ITEM,
151     WMI_ENABLE_EVENTS,
152     WMI_DISABLE_EVENTS,
153     WMI_ENABLE_COLLECTION,
154     WMI_DISABLE_COLLECTION,
155     WMI_REGINFO,
156     WMI_EXECUTE_METHOD
157 } WMIDPREQUESTCODE;
158 
159 #define WMIGUID_QUERY                 0x0001
160 #define WMIGUID_SET                   0x0002
161 #define WMIGUID_NOTIFICATION          0x0004
162 #define WMIGUID_READ_DESCRIPTION      0x0008
163 #define WMIGUID_EXECUTE               0x0010
164 #define TRACELOG_CREATE_REALTIME      0x0020
165 #define TRACELOG_CREATE_ONDISK        0x0040
166 #define TRACELOG_GUID_ENABLE          0x0080
167 #define TRACELOG_ACCESS_KERNEL_LOGGER 0x0100
168 #define TRACELOG_LOG_EVENT            0x0200
169 #define TRACELOG_CREATE_INPROC        0x0200
170 #define TRACELOG_ACCESS_REALTIME      0x0400
171 #define TRACELOG_REGISTER_GUIDS       0x0800
172 
173 #define WMIGUID_ALL_ACCESS (STANDARD_RIGHTS_READ | SYNCHRONIZE | 0xFFF)
174 
175 #endif /* _WMISTR_ */
176